aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-14 10:14:57 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-14 10:14:57 +0200
commit821da7c10e001e06e1b151e6306d770190048a39 (patch)
tree2a0eb1c777cfa06df4e365848b2f088b24bc3037
parentc815c6c5598f794d88334b4830bfb994cae4e18e (diff)
downloadltsi-kernel-821da7c10e001e06e1b151e6306d770190048a39.tar.gz
renesas patches added
-rw-r--r--patches.renesas/0001-media-v4l-vsp1-Update-copyright-notice.patch215
-rw-r--r--patches.renesas/0002-ARM-shmobile-wait-for-MSTP-clock-status-to-toggle-wh.patch119
-rw-r--r--patches.renesas/0003-clk-shmobile-div6-use-proper-description-in-kernel-d.patch33
-rw-r--r--patches.renesas/0004-clk-shmobile-add-CPG-driver-for-rz-platforms.patch174
-rw-r--r--patches.renesas/0005-clk-shmobile-rcar-gen2-fix-lb-sd0-sd1-sdh-clock-pare.patch56
-rw-r--r--patches.renesas/0006-clk-shmobile-fix-setting-paretn-clock-rate.patch35
-rw-r--r--patches.renesas/0007-clk-shmobile-clk-mstp-change-to-using-clock-indices.patch73
-rw-r--r--patches.renesas/0008-gpio-rcar-Add-helper-variable-dev-pdev-dev.patch114
-rw-r--r--patches.renesas/0009-mtd-m25p80-Add-dual-read-support.patch117
-rw-r--r--patches.renesas/0010-mtd-m25p80-Enable-Dual-SPI-read-transfers-for-s25fl2.patch35
-rw-r--r--patches.renesas/0011-mtd-delete-non-required-instances-of-include-linux-i.patch505
-rw-r--r--patches.renesas/0012-mtd-m25p80-Use-positive-logic-to-check-JEDEC-ID.patch34
-rw-r--r--patches.renesas/0013-mtd-m25p80-add-support-for-the-Spansion-s25fl008k-ch.patch30
-rw-r--r--patches.renesas/0014-mtd-m25p80-add-Macronix-mx66l1g55g-1Gbit-SPI-flash.patch28
-rw-r--r--patches.renesas/0015-pinctrl-Quiet-logging-about-missing-DT-nodes-when-no.patch36
-rw-r--r--patches.renesas/0016-drm-rcar-du-Handle-encoder-initialization-failures.patch35
-rw-r--r--patches.renesas/0017-ASoC-rsnd-tidyup-register-naming-of-BUSIF_MODE.patch62
-rw-r--r--patches.renesas/0018-ASoC-rsnd-cleanup-debug-information-method.patch122
-rw-r--r--patches.renesas/0019-ASoC-rsnd-remove-meaningless-rsnd_ssi_non.patch48
-rw-r--r--patches.renesas/0020-ASoC-rsnd-control-SCU-ops-in-probe-timing.patch97
-rw-r--r--patches.renesas/0021-ASoC-rsnd-add-rsnd_scu_init-and-separate-init-start.patch85
-rw-r--r--patches.renesas/0022-ASoC-rsnd-remove-meaningless-function-parameter.patch74
-rw-r--r--patches.renesas/0023-ASoC-rsnd-merge-rsnd_scu_start-stop-and-rsnd_scu_tra.patch103
-rw-r--r--patches.renesas/0024-ASoC-rsnd-rsnd_dai_is_clk_master-can-be-shared.patch81
-rw-r--r--patches.renesas/0025-ASoC-rsnd-remove-pin-sync-option.patch47
-rw-r--r--patches.renesas/0026-ASoC-rsnd-SSI_MODE0-1-settings-goes-to-scu.c.patch250
-rw-r--r--patches.renesas/0027-ASoC-rsnd-remove-ssiu-from-ssi.c.patch106
-rw-r--r--patches.renesas/0028-ASoC-rsnd-rename-rsnd_scu_convert_rate_ctrl.patch48
-rw-r--r--patches.renesas/0029-ASoC-rsnd-explain-SRC-bypass-mode-settings-in-commen.patch75
-rw-r--r--patches.renesas/0030-ASoC-rsnd-remove-duplicate-priv-from-rsnd_dma.patch63
-rw-r--r--patches.renesas/0031-ASoC-rsnd-non-0-is-error-on-probe.patch51
-rw-r--r--patches.renesas/0032-ASoC-rsnd-fixup-Gen2-module-naming.patch31
-rw-r--r--patches.renesas/0033-ASoC-rsnd-don-t-use-schedule_work-when-rsnd_dma_star.patch67
-rw-r--r--patches.renesas/0034-ASoC-rsnd-SCU-should-be-called-before-SSI.patch39
-rw-r--r--patches.renesas/0035-ASoC-rsnd-clarify-scu.c-area.patch43
-rw-r--r--patches.renesas/0036-ASoC-rsnd-Merge-macros-in-scu.c.patch68
-rw-r--r--patches.renesas/0037-ASoC-rsnd-rsnd_scu_hpbif_is_enable-become-macro.patch85
-rw-r--r--patches.renesas/0038-ASoC-rsnd-merge-SRC-clock-timing-setting.patch182
-rw-r--r--patches.renesas/0039-ASoC-rsnd-add-rsnd_ssi_is_play.patch67
-rw-r--r--patches.renesas/0040-ASoC-rsnd-extracts-Gen1-Gen2-common-parts.patch482
-rw-r--r--patches.renesas/0041-ASoC-rsnd-remove-SSI-dependent-DMAEngine-callback.patch294
-rw-r--r--patches.renesas/0042-ASoC-rsnd-rsnd_ssi_probe-goes-forwarder-than-rsnd_sc.patch42
-rw-r--r--patches.renesas/0043-ASoC-rsnd-add-Gen2-SRC-and-DMAEngine-support.patch447
-rw-r--r--patches.renesas/0044-ASoC-rsnd-use-device-dependency-clock.patch84
-rw-r--r--patches.renesas/0045-ASoC-rsnd-tidyup-original-for_each_rsnd_xxx-macro.patch59
-rw-r--r--patches.renesas/0046-ASoC-rsnd-set-DIV_EN-register-on-rsnd_adg_set_conver.patch92
-rw-r--r--patches.renesas/0047-ASoC-rsnd-print-error-if-there-is-SRC-settings-misma.patch37
-rw-r--r--patches.renesas/0048-ASoC-rsnd-move-priv-member-settings-to-upper-side.patch44
-rw-r--r--patches.renesas/0049-ASoC-rsnd-move-rsnd_mod_call-macro.patch89
-rw-r--r--patches.renesas/0050-ASoC-rsnd-remove-verbose-function-parameter.patch191
-rw-r--r--patches.renesas/0051-ASoC-rsnd-remove-verbose-debug-message-from-scu-ssi.patch44
-rw-r--r--patches.renesas/0052-ASoC-rsnd-unify-rdai-naming.patch87
-rw-r--r--patches.renesas/0053-ASoC-rsnd-tidyup-RSND_SSI_xxx-flags.patch35
-rw-r--r--patches.renesas/0054-ASoC-rsnd-run-rsnd_path_init-when-probe-timing.patch278
-rw-r--r--patches.renesas/0055-ASoC-rsnd-use-mod-array-instead-of-list-on-rdai.patch223
-rw-r--r--patches.renesas/0056-ASoC-rsnd-get-ssi-scu-from-rsnd_dai_stream.patch120
-rw-r--r--patches.renesas/0057-ASoC-rsnd-use-devm_clk_get-instead-of-clk_get.patch63
-rw-r--r--patches.renesas/0058-ASoC-rsnd-use-function-pointer-for-each-probe.patch72
-rw-r--r--patches.renesas/0059-ASoC-rsnd-remove-unused-SSI_CONTROL.patch41
-rw-r--r--patches.renesas/0060-ASoC-rsnd-modify-rsnd_adg_ssi_ws_timing_gen2-paramet.patch54
-rw-r--r--patches.renesas/0061-ASoC-rsnd-share-reg_field-and-reduce-memory.patch138
-rw-r--r--patches.renesas/0062-ASoC-rsnd-add-struct-rsnd_dai_platform_info.patch161
-rw-r--r--patches.renesas/0063-ASoC-rsnd-Get-correct-SCU-ID.patch230
-rw-r--r--patches.renesas/0064-ASoC-rsnd-add-rsnd_scu_enable_ssi_irq.patch101
-rw-r--r--patches.renesas/0065-ASoC-rsnd-call-rsnd_scu_ssi_mode_init-from-SSI.patch163
-rw-r--r--patches.renesas/0066-ASoC-rsnd-add-probe-remove-callback-on-rsnd_mod_ops.patch90
-rw-r--r--patches.renesas/0067-ASoC-rsnd-use-mod-probe-method-on-SCU.patch113
-rw-r--r--patches.renesas/0068-ASoC-rsnd-use-mod-probe-method-on-SSI.patch184
-rw-r--r--patches.renesas/0069-ASoC-rsnd-nothing-to-do-on-rsnd_dai_remove.patch82
-rw-r--r--patches.renesas/0070-ASoC-rsnd-remove-all-rsnd_xxx_remove.patch148
-rw-r--r--patches.renesas/0071-ASoC-rsnd-rename-scu-to-src.patch907
-rw-r--r--patches.renesas/0072-ASoC-rcar-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch36
-rw-r--r--patches.renesas/0073-ASoC-rsnd-add-DeviceTree-support.patch549
-rw-r--r--patches.renesas/0074-ASoC-rcar-bugfix-it-cares-about-the-non-src-case.patch51
-rw-r--r--patches.renesas/0075-ASoC-rsnd-fix-clock-prepare-unprepare.patch68
-rw-r--r--patches.renesas/0076-ASoC-rsnd-call-rsnd_dai_pointer_update-from-outside-.patch44
-rw-r--r--patches.renesas/0077-thermal-rcar-thermal-fix-same-mask-applied-twice.patch33
-rw-r--r--patches.renesas/0078-thermal-rcar-thermal-update-thermal-zone-only-when-t.patch75
-rw-r--r--patches.renesas/0079-spi-rspi-Remove-unused-mesg-parameter-from-send-rece.patch110
-rw-r--r--patches.renesas/0080-spi-rspi-Use-core-message-handling.patch200
-rw-r--r--patches.renesas/0081-spi-rspi-Abstract-8-16-bit-Data-Register-access.patch183
-rw-r--r--patches.renesas/0082-spi-rspi-Add-rspi_data_-out-in-out_in-helpers.patch194
-rw-r--r--patches.renesas/0083-spi-rspi-Abstract-transfer_one-for-RSPI-and-QSPI.patch115
-rw-r--r--patches.renesas/0084-spi-rspi-Merge-rspi_send_pio-and-rspi_receive_pio.patch158
-rw-r--r--patches.renesas/0085-spi-rspi-Merge-qspi_send_pio-and-qspi_receive_pio.patch130
-rw-r--r--patches.renesas/0086-spi-rspi-Add-support-for-more-than-one-interrupt.patch242
-rw-r--r--patches.renesas/0087-spi-rspi-Add-support-for-RSPI-on-RZ-A1H.patch214
-rw-r--r--patches.renesas/0088-spi-rspi-Add-support-for-loopback-mode.patch87
-rw-r--r--patches.renesas/0089-spi-rspi-Convert-to-clk_prepare_enable-disable_unpre.patch55
-rw-r--r--patches.renesas/0090-spi-rspi-Use-NULL-as-the-clock-ID.patch40
-rw-r--r--patches.renesas/0091-spi-rspi-Add-DT-support.patch250
-rw-r--r--patches.renesas/0092-spi-rspi-Add-support-for-Quad-and-Dual-SPI-Transfers.patch314
-rw-r--r--patches.renesas/0093-spi-rspi-fix-build-error-when-CONFIG_OF-is-not-set.patch34
-rw-r--r--patches.renesas/0094-spi-rspi-Only-enable-interrupts-when-there-s-a-need-.patch64
-rw-r--r--patches.renesas/0095-spi-rspi-Remove-empty-rspi_cleanup.patch41
-rw-r--r--patches.renesas/0096-spi-rspi-Fix-loopback-mode-for-Dual-Quad-SPI-Transfe.patch38
-rw-r--r--patches.renesas/0097-spi-rspi-Add-runtime-PM-support-using-spi-core-auto_.patch65
-rw-r--r--patches.renesas/0098-sh-intc-Enable-driver-compilation-with-COMPILE_TEST.patch31
-rw-r--r--patches.renesas/0099-drivers-sh-compile-drivers-sh-pm_runtime.c-if-ARCH_S.patch116
-rw-r--r--patches.renesas/0100-sh_eth-use-ETH_ZLEN-instead-of-home-grown-define.patch50
-rw-r--r--patches.renesas/0101-sh_eth-add-device-tree-support.patch200
-rw-r--r--patches.renesas/0102-sh_eth-update-OF-PHY-registeration.patch148
-rw-r--r--patches.renesas/0103-sh_eth-exit-probe-with-unknown-register-layout.patch48
-rw-r--r--patches.renesas/0104-sh_eth-convert-pr_-to-netdev_-calls.patch53
-rw-r--r--patches.renesas/0105-sh_eth-convert-dev_-to-netdev_-calls.patch180
-rw-r--r--patches.renesas/0106-sh_eth-fold-netif_msg_-and-netdev_-calls-into-netif_.patch112
-rw-r--r--patches.renesas/0107-sh_eth-Use-the-platform-device-for-memory-allocation.patch54
-rw-r--r--patches.renesas/0108-sh_eth-Use-the-platform-device-as-the-MDIO-bus-paren.patch35
-rw-r--r--patches.renesas/0109-sh_eth-Simplify-MDIO-bus-initialization-and-release.patch110
-rw-r--r--patches.renesas/0110-sh_eth-Register-MDIO-bus-before-registering-the-netw.patch77
-rw-r--r--patches.renesas/0111-sh_eth-Remove-goto-statements-that-jump-straight-to-.patch121
-rw-r--r--patches.renesas/0112-sh_eth-ensure-pm_runtime-cannot-suspend-the-device-d.patch77
-rw-r--r--patches.renesas/0113-mmc-sh_mobile_sdhi-Use-modern-PM-macros-to-define-pm.patch36
-rw-r--r--patches.renesas/0114-mmc-tmio_mmc-Convert-from-legacy-to-modern-PM-ops.patch92
-rw-r--r--patches.renesas/0115-mmc-tmio-Adapt-to-proper-PM-configs-for-exported-fun.patch77
-rw-r--r--patches.renesas/0116-mmc-sdhi-tidyup-sh_mobile_sdhi_of_match-position.patch64
-rw-r--r--patches.renesas/0117-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7778.patch59
-rw-r--r--patches.renesas/0118-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7779.patch32
-rw-r--r--patches.renesas/0119-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7790.patch61
-rw-r--r--patches.renesas/0120-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7791.patch31
-rw-r--r--patches.renesas/0121-pinctrl-sh-pfc-r8a7791-Add-QSPI-pin-groups.patch116
-rw-r--r--patches.renesas/0122-pinctrl-sh-pfc-r8a7790-Break-out-USB0-OVC-VBUS.patch55
-rw-r--r--patches.renesas/0123-pinctrl-sh-pfc-r8a7790-Add-QSPI-pin-groups.patch87
-rw-r--r--patches.renesas/0124-pinctrl-pfc-r8a7791-add-mux-data-for-IIC-B-cores.patch113
-rw-r--r--patches.renesas/0125-pinctrl-sh-pfc-r8a7790-Add-alternative-MSIOF-pin-gro.patch212
-rw-r--r--patches.renesas/0126-pinctrl-sh-pfc-r8a7791-Add-alternative-MSIOF-pin-gro.patch551
-rw-r--r--patches.renesas/0127-sh-pfc-r8a7790-Fix-definition-of-IPSR5.patch34
-rw-r--r--patches.renesas/0128-sh-pfc-r8a7791-Fix-definition-of-MOD_SEL3.patch32
-rw-r--r--patches.renesas/0129-serial-sh-sci-Fix-cast-warning.patch35
-rw-r--r--patches.renesas/0130-serial-sh-sci-Fix-compatible-string-in-DT-bindings-e.patch34
-rw-r--r--patches.renesas/0131-serial-sh-sci-Add-missing-call-to-uart_remove_one_po.patch39
-rw-r--r--patches.renesas/0132-serial-sh-sci-Replace-printk-by-pr_.patch52
-rw-r--r--patches.renesas/0133-serial-sh-sci-Remove-useless-casts.patch52
-rw-r--r--patches.renesas/0134-serial-sh-sci-Add-more-register-documentation.patch237
-rw-r--r--patches.renesas/0135-serial-sh-sci-Replace-hardcoded-3-by-UART_PM_STATE_O.patch31
-rw-r--r--patches.renesas/0136-serial-sh-sci-Neaten-dev_-level-uses.patch141
-rw-r--r--patches.renesas/0137-cpufreq-remove-unused-notifier-CPUFREQ_-SUSPENDCHANG.patch182
-rw-r--r--patches.renesas/0138-media-media-soc_camera-rcar_vin-Add-support-for-10-b.patch54
-rw-r--r--patches.renesas/0139-i2c-add-deprecation-warning-for-class-based-instanti.patch54
-rw-r--r--patches.renesas/0140-i2c-rcar-add-compatible-entry-for-r8a7791.patch65
-rw-r--r--patches.renesas/0141-i2c-i2c-rcar-deprecate-class-based-instantiation.patch31
-rw-r--r--patches.renesas/0142-regulator-da9210-Remove-redundant-error-message.patch35
-rw-r--r--patches.renesas/0143-spi-Provide-core-support-for-DMA-mapping-transfers.patch193
-rw-r--r--patches.renesas/0144-spi-Provide-core-support-for-full-duplex-devices.patch116
-rw-r--r--patches.renesas/0145-spi-core-Ignore-unsupported-spi-tr-x-bus-width-prope.patch56
-rw-r--r--patches.renesas/0146-spi-Make-core-DMA-mapping-functions-generate-scatter.patch294
-rw-r--r--patches.renesas/0147-regulator-core-Allow-regulator_set_voltage-for-fixed.patch53
-rw-r--r--patches.renesas/0148-DMA-shdma-Fix-warnings-due-to-improper-casts-and-pri.patch90
-rw-r--r--patches.renesas/0149-shdma-add-R-Car-Audio-DMAC-peri-peri-driver.patch419
-rw-r--r--patches.renesas/0150-of-add-functions-to-count-number-of-elements-in-a-pr.patch171
-rw-r--r--patches.renesas/0151-ASoC-add-snd_soc_of_parse_audio_simple_widgets-for-D.patch144
-rw-r--r--patches.renesas/0152-ASoC-core-add-TDM-slot-parsing-from-DT-supports.patch149
-rw-r--r--patches.renesas/0153-clocksource-Add-Kconfig-entries-for-CMT-MTU2-TMU-and.patch74
-rw-r--r--patches.renesas/0154-clocksource-CMT-MTU2-TMU-and-STI-should-depend-on-GE.patch78
-rw-r--r--patches.renesas/0155-regulator-gpio-regulator-Remove-unneeded-OOM-error-m.patch35
-rw-r--r--patches.renesas/0156-regulator-gpio-add-gpios-status-for-DT.patch64
-rw-r--r--patches.renesas/0157-regulator-gpio-Document-regulator-type-property.patch29
-rw-r--r--patches.renesas/0158-regulator-gpio-print-warning-if-gpios-gpios-states-m.patch30
-rw-r--r--patches.renesas/0159-regulator-gpio-explain-detail-of-gpios-states.patch32
-rw-r--r--patches.renesas/0160-regulator-gpio-regulator-do-not-open-code-counting-a.patch73
-rw-r--r--patches.renesas/0161-regulator-gpio-regulator-fix-forgotten-gpios-states-.patch62
-rw-r--r--patches.renesas/0162-ASoC-simple-card-simplify-code.patch49
-rw-r--r--patches.renesas/0163-ASoC-simple-card-simplify-code.patch84
-rw-r--r--patches.renesas/0164-ASoC-simple-card-simplify-code.patch171
-rw-r--r--patches.renesas/0165-ASoC-simple-card-simplify-code.patch107
-rw-r--r--patches.renesas/0166-ASoC-simple-card-simplify-code.patch109
-rw-r--r--patches.renesas/0167-ASoC-simple-card-simplify-code.patch112
-rw-r--r--patches.renesas/0168-ASoC-simple-card-simplify-code.patch84
-rw-r--r--patches.renesas/0169-ASoC-simple-card-simplify-code.patch118
-rw-r--r--patches.renesas/0170-ASoC-simple-card-fix-__asoc_simple_card_dai_init.patch60
-rw-r--r--patches.renesas/0171-ASoC-simple-card-simplify-the-daifmt-code.patch99
-rw-r--r--patches.renesas/0172-ASoC-simple-card-Add-snd_card-s-name-parsing-from-DT.patch49
-rw-r--r--patches.renesas/0173-ASoC-simple-card-add-off-codec-widgets-supports.patch35
-rw-r--r--patches.renesas/0174-ASoC-simple-card-for-new-properties-documenting-and-.patch58
-rw-r--r--patches.renesas/0175-ASoC-simple-card-add-slot-information-parsing-suppor.patch105
-rw-r--r--patches.renesas/0176-ASoC-simple-card-cpu_dai_name-creates-confusion-when.patch53
-rw-r--r--patches.renesas/0177-ASoC-simple-card-tidyup-cpu-codec-dai_fmt-settings-f.patch37
-rw-r--r--patches.renesas/0178-ASoC-simple-card-card-name-can-be-option.patch41
-rw-r--r--patches.renesas/0179-ASoC-simple-card-Fix-the-reference-count-of-device-n.patch140
-rw-r--r--patches.renesas/0180-ASoC-simple-card-Simplify-code.patch76
-rw-r--r--patches.renesas/0181-ASoC-simple-card-overwrite-cpu_dai-fmt-with-codec_da.patch109
-rw-r--r--patches.renesas/0182-ASoC-simple-card-dynamically-allocate-the-DAI-link-a.patch117
-rw-r--r--patches.renesas/0183-ASoC-simple-card-Add-DT-documentation-for-multi-DAI-.patch83
-rw-r--r--patches.renesas/0184-ASoC-simple-card-Handle-many-DAI-links.patch287
-rw-r--r--patches.renesas/0185-spi-delete-non-required-instances-of-include-linux-i.patch397
-rw-r--r--patches.renesas/0186-spi-sh-msiof-Fix-SPI-bus-population-from-DT.patch31
-rw-r--r--patches.renesas/0187-spi-sh-msiof-Typo-in-comment-s-tx-rx.patch29
-rw-r--r--patches.renesas/0188-spi-sh-msiof-Change-hz-from-unsigned-long-to-u32.patch45
-rw-r--r--patches.renesas/0189-spi-sh-msiof-Add-more-register-documentation.patch215
-rw-r--r--patches.renesas/0190-spi-sh-msiof-Use-the-core-cs_gpio-field-and-make-it-.patch72
-rw-r--r--patches.renesas/0191-spi-sh-msiof-Improve-bindings.patch75
-rw-r--r--patches.renesas/0192-spi-sh-msiof-Move-default-FIFO-sizes-to-device-ID-da.patch147
-rw-r--r--patches.renesas/0193-spi-sh-msiof-Add-support-for-R-Car-H2-and-M2.patch174
-rw-r--r--patches.renesas/0194-spi-sh-msiof-Move-clock-management-to-un-prepare_mes.patch134
-rw-r--r--patches.renesas/0195-spi-sh-msiof-Convert-to-let-spi-core-validate-xfer-b.patch60
-rw-r--r--patches.renesas/0196-spi-sh-msiof-Use-core-message-handling-instead-of-sp.patch186
-rw-r--r--patches.renesas/0197-spi-sh-msiof-Kill-sh_msiof_spi_bits-and-sh_msiof_spi.patch71
-rw-r--r--patches.renesas/0198-spi-sh-msiof-Remove-renesas-msiof-sh7724-from-bindin.patch31
-rw-r--r--patches.renesas/0199-spi-sh-msiof-Convert-to-spi-core-auto_runtime_pm-fra.patch89
-rw-r--r--patches.renesas/0200-ARM-shmobile-dts-Remove-r8a7791-koelsch-reference.dt.patch141
-rw-r--r--patches.renesas/0201-ARM-shmobile-Add-GPIO-keys-to-Koelsch-DTS.patch84
-rw-r--r--patches.renesas/0202-ARM-shmobile-koelsch-1-1-GiB-memory-in-DT.patch37
-rw-r--r--patches.renesas/0203-ARM-shmobile-r8a7791-Add-thermal-clock-in-device-tre.patch31
-rw-r--r--patches.renesas/0204-ARM-shmobile-r8a7790-Add-thermal-clock-in-device-tre.patch31
-rw-r--r--patches.renesas/0205-ARM-shmobile-r8a7791-Add-serial-ports-to-the-device-.patch209
-rw-r--r--patches.renesas/0206-ARM-shmobile-r8a7790-Add-serial-ports-to-the-device-.patch130
-rw-r--r--patches.renesas/0207-ARM-shmobile-r8a7790-Add-VIN-clocks-to-device-tree.patch37
-rw-r--r--patches.renesas/0208-ARM-shmobile-r8a7791-Add-VIN-clocks-to-device-tree.patch37
-rw-r--r--patches.renesas/0209-ARM-shmobile-r8a7790-Add-SATA-clocks-to-device-tree.patch41
-rw-r--r--patches.renesas/0210-ARM-shmobile-r8a7791-Add-SATA-clocks-to-device-tree.patch40
-rw-r--r--patches.renesas/0211-ARM-shmobile-r8a7791-Add-SATA-nodes-to-r8a7791.dtsi.patch48
-rw-r--r--patches.renesas/0212-ARM-shmobile-koelsch-Enable-SATA0-in-r8a7791-koelsch.patch33
-rw-r--r--patches.renesas/0213-ARM-shmobile-r8a7790-Add-SATA-nodes-to-r8a7790.dtsi.patch48
-rw-r--r--patches.renesas/0214-ARM-shmobile-lager-Enable-SATA1-in-r8a7790-lager.dts.patch33
-rw-r--r--patches.renesas/0215-ARM-shmobile-r8a7790-Fix-serial-ports-DT-compatible-.patch113
-rw-r--r--patches.renesas/0216-ARM-shmobile-r8a7790-Replace-IRQ-type-numerical-valu.patch112
-rw-r--r--patches.renesas/0217-ARM-shmobile-Lager-conditionally-select-CONFIG_MICRE.patch40
-rw-r--r--patches.renesas/0218-ARM-shmobile-bockw-use-SSI-DMAEngine-for-sound.patch45
-rw-r--r--patches.renesas/0219-ARM-shmobile-bockw-use-HPBIF-DMAEngine-for-sound.patch58
-rw-r--r--patches.renesas/0220-ARM-shmobile-bockw-add-USB-Func-DMAEngine-support.patch29
-rw-r--r--patches.renesas/0221-ARM-shmobile-koelsch-Conditionally-select-MICREL_PHY.patch32
-rw-r--r--patches.renesas/0222-ARM-mach-shmobile-kzm9g-add-zboot-support.patch506
-rw-r--r--patches.renesas/0223-ARM-shmobile-lager-Add-VIN1-SoC-camera-support.patch141
-rw-r--r--patches.renesas/0224-ARM-shmobile-kzm9d-Use-common-clock-framework.patch45
-rw-r--r--patches.renesas/0225-ARM-shmobile-lager-Make-spi_flash_data-const.patch29
-rw-r--r--patches.renesas/0226-ARM-shmobile-lager-Add-SATA-support.patch57
-rw-r--r--patches.renesas/0227-ARM-shmobile-koelsch-Add-SATA0-support.patch56
-rw-r--r--patches.renesas/0228-ARM-shmobile-ape6evm-Conditionally-select-SMSC_PHY.patch37
-rw-r--r--patches.renesas/0229-ARM-shmobile-armadillo800eva-Conditionally-select-SM.patch39
-rw-r--r--patches.renesas/0230-ARM-shmobile-bockw-Sort-Kconfig-node-s-selections.patch33
-rw-r--r--patches.renesas/0231-ARM-shmobile-r8a7779-Wait-for-status-on-selected-MST.patch57
-rw-r--r--patches.renesas/0232-ARM-shmobile-r8a7790-Wait-for-status-on-all-MSTP-clo.patch158
-rw-r--r--patches.renesas/0233-ARM-shmobile-r8a7791-Add-I2C-clocks.patch59
-rw-r--r--patches.renesas/0234-ARM-shmobile-r8a7791-Add-VIN-clocks.patch80
-rw-r--r--patches.renesas/0235-ARM-shmobile-Remove-duplicate-shmobile_invalidate_st.patch29
-rw-r--r--patches.renesas/0236-ARM-shmobile-r8a7779-Remove-unused-clock-constants.patch38
-rw-r--r--patches.renesas/0237-ARM-shmobile-emev2-Use-__initconst-for-const-init-de.patch35
-rw-r--r--patches.renesas/0238-ARM-shmobile-r8a7791-Wait-for-status-on-all-MSTP-clo.patch111
-rw-r--r--patches.renesas/0239-ARM-shmobile-r8a7790-add-Audio-DMAC-clock.patch48
-rw-r--r--patches.renesas/0240-ARM-shmobile-r8a7790-add-Audio-DMAC-support.patch177
-rw-r--r--patches.renesas/0241-ARM-shmobile-r8a7790-Add-VIN-clock-support.patch54
-rw-r--r--patches.renesas/0242-ARM-shmobile-r8a7790-Add-SATA-clocks.patch51
-rw-r--r--patches.renesas/0243-ARM-shmobile-r8a7791-Add-ZS-clock.patch46
-rw-r--r--patches.renesas/0244-ARM-shmobile-r8a7791-Add-SATA-clocks.patch48
-rw-r--r--patches.renesas/0245-ARM-shmobile-r7s72100-really-add-i2c-clocks.patch37
-rw-r--r--patches.renesas/0246-ARM-shmobile-r8a7790-Add-PCI-USB-host-clock-support.patch50
-rw-r--r--patches.renesas/0247-ARM-shmobile-lager-Enable-VIN-along-with-ADV7180-dec.patch39
-rw-r--r--patches.renesas/0248-ARM-shmobile-koelsch-Enable-SATA-in-defconfig.patch40
-rw-r--r--patches.renesas/0249-ARM-shmobile-koelsch-Enable-DEVTMPFS_MOUNT-in-defcon.patch33
-rw-r--r--patches.renesas/0250-ARM-shmobile-lager-Enable-SATA-in-defconfig.patch32
-rw-r--r--patches.renesas/0251-ARM-shmobile-marzen-enable-CONFIG_DEVTMPFS-in-defcon.patch37
-rw-r--r--patches.renesas/0252-ARM-shmobile-mackerel-enable-CONFIG_DEVTMPFS-in-defc.patch32
-rw-r--r--patches.renesas/0253-ARM-shmobile-lager-enable-CONFIG_DEVTMPFS-in-defconf.patch34
-rw-r--r--patches.renesas/0254-ARM-shmobile-kzm9g-enable-CONFIG_DEVTMPFS-in-defconf.patch32
-rw-r--r--patches.renesas/0255-ARM-shmobile-kzm9d-enable-CONFIG_DEVTMPFS-in-defconf.patch32
-rw-r--r--patches.renesas/0256-ARM-shmobile-genmai-enable-CONFIG_DEVTMPFS-in-defcon.patch32
-rw-r--r--patches.renesas/0257-ARM-shmobile-bockw-enable-CONFIG_DEVTMPFS-in-defconf.patch35
-rw-r--r--patches.renesas/0258-ARM-shmobile-armadillo-enable-CONFIG_DEVTMPFS-in-def.patch32
-rw-r--r--patches.renesas/0259-ARM-shmobile-ape6evm-enable-CONFIG_DEVTMPFS-in-defco.patch32
-rw-r--r--patches.renesas/0260-ARM-shmobile-kzm9d-Conditionally-select-SMSC_PHY.patch35
-rw-r--r--patches.renesas/0261-ARM-shmobile-mackerel-Conditionally-select-SMSC_PHY.patch31
-rw-r--r--patches.renesas/0262-ARM-shmobile-marzen-Conditionally-select-SMSC_PHY.patch39
-rw-r--r--patches.renesas/0263-ARM-shmobile-lager-fix-error-return-code-check-from-.patch50
-rw-r--r--patches.renesas/0264-ARM-shmobile-koelsch-fix-error-return-code-check-fro.patch50
-rw-r--r--patches.renesas/0265-ARM-shmobile-lager-Add-USBHS-support.patch196
-rw-r--r--patches.renesas/0266-ARM-shmobile-Remove-Lager-USBHS-UDC-ifdefs.patch46
-rw-r--r--patches.renesas/0267-ARM-shmobile-Lager-pass-Ether-PHY-IRQ.patch49
-rw-r--r--patches.renesas/0268-ARM-shmobile-Koelsch-pass-Ether-PHY-IRQ.patch49
-rw-r--r--patches.renesas/0269-ARM-shmobile-koelsch-Add-I2C-support.patch93
-rw-r--r--patches.renesas/0270-ARM-shmobile-koelsch-Enable-I2C-in-defconfig.patch31
-rw-r--r--patches.renesas/0271-ARM-shmobile-bockw-use-wp-gpios-instead-of-WP-pin.patch52
-rw-r--r--patches.renesas/0272-ARM-shmobile-Lager-USB0-cable-detection-workaround.patch83
-rw-r--r--patches.renesas/0273-ARM-shmobile-lager-add-sound-support.patch179
-rw-r--r--patches.renesas/0274-ARM-shmobile-lager-add-sound-support-on-defconfig.patch31
-rw-r--r--patches.renesas/0275-Revert-ARM-shmobile-marzen-Conditionally-select-SMSC.patch40
-rw-r--r--patches.renesas/0276-ARM-shmobile-genmai-legacy-Add-RSPI-support.patch86
-rw-r--r--patches.renesas/0277-ARM-shmobile-r7s72100-dtsi-Add-RSPI-nodes.patch128
-rw-r--r--patches.renesas/0278-ARM-shmobile-koelsch-legacy-Add-QSPI-support.patch124
-rw-r--r--patches.renesas/0279-ARM-shmobile-r8a7791-dtsi-Add-QSPI-node.patch38
-rw-r--r--patches.renesas/0280-ARM-shmobile-koelsch-dts-Add-QSPI-nodes.patch69
-rw-r--r--patches.renesas/0281-ARM-shmobile-lager-legacy-Switch-QSPI-to-named-IRQs.patch30
-rw-r--r--patches.renesas/0282-ARM-shmobile-koelsch-defconfig-Enable-RSPI-and-MTD_M.patch43
-rw-r--r--patches.renesas/0283-ARM-shmobile-genmai-defconfig-Enable-RSPI.patch30
-rw-r--r--patches.renesas/0284-ARM-shmobile-genmai-Enable-r7s72100-ether.patch61
-rw-r--r--patches.renesas/0285-ARM-shmobile-Add-SDHI-devices-for-legacy-Koelsch.patch214
-rw-r--r--patches.renesas/0286-ARM-shmobile-lager-add-SDHI0-2-support.patch123
-rw-r--r--patches.renesas/0287-ARM-shmobile-lager-legacy-Add-QSPI-pinmux.patch33
-rw-r--r--patches.renesas/0288-ARM-shmobile-r8a7790-dtsi-Add-QSPI-node.patch38
-rw-r--r--patches.renesas/0289-ARM-shmobile-lager-dts-Add-QSPI-nodes.patch71
-rw-r--r--patches.renesas/0290-ARM-shmobile-lager-defconfig-Enable-RSPI-and-MTD_M25.patch43
-rw-r--r--patches.renesas/0291-ARM-shmobile-lager-add-SDHI0-2-support-on-DTS.patch117
-rw-r--r--patches.renesas/0292-ARM-shmobile-r8a7778-dtsi-Remove-duplicate-i2c-nodes.patch72
-rw-r--r--patches.renesas/0293-ARM-shmobile-Add-defconfig-for-shmobile-multiplatfor.patch160
-rw-r--r--patches.renesas/0294-ARM-shmobile-lager-Add-internal-USB-PCI-support.patch96
-rw-r--r--patches.renesas/0295-ARM-shmobile-lager-reference-Refactor-clock-lookup-h.patch77
-rw-r--r--patches.renesas/0296-ARM-shmobile-lager-Add-DU-device-to-DTS.patch43
-rw-r--r--patches.renesas/0297-ARM-shmobile-lager-reference-Add-DU-device.patch120
-rw-r--r--patches.renesas/0298-ARM-shmobile-koelsch-reference-Refactor-clock-lookup.patch81
-rw-r--r--patches.renesas/0299-ARM-shmobile-koelsch-reference-Add-DU-device.patch113
-rw-r--r--patches.renesas/0300-ARM-shmobile-koelsch-reference-Add-DU-device-to-DTS.patch43
-rw-r--r--patches.renesas/0301-ARM-shmobile-r8a7791-remove-superfluous-interrupt-pa.patch271
-rw-r--r--patches.renesas/0302-ARM-shmobile-r8a7790-remove-superfluous-interrupt-pa.patch271
-rw-r--r--patches.renesas/0303-ARM-shmobile-r8a7790-add-i2c-aliases-to-dtsi.patch35
-rw-r--r--patches.renesas/0304-ARM-shmobile-Armadillo-800-EVA-set-proper-DMA-masks-.patch34
-rw-r--r--patches.renesas/0305-ARM-shmobile-BOCK-W-set-proper-DMA-masks-for-Ether-d.patch67
-rw-r--r--patches.renesas/0306-ARM-shmobile-Lager-set-proper-DMA-masks-for-Ether-de.patch70
-rw-r--r--patches.renesas/0307-ARM-shmobile-Koelsch-set-proper-DMA-masks-for-Ether-.patch70
-rw-r--r--patches.renesas/0308-ARM-shmobile-Genmai-set-proper-DMA-masks-for-Ether-d.patch65
-rw-r--r--patches.renesas/0309-ARM-shmobile-Get-rid-of-legacy-KZM9D-defconfig.patch118
-rw-r--r--patches.renesas/0310-ARM-shmobile-koelsch-Enable-SDHI-GPIO-and-regulators.patch56
-rw-r--r--patches.renesas/0311-ARM-shmobile-Remove-KZM9D-board-code.patch106
-rw-r--r--patches.renesas/0312-ARM-shmobile-Remove-Koelsch-DT-reference-legacy-cloc.patch44
-rw-r--r--patches.renesas/0313-ARM-shmobile-Remove-Lager-DT-reference-legacy-clock-.patch43
-rw-r--r--patches.renesas/0314-ARM-shmobile-r8a7791-add-i2c-master-nodes-to-dtsi.patch104
-rw-r--r--patches.renesas/0315-ARM-shmobile-r8a7791-add-i2c2-bus-to-koelsch-dt.patch53
-rw-r--r--patches.renesas/0316-ARM-shmobile-r7s72100-add-nodes-for-i2c-controllers-.patch107
-rw-r--r--patches.renesas/0317-ARM-shmobile-genmai-adapt-dts-to-use-native-i2c-driv.patch39
-rw-r--r--patches.renesas/0318-ARM-shmobile-r7s72100-update-defconfig-for-I2C-usage.patch42
-rw-r--r--patches.renesas/0319-usb-host-remove-selects-of-USB_ARCH_HAS_-HCI.patch310
-rw-r--r--patches.renesas/0320-ARM-centralize-common-multi-platform-kconfig-options.patch768
-rw-r--r--patches.renesas/0321-ARM-select-HAVE_SMP-for-V7-multi-platform.patch272
-rw-r--r--patches.renesas/0322-ARM-select-MIGHT_HAVE_CACHE_L2X0-for-V6-and-V7-multi.patch163
-rw-r--r--patches.renesas/0323-ARM-shmobile-r8a7778-add-audio-clock-in-new-style.patch39
-rw-r--r--patches.renesas/0324-ARM-shmobile-r8a7790-add-audio-clock.patch111
-rw-r--r--patches.renesas/0325-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks.patch71
-rw-r--r--patches.renesas/0326-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks-for-DT.patch36
-rw-r--r--patches.renesas/0327-ARM-shmobile-r8a7791-clock-add-QSPI-clocks.patch85
-rw-r--r--patches.renesas/0328-ARM-shmobile-r7s72100-Add-clock-for-r7s72100-ether.patch52
-rw-r--r--patches.renesas/0329-ARM-shmobile-Add-r8a7791-legacy-SDHI-clocks.patch123
-rw-r--r--patches.renesas/0330-ARM-shmobile-Remove-legacy-r8a7790-DT-clocks.patch58
-rw-r--r--patches.renesas/0331-ARM-shmobile-Use-64-bit-dma_addr_t-on-r8a7790-r8a779.patch49
-rw-r--r--patches.renesas/0332-ARM-shmobile-Break-out-R-Car-SYSC-PM-code.patch498
-rw-r--r--patches.renesas/0333-ARM-shmobile-r8a7790-SYSC-setup-code.patch100
-rw-r--r--patches.renesas/0334-ARM-shmobile-r8a7790-CA7-SCU-enablement.patch57
-rw-r--r--patches.renesas/0335-ARM-shmobile-r8a7790-CA15-SCU-enablement.patch45
-rw-r--r--patches.renesas/0336-ARM-shmobile-Remove-__init-from-rcar_gen2_read_mode_.patch34
-rw-r--r--patches.renesas/0337-ARM-shmobile-r8a7791-Remove-legacy-clock-aliases-for.patch33
-rw-r--r--patches.renesas/0338-ARM-shmobile-r8a7790-add-sound-SCU-clock-support.patch70
-rw-r--r--patches.renesas/0339-ARM-shmobile-r8a7790-add-Ether-DT-support.patch50
-rw-r--r--patches.renesas/0340-ARM-shmobile-lager-add-Ether-DT-support.patch71
-rw-r--r--patches.renesas/0341-ARM-shmobile-r8a7791-add-Ether-DT-support.patch50
-rw-r--r--patches.renesas/0342-ARM-shmobile-koelsch-add-Ether-DT-support.patch70
-rw-r--r--patches.renesas/0343-ARM-shmobile-r8a7791-fix-clock-index-for-i2c5.patch30
-rw-r--r--patches.renesas/0344-ARM-shmobile-r8a7791-dtsi-Fix-typo-in-msiof2-clock-o.patch33
-rw-r--r--patches.renesas/0345-ARM-shmobile-Move-SYSC-base-variable-to-inside-ifdef.patch40
-rw-r--r--patches.renesas/0346-ARM-shmobile-Add-SDHI-devices-to-r8a7791-DTSI.patch56
-rw-r--r--patches.renesas/0347-ARM-shmobile-Add-SDHI-devices-for-Koelsch-DTS.patch167
-rw-r--r--patches.renesas/0348-ARM-shmobile-APMU-Fix-warnings-due-to-improper-print.patch34
-rw-r--r--patches.renesas/0349-ARM-shmobile-r7s72100-fix-bus-clock-calculation.patch32
-rw-r--r--patches.renesas/0350-ARM-shmobile-Remove-CMT-TMU-and-STI-Kconfig-entries.patch162
-rw-r--r--patches.renesas/0351-ARM-shmobile-r8a7791-Fix-SCIFA3-5-clocks.patch72
-rw-r--r--patches.renesas/0352-ASoC-fsi-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch154
-rw-r--r--patches.renesas/0353-ASoC-fsi-fixup-compile-error-for-simple-card.patch38
-rw-r--r--patches.renesas/0354-ARM-bockw-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch87
-rw-r--r--patches.renesas/0355-Kconfig-rename-HAS_IOPORT-to-HAS_IOPORT_MAP.patch763
-rw-r--r--patches.renesas/0356-ARM-shmobile-lager-correct-renesas-gpios-to-renesas-.patch43
-rw-r--r--patches.renesas/0357-ARM-shmobile-lager-fixup-SND_SOC_DAIFMT_CBx_CFx-flag.patch42
-rw-r--r--patches.renesas/0358-ARM-shmobile-armadillo800eva-fixup-SND_SOC_DAIFMT_CB.patch33
-rw-r--r--patches.renesas/0359-ARM-shmobile-r8a7778-Use-clks-as-MSTP007-parent.patch33
-rw-r--r--patches.renesas/0360-ARM-shmobile-sh73a0-drop-address-cells-from-GIC-node.patch36
-rw-r--r--patches.renesas/0361-ARM-shmobile-r8a7740-drop-address-cells-from-GIC-nod.patch36
-rw-r--r--patches.renesas/0362-ARM-shmobile-koelsch-correct-renesas-gpios-to-renesa.patch47
-rw-r--r--patches.renesas/0363-xhci-platform-Change-compatible-string-from-xhci-pla.patch59
-rw-r--r--patches.renesas/0364-ASoC-rcar-subnode-tidyup-for-renesas-rsnd.txt.patch50
-rw-r--r--patches.renesas/0365-ARM-shmobile-r8a7790-Correct-SYS-DMAC-clock-defines.patch38
-rw-r--r--series370
366 files changed, 36569 insertions, 0 deletions
diff --git a/patches.renesas/0001-media-v4l-vsp1-Update-copyright-notice.patch b/patches.renesas/0001-media-v4l-vsp1-Update-copyright-notice.patch
new file mode 100644
index 00000000000000..288a0bb41725c5
--- /dev/null
+++ b/patches.renesas/0001-media-v4l-vsp1-Update-copyright-notice.patch
@@ -0,0 +1,215 @@
+From 5d7a1aa76eba43c6c71aa2bd68313228765542de Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 6 Feb 2014 14:42:31 -0300
+Subject: [media] v4l: vsp1: Update copyright notice
+
+The "Renesas Corporation" listed in the copyright notice doesn't exist.
+Replace it with "Renesas Electronics Corporation" and update the
+copyright years.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+(cherry picked from commit 8a1edc55c1ec1ff3624c25b4ac6c1ce776d872b8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/media/platform/vsp1/vsp1.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_drv.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_entity.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_entity.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_lif.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_lif.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_rpf.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_rwpf.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_rwpf.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_uds.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_uds.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_video.c | 2 +-
+ drivers/media/platform/vsp1/vsp1_video.h | 2 +-
+ drivers/media/platform/vsp1/vsp1_wpf.c | 2 +-
+ 14 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/media/platform/vsp1/vsp1.h b/drivers/media/platform/vsp1/vsp1.h
+index 94d1b02680c5..0313210c6e9e 100644
+--- a/drivers/media/platform/vsp1/vsp1.h
++++ b/drivers/media/platform/vsp1/vsp1.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1.h -- R-Car VSP1 Driver
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
+index 0df0a994e575..2f74f0e0ddf5 100644
+--- a/drivers/media/platform/vsp1/vsp1_drv.c
++++ b/drivers/media/platform/vsp1/vsp1_drv.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_drv.c -- R-Car VSP1 Driver
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_entity.c b/drivers/media/platform/vsp1/vsp1_entity.c
+index 0226e47df6d9..3fc9e4266caf 100644
+--- a/drivers/media/platform/vsp1/vsp1_entity.c
++++ b/drivers/media/platform/vsp1/vsp1_entity.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_entity.c -- R-Car VSP1 Base Entity
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_entity.h b/drivers/media/platform/vsp1/vsp1_entity.h
+index e152798d7f38..f6fd6988aeb0 100644
+--- a/drivers/media/platform/vsp1/vsp1_entity.h
++++ b/drivers/media/platform/vsp1/vsp1_entity.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_entity.h -- R-Car VSP1 Base Entity
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c
+index 74a32e69ef10..135a78957014 100644
+--- a/drivers/media/platform/vsp1/vsp1_lif.c
++++ b/drivers/media/platform/vsp1/vsp1_lif.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_lif.c -- R-Car VSP1 LCD Controller Interface
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_lif.h b/drivers/media/platform/vsp1/vsp1_lif.h
+index 89b93af56fdc..7b35879028de 100644
+--- a/drivers/media/platform/vsp1/vsp1_lif.h
++++ b/drivers/media/platform/vsp1/vsp1_lif.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_lif.h -- R-Car VSP1 LCD Controller Interface
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c b/drivers/media/platform/vsp1/vsp1_rpf.c
+index bce2be5466b9..2b04d0f95c62 100644
+--- a/drivers/media/platform/vsp1/vsp1_rpf.c
++++ b/drivers/media/platform/vsp1/vsp1_rpf.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_rpf.c -- R-Car VSP1 Read Pixel Formatter
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.c b/drivers/media/platform/vsp1/vsp1_rwpf.c
+index 782f770daee5..ec3dab6a9b9b 100644
+--- a/drivers/media/platform/vsp1/vsp1_rwpf.c
++++ b/drivers/media/platform/vsp1/vsp1_rwpf.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_rwpf.c -- R-Car VSP1 Read and Write Pixel Formatters
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_rwpf.h b/drivers/media/platform/vsp1/vsp1_rwpf.h
+index 6cbdb547470b..5c5ee81bbeae 100644
+--- a/drivers/media/platform/vsp1/vsp1_rwpf.h
++++ b/drivers/media/platform/vsp1/vsp1_rwpf.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
+index 0e50b37f060d..622342ac7770 100644
+--- a/drivers/media/platform/vsp1/vsp1_uds.c
++++ b/drivers/media/platform/vsp1/vsp1_uds.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_uds.c -- R-Car VSP1 Up and Down Scaler
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_uds.h b/drivers/media/platform/vsp1/vsp1_uds.h
+index 972a285abdb9..479d12df1180 100644
+--- a/drivers/media/platform/vsp1/vsp1_uds.h
++++ b/drivers/media/platform/vsp1/vsp1_uds.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_uds.h -- R-Car VSP1 Up and Down Scaler
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
+index b4687a834f85..f5f6af5b46a2 100644
+--- a/drivers/media/platform/vsp1/vsp1_video.c
++++ b/drivers/media/platform/vsp1/vsp1_video.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_video.c -- R-Car VSP1 Video Node
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_video.h b/drivers/media/platform/vsp1/vsp1_video.h
+index d8612a378345..53e4b3745940 100644
+--- a/drivers/media/platform/vsp1/vsp1_video.h
++++ b/drivers/media/platform/vsp1/vsp1_video.h
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_video.h -- R-Car VSP1 Video Node
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
+index 7baed81ff005..11a61c601da0 100644
+--- a/drivers/media/platform/vsp1/vsp1_wpf.c
++++ b/drivers/media/platform/vsp1/vsp1_wpf.c
+@@ -1,7 +1,7 @@
+ /*
+ * vsp1_wpf.c -- R-Car VSP1 Write Pixel Formatter
+ *
+- * Copyright (C) 2013 Renesas Corporation
++ * Copyright (C) 2013-2014 Renesas Electronics Corporation
+ *
+ * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
+ *
+--
+2.1.2
+
diff --git a/patches.renesas/0002-ARM-shmobile-wait-for-MSTP-clock-status-to-toggle-wh.patch b/patches.renesas/0002-ARM-shmobile-wait-for-MSTP-clock-status-to-toggle-wh.patch
new file mode 100644
index 00000000000000..9a43e5674b441d
--- /dev/null
+++ b/patches.renesas/0002-ARM-shmobile-wait-for-MSTP-clock-status-to-toggle-wh.patch
@@ -0,0 +1,119 @@
+From 1a327c0e2e271f0d044713c4b05491e0e53c67c3 Mon Sep 17 00:00:00 2001
+From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Date: Sat, 14 Dec 2013 16:23:51 +0100
+Subject: ARM: shmobile: wait for MSTP clock status to toggle, when enabling it
+
+On r-/sh-mobile SoCs MSTP clocks are used by the runtime PM to dynamically
+enable and disable peripheral clocks. To make sure the clock has really
+started we have to read back its status register until it confirms success.
+
+Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a028c6da34d434e35ba8322568c756ea97ff3c18)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/sh/clk/cpg.c | 38 ++++++++++++++++++++++++++++++++++++++
+ include/linux/sh_clk.h | 19 ++++++++++++-------
+ 2 files changed, 50 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
+index 1ebe67cd1833..7442bc130055 100644
+--- a/drivers/sh/clk/cpg.c
++++ b/drivers/sh/clk/cpg.c
+@@ -36,9 +36,47 @@ static void sh_clk_write(int value, struct clk *clk)
+ iowrite32(value, clk->mapped_reg);
+ }
+
++static unsigned int r8(const void __iomem *addr)
++{
++ return ioread8(addr);
++}
++
++static unsigned int r16(const void __iomem *addr)
++{
++ return ioread16(addr);
++}
++
++static unsigned int r32(const void __iomem *addr)
++{
++ return ioread32(addr);
++}
++
+ static int sh_clk_mstp_enable(struct clk *clk)
+ {
+ sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
++ if (clk->status_reg) {
++ unsigned int (*read)(const void __iomem *addr);
++ int i;
++ void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
++ (phys_addr_t)clk->enable_reg + clk->mapped_reg;
++
++ if (clk->flags & CLK_ENABLE_REG_8BIT)
++ read = r8;
++ else if (clk->flags & CLK_ENABLE_REG_16BIT)
++ read = r16;
++ else
++ read = r32;
++
++ for (i = 1000;
++ (read(mapped_status) & (1 << clk->enable_bit)) && i;
++ i--)
++ cpu_relax();
++ if (!i) {
++ pr_err("cpg: failed to enable %p[%d]\n",
++ clk->enable_reg, clk->enable_bit);
++ return -ETIMEDOUT;
++ }
++ }
+ return 0;
+ }
+
+diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
+index 60c72395ec6b..1f208b2a1ed6 100644
+--- a/include/linux/sh_clk.h
++++ b/include/linux/sh_clk.h
+@@ -52,6 +52,7 @@ struct clk {
+ unsigned long flags;
+
+ void __iomem *enable_reg;
++ void __iomem *status_reg;
+ unsigned int enable_bit;
+ void __iomem *mapped_reg;
+
+@@ -116,22 +117,26 @@ 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);
+
+-#define SH_CLK_MSTP(_parent, _enable_reg, _enable_bit, _flags) \
++#define SH_CLK_MSTP(_parent, _enable_reg, _enable_bit, _status_reg, _flags) \
+ { \
+ .parent = _parent, \
+ .enable_reg = (void __iomem *)_enable_reg, \
+ .enable_bit = _enable_bit, \
++ .status_reg = _status_reg, \
+ .flags = _flags, \
+ }
+
+-#define SH_CLK_MSTP32(_p, _r, _b, _f) \
+- SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_32BIT)
++#define SH_CLK_MSTP32(_p, _r, _b, _f) \
++ SH_CLK_MSTP(_p, _r, _b, 0, _f | CLK_ENABLE_REG_32BIT)
+
+-#define SH_CLK_MSTP16(_p, _r, _b, _f) \
+- SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_16BIT)
++#define SH_CLK_MSTP32_STS(_p, _r, _b, _s, _f) \
++ SH_CLK_MSTP(_p, _r, _b, _s, _f | CLK_ENABLE_REG_32BIT)
+
+-#define SH_CLK_MSTP8(_p, _r, _b, _f) \
+- SH_CLK_MSTP(_p, _r, _b, _f | CLK_ENABLE_REG_8BIT)
++#define SH_CLK_MSTP16(_p, _r, _b, _f) \
++ SH_CLK_MSTP(_p, _r, _b, 0, _f | CLK_ENABLE_REG_16BIT)
++
++#define SH_CLK_MSTP8(_p, _r, _b, _f) \
++ SH_CLK_MSTP(_p, _r, _b, 0, _f | CLK_ENABLE_REG_8BIT)
+
+ int sh_clk_mstp_register(struct clk *clks, int nr);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0003-clk-shmobile-div6-use-proper-description-in-kernel-d.patch b/patches.renesas/0003-clk-shmobile-div6-use-proper-description-in-kernel-d.patch
new file mode 100644
index 00000000000000..3ef67123c04d4e
--- /dev/null
+++ b/patches.renesas/0003-clk-shmobile-div6-use-proper-description-in-kernel-d.patch
@@ -0,0 +1,33 @@
+From 596589d192a4b6ba6c1b03a7454094df1040d802 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 24 Feb 2014 20:57:11 +0100
+Subject: clk: shmobile: div6: use proper description in kernel doc
+
+These variable clocks have nothing to do with MSTP gating, probably a
+copy&paste leftover.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+(cherry picked from commit 95aa4f9b5fe577de902aa780e91140c6e89c73a2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/clk/shmobile/clk-div6.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/shmobile/clk-div6.c b/drivers/clk/shmobile/clk-div6.c
+index aac4756ec52e..f065f694cb65 100644
+--- a/drivers/clk/shmobile/clk-div6.c
++++ b/drivers/clk/shmobile/clk-div6.c
+@@ -23,7 +23,7 @@
+ #define CPG_DIV6_DIV_MASK 0x3f
+
+ /**
+- * struct div6_clock - MSTP gating clock
++ * struct div6_clock - CPG 6 bit divider clock
+ * @hw: handle between common and hardware-specific interfaces
+ * @reg: IO-remapped register
+ * @div: divisor value (1-64)
+--
+2.1.2
+
diff --git a/patches.renesas/0004-clk-shmobile-add-CPG-driver-for-rz-platforms.patch b/patches.renesas/0004-clk-shmobile-add-CPG-driver-for-rz-platforms.patch
new file mode 100644
index 00000000000000..0a4ed7fb64f4c3
--- /dev/null
+++ b/patches.renesas/0004-clk-shmobile-add-CPG-driver-for-rz-platforms.patch
@@ -0,0 +1,174 @@
+From 82e31e592d4b0cccb9dd5b557d5a7e06ca9b7780 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Fri, 7 Mar 2014 17:00:37 +0100
+Subject: clk: shmobile: add CPG driver for rz-platforms
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+(cherry picked from commit a665962e8f4484647e7a19b4d6329d42ed8bc804)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../bindings/clock/renesas,rz-cpg-clocks.txt | 29 ++++++
+ drivers/clk/shmobile/Makefile | 1 +
+ drivers/clk/shmobile/clk-rz.c | 103 +++++++++++++++++++++
+ 3 files changed, 133 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
+ create mode 100644 drivers/clk/shmobile/clk-rz.c
+
+diff --git a/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
+new file mode 100644
+index 000000000000..98a257492522
+--- /dev/null
++++ b/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
+@@ -0,0 +1,29 @@
++* Renesas RZ Clock Pulse Generator (CPG)
++
++The CPG generates core clocks for the RZ SoCs. It includes the PLL, variable
++CPU and GPU clocks, and several fixed ratio dividers.
++
++Required Properties:
++
++ - compatible: Must be one of
++ - "renesas,r7s72100-cpg-clocks" for the r7s72100 CPG
++ - "renesas,rz-cpg-clocks" for the generic RZ CPG
++ - reg: Base address and length of the memory resource used by the CPG
++ - clocks: References to possible parent clocks. Order must match clock modes
++ in the datasheet. For the r7s72100, this is extal, usb_x1.
++ - #clock-cells: Must be 1
++ - clock-output-names: The names of the clocks. Supported clocks are "pll",
++ "i", and "g"
++
++
++Example
++-------
++
++ cpg_clocks: cpg_clocks@fcfe0000 {
++ #clock-cells = <1>;
++ compatible = "renesas,r7s72100-cpg-clocks",
++ "renesas,rz-cpg-clocks";
++ reg = <0xfcfe0000 0x18>;
++ clocks = <&extal_clk>, <&usb_x1_clk>;
++ clock-output-names = "pll", "i", "g";
++ };
+diff --git a/drivers/clk/shmobile/Makefile b/drivers/clk/shmobile/Makefile
+index 9ecef140dba7..5404cb931ebf 100644
+--- a/drivers/clk/shmobile/Makefile
++++ b/drivers/clk/shmobile/Makefile
+@@ -1,4 +1,5 @@
+ obj-$(CONFIG_ARCH_EMEV2) += clk-emev2.o
++obj-$(CONFIG_ARCH_R7S72100) += clk-rz.o
+ obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o
+ obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o
+ obj-$(CONFIG_ARCH_SHMOBILE_MULTI) += clk-div6.o
+diff --git a/drivers/clk/shmobile/clk-rz.c b/drivers/clk/shmobile/clk-rz.c
+new file mode 100644
+index 000000000000..7e68e8630962
+--- /dev/null
++++ b/drivers/clk/shmobile/clk-rz.c
+@@ -0,0 +1,103 @@
++/*
++ * rz Core CPG Clocks
++ *
++ * Copyright (C) 2013 Ideas On Board SPRL
++ * Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.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.
++ */
++
++#include <linux/clk-provider.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/of.h>
++#include <linux/of_address.h>
++#include <linux/slab.h>
++
++struct rz_cpg {
++ struct clk_onecell_data data;
++ void __iomem *reg;
++};
++
++#define CPG_FRQCR 0x10
++#define CPG_FRQCR2 0x14
++
++/* -----------------------------------------------------------------------------
++ * Initialization
++ */
++
++static struct clk * __init
++rz_cpg_register_clock(struct device_node *np, struct rz_cpg *cpg, const char *name)
++{
++ u32 val;
++ unsigned mult;
++ static const unsigned frqcr_tab[4] = { 3, 2, 0, 1 };
++
++ if (strcmp(name, "pll") == 0) {
++ /* FIXME: cpg_mode should be read from GPIO. But no GPIO support yet */
++ unsigned cpg_mode = 0; /* hardcoded to EXTAL for now */
++ const char *parent_name = of_clk_get_parent_name(np, cpg_mode);
++
++ mult = cpg_mode ? (32 / 4) : 30;
++
++ return clk_register_fixed_factor(NULL, name, parent_name, 0, mult, 1);
++ }
++
++ /* If mapping regs failed, skip non-pll clocks. System will boot anyhow */
++ if (!cpg->reg)
++ return ERR_PTR(-ENXIO);
++
++ /* FIXME:"i" and "g" are variable clocks with non-integer dividers (e.g. 2/3)
++ * and the constraint that always g <= i. To get the rz platform started,
++ * let them run at fixed current speed and implement the details later.
++ */
++ if (strcmp(name, "i") == 0)
++ val = (clk_readl(cpg->reg + CPG_FRQCR) >> 8) & 3;
++ else if (strcmp(name, "g") == 0)
++ val = clk_readl(cpg->reg + CPG_FRQCR2) & 3;
++ else
++ return ERR_PTR(-EINVAL);
++
++ mult = frqcr_tab[val];
++ return clk_register_fixed_factor(NULL, name, "pll", 0, mult, 3);
++}
++
++static void __init rz_cpg_clocks_init(struct device_node *np)
++{
++ struct rz_cpg *cpg;
++ struct clk **clks;
++ unsigned i;
++ int num_clks;
++
++ num_clks = of_property_count_strings(np, "clock-output-names");
++ if (WARN(num_clks <= 0, "can't count CPG clocks\n"))
++ return;
++
++ cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
++ clks = kzalloc(num_clks * sizeof(*clks), GFP_KERNEL);
++ BUG_ON(!cpg || !clks);
++
++ cpg->data.clks = clks;
++ cpg->data.clk_num = num_clks;
++
++ cpg->reg = of_iomap(np, 0);
++
++ for (i = 0; i < num_clks; ++i) {
++ const char *name;
++ struct clk *clk;
++
++ of_property_read_string_index(np, "clock-output-names", i, &name);
++
++ clk = rz_cpg_register_clock(np, cpg, name);
++ if (IS_ERR(clk))
++ pr_err("%s: failed to register %s %s clock (%ld)\n",
++ __func__, np->name, name, PTR_ERR(clk));
++ else
++ cpg->data.clks[i] = clk;
++ }
++
++ of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
++}
++CLK_OF_DECLARE(rz_cpg_clks, "renesas,rz-cpg-clocks", rz_cpg_clocks_init);
+--
+2.1.2
+
diff --git a/patches.renesas/0005-clk-shmobile-rcar-gen2-fix-lb-sd0-sd1-sdh-clock-pare.patch b/patches.renesas/0005-clk-shmobile-rcar-gen2-fix-lb-sd0-sd1-sdh-clock-pare.patch
new file mode 100644
index 00000000000000..f4bb83684b9e23
--- /dev/null
+++ b/patches.renesas/0005-clk-shmobile-rcar-gen2-fix-lb-sd0-sd1-sdh-clock-pare.patch
@@ -0,0 +1,56 @@
+From 9affa85bbc7834c2e6f00b297c4cc4463268dd41 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Mon, 31 Mar 2014 15:50:34 +0100
+Subject: clk: shmobile: rcar-gen2: fix lb/sd0/sd1/sdh clock parent to pll1
+
+The clock generator for rcar-gen2 has the lb, sdh, sd0 and sd1 clocks
+parented to pll1_div2 where the hardware diagram shows these to be
+directly fed from pll1.
+
+This fixes the initial rate for sdh0 clock to be 97.5MHz instead of
+the reported 48MHz where the manual says the default register values
+are for 97.5MHz.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+(cherry picked from commit 365b01869bca1c9d5ecb05be7857739fa18a9b8c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/clk/shmobile/clk-rcar-gen2.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/clk/shmobile/clk-rcar-gen2.c b/drivers/clk/shmobile/clk-rcar-gen2.c
+index 99c27b1c625b..dff7f79a19b9 100644
+--- a/drivers/clk/shmobile/clk-rcar-gen2.c
++++ b/drivers/clk/shmobile/clk-rcar-gen2.c
+@@ -242,22 +242,22 @@ rcar_gen2_cpg_register_clock(struct device_node *np, struct rcar_gen2_cpg *cpg,
+ parent_name = "main";
+ mult = config->pll3_mult;
+ } else if (!strcmp(name, "lb")) {
+- parent_name = "pll1_div2";
++ parent_name = "pll1";
+ div = cpg_mode & BIT(18) ? 36 : 24;
+ } else if (!strcmp(name, "qspi")) {
+ parent_name = "pll1_div2";
+ div = (cpg_mode & (BIT(3) | BIT(2) | BIT(1))) == BIT(2)
+ ? 8 : 10;
+ } else if (!strcmp(name, "sdh")) {
+- parent_name = "pll1_div2";
++ parent_name = "pll1";
+ table = cpg_sdh_div_table;
+ shift = 8;
+ } else if (!strcmp(name, "sd0")) {
+- parent_name = "pll1_div2";
++ parent_name = "pll1";
+ table = cpg_sd01_div_table;
+ shift = 4;
+ } else if (!strcmp(name, "sd1")) {
+- parent_name = "pll1_div2";
++ parent_name = "pll1";
+ table = cpg_sd01_div_table;
+ shift = 0;
+ } else if (!strcmp(name, "z")) {
+--
+2.1.2
+
diff --git a/patches.renesas/0006-clk-shmobile-fix-setting-paretn-clock-rate.patch b/patches.renesas/0006-clk-shmobile-fix-setting-paretn-clock-rate.patch
new file mode 100644
index 00000000000000..0b0756edccfd71
--- /dev/null
+++ b/patches.renesas/0006-clk-shmobile-fix-setting-paretn-clock-rate.patch
@@ -0,0 +1,35 @@
+From 61264c41c132d68e59adb33576628dc882346425 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Mon, 31 Mar 2014 18:47:27 +0100
+Subject: clk: shmobile: fix setting paretn clock rate
+
+If the driver needs to change a clock rate, then it must be propogated
+through the MSTP clock to the parent clock (such as shdi0 -> sd0). Without
+this we cannot up-rate default clocks which are really slow (such as the
+mmcif1 which defaults to 12MHz where it could be running at 97MHz)
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+(cherry picked from commit e44df332f30bf3040c60c1ed6674d1431fdb48b9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/clk/shmobile/clk-mstp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
+index 42d5912b1d25..2e5810c88d11 100644
+--- a/drivers/clk/shmobile/clk-mstp.c
++++ b/drivers/clk/shmobile/clk-mstp.c
+@@ -137,7 +137,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
+
+ init.name = name;
+ init.ops = &cpg_mstp_clock_ops;
+- init.flags = CLK_IS_BASIC;
++ init.flags = CLK_IS_BASIC | CLK_SET_RATE_PARENT;
+ init.parent_names = &parent_name;
+ init.num_parents = 1;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0007-clk-shmobile-clk-mstp-change-to-using-clock-indices.patch b/patches.renesas/0007-clk-shmobile-clk-mstp-change-to-using-clock-indices.patch
new file mode 100644
index 00000000000000..33549b1527bd0e
--- /dev/null
+++ b/patches.renesas/0007-clk-shmobile-clk-mstp-change-to-using-clock-indices.patch
@@ -0,0 +1,73 @@
+From 268bdaf26a693062fd0ddbb3f87b15060da28e52 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Tue, 15 Apr 2014 17:06:34 +0100
+Subject: clk: shmobile: clk-mstp: change to using clock-indices
+
+With the addition of clock-indices, we need to change the renesas
+clock implementation to use these instead of the local definition
+of "renesas,clock-indices".
+
+Since this will break booting with older device trees, we add a
+simple auto-detection of which properties are present.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
+Signed-off-by: Mike Turquette <mturquette@linaro.org>
+(cherry picked from commit 8e33f91a0b84ae1964bef77cb92f5d41d97530c8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt | 2 +-
+ drivers/clk/shmobile/clk-mstp.c | 9 +++++++--
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
+index 5992dceec7af..02a25d99ca61 100644
+--- a/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
++++ b/Documentation/devicetree/bindings/clock/renesas,cpg-mstp-clocks.txt
+@@ -43,7 +43,7 @@ Example
+ clock-output-names =
+ "tpu0", "mmcif1", "sdhi3", "sdhi2",
+ "sdhi1", "sdhi0", "mmcif0";
+- renesas,clock-indices = <
++ clock-indices = <
+ R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
+ R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0
+ R8A7790_CLK_MMCIF0
+diff --git a/drivers/clk/shmobile/clk-mstp.c b/drivers/clk/shmobile/clk-mstp.c
+index 2e5810c88d11..1f6324e29a80 100644
+--- a/drivers/clk/shmobile/clk-mstp.c
++++ b/drivers/clk/shmobile/clk-mstp.c
+@@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
+ static void __init cpg_mstp_clocks_init(struct device_node *np)
+ {
+ struct mstp_clock_group *group;
++ const char *idxname;
+ struct clk **clks;
+ unsigned int i;
+
+@@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
+ for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
+ clks[i] = ERR_PTR(-ENOENT);
+
++ if (of_find_property(np, "clock-indices", &i))
++ idxname = "clock-indices";
++ else
++ idxname = "renesas,clock-indices";
++
+ for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
+ const char *parent_name;
+ const char *name;
+@@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
+ continue;
+
+ parent_name = of_clk_get_parent_name(np, i);
+- ret = of_property_read_u32_index(np, "renesas,clock-indices", i,
+- &clkidx);
++ ret = of_property_read_u32_index(np, idxname, i, &clkidx);
+ if (parent_name == NULL || ret < 0)
+ break;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0008-gpio-rcar-Add-helper-variable-dev-pdev-dev.patch b/patches.renesas/0008-gpio-rcar-Add-helper-variable-dev-pdev-dev.patch
new file mode 100644
index 00000000000000..dc90407050088c
--- /dev/null
+++ b/patches.renesas/0008-gpio-rcar-Add-helper-variable-dev-pdev-dev.patch
@@ -0,0 +1,114 @@
+From 76f9bb9494de0e28d3d5eb7eab385ad038321bc0 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Thu, 27 Mar 2014 21:47:36 +0100
+Subject: gpio: rcar: Add helper variable dev = &pdev->dev
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Cc: linux-gpio@vger.kernel.org
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit b22978fc33dec72e5f8e17f90eb63ea9137aafd5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/gpio/gpio-rcar.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
+index ca76ce751540..03c91482432c 100644
+--- a/drivers/gpio/gpio-rcar.c
++++ b/drivers/gpio/gpio-rcar.c
+@@ -356,12 +356,13 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+ struct resource *io, *irq;
+ struct gpio_chip *gpio_chip;
+ struct irq_chip *irq_chip;
+- const char *name = dev_name(&pdev->dev);
++ struct device *dev = &pdev->dev;
++ const char *name = dev_name(dev);
+ int ret;
+
+- p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
++ p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
+ if (!p) {
+- dev_err(&pdev->dev, "failed to allocate driver data\n");
++ dev_err(dev, "failed to allocate driver data\n");
+ ret = -ENOMEM;
+ goto err0;
+ }
+@@ -380,15 +381,14 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+ irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+
+ if (!io || !irq) {
+- dev_err(&pdev->dev, "missing IRQ or IOMEM\n");
++ dev_err(dev, "missing IRQ or IOMEM\n");
+ ret = -EINVAL;
+ goto err0;
+ }
+
+- p->base = devm_ioremap_nocache(&pdev->dev, io->start,
+- resource_size(io));
++ p->base = devm_ioremap_nocache(dev, io->start, resource_size(io));
+ if (!p->base) {
+- dev_err(&pdev->dev, "failed to remap I/O memory\n");
++ dev_err(dev, "failed to remap I/O memory\n");
+ ret = -ENXIO;
+ goto err0;
+ }
+@@ -402,7 +402,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+ gpio_chip->set = gpio_rcar_set;
+ gpio_chip->to_irq = gpio_rcar_to_irq;
+ gpio_chip->label = name;
+- gpio_chip->dev = &pdev->dev;
++ gpio_chip->dev = dev;
+ gpio_chip->owner = THIS_MODULE;
+ gpio_chip->base = p->config.gpio_base;
+ gpio_chip->ngpio = p->config.number_of_pins;
+@@ -421,30 +421,30 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+ &gpio_rcar_irq_domain_ops, p);
+ if (!p->irq_domain) {
+ ret = -ENXIO;
+- dev_err(&pdev->dev, "cannot initialize irq domain\n");
++ dev_err(dev, "cannot initialize irq domain\n");
+ goto err0;
+ }
+
+- if (devm_request_irq(&pdev->dev, irq->start,
+- gpio_rcar_irq_handler, IRQF_SHARED, name, p)) {
+- dev_err(&pdev->dev, "failed to request IRQ\n");
++ if (devm_request_irq(dev, irq->start, gpio_rcar_irq_handler,
++ IRQF_SHARED, name, p)) {
++ dev_err(dev, "failed to request IRQ\n");
+ ret = -ENOENT;
+ goto err1;
+ }
+
+ ret = gpiochip_add(gpio_chip);
+ if (ret) {
+- dev_err(&pdev->dev, "failed to add GPIO controller\n");
++ dev_err(dev, "failed to add GPIO controller\n");
+ goto err1;
+ }
+
+- dev_info(&pdev->dev, "driving %d GPIOs\n", p->config.number_of_pins);
++ dev_info(dev, "driving %d GPIOs\n", p->config.number_of_pins);
+
+ /* warn in case of mismatch if irq base is specified */
+ if (p->config.irq_base) {
+ ret = irq_find_mapping(p->irq_domain, 0);
+ if (p->config.irq_base != ret)
+- dev_warn(&pdev->dev, "irq base mismatch (%u/%u)\n",
++ dev_warn(dev, "irq base mismatch (%u/%u)\n",
+ p->config.irq_base, ret);
+ }
+
+@@ -452,7 +452,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+ ret = gpiochip_add_pin_range(gpio_chip, p->config.pctl_name, 0,
+ gpio_chip->base, gpio_chip->ngpio);
+ if (ret < 0)
+- dev_warn(&pdev->dev, "failed to add pin range\n");
++ dev_warn(dev, "failed to add pin range\n");
+ }
+
+ return 0;
+--
+2.1.2
+
diff --git a/patches.renesas/0009-mtd-m25p80-Add-dual-read-support.patch b/patches.renesas/0009-mtd-m25p80-Add-dual-read-support.patch
new file mode 100644
index 00000000000000..fd015e9bf931c5
--- /dev/null
+++ b/patches.renesas/0009-mtd-m25p80-Add-dual-read-support.patch
@@ -0,0 +1,117 @@
+From cf78dac7430db4c5689b7afaf20a7f2848493542 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 21 Jan 2014 13:59:18 +0100
+Subject: mtd: m25p80: Add dual read support
+
+Add support for Dual SPI read transfers, which is supported by some
+Spansion SPI FLASHes.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Marek Vasut <marex@denx.de>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+(cherry picked from commit dbbafb74239e8296bc20f86366b3f38e13650900)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/devices/m25p80.c | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index ad1913909702..73bf661100f7 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -41,7 +41,8 @@
+ #define OPCODE_WRSR 0x01 /* Write status register 1 byte */
+ #define OPCODE_NORM_READ 0x03 /* Read data bytes (low frequency) */
+ #define OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */
+-#define OPCODE_QUAD_READ 0x6b /* Read data bytes */
++#define OPCODE_DUAL_READ 0x3b /* Read data bytes (Dual SPI) */
++#define OPCODE_QUAD_READ 0x6b /* Read data bytes (Quad SPI) */
+ #define OPCODE_PP 0x02 /* Page program (up to 256 bytes) */
+ #define OPCODE_BE_4K 0x20 /* Erase 4KiB block */
+ #define OPCODE_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips */
+@@ -54,7 +55,8 @@
+ /* 4-byte address opcodes - used on Spansion and some Macronix flashes. */
+ #define OPCODE_NORM_READ_4B 0x13 /* Read data bytes (low frequency) */
+ #define OPCODE_FAST_READ_4B 0x0c /* Read data bytes (high frequency) */
+-#define OPCODE_QUAD_READ_4B 0x6c /* Read data bytes */
++#define OPCODE_DUAL_READ_4B 0x3c /* Read data bytes (Dual SPI) */
++#define OPCODE_QUAD_READ_4B 0x6c /* Read data bytes (Quad SPI) */
+ #define OPCODE_PP_4B 0x12 /* Page program (up to 256 bytes) */
+ #define OPCODE_SE_4B 0xdc /* Sector erase (usually 64KiB) */
+
+@@ -95,6 +97,7 @@
+ enum read_type {
+ M25P80_NORMAL = 0,
+ M25P80_FAST,
++ M25P80_DUAL,
+ M25P80_QUAD,
+ };
+
+@@ -479,6 +482,7 @@ static inline int m25p80_dummy_cycles_read(struct m25p *flash)
+ {
+ switch (flash->flash_read) {
+ case M25P80_FAST:
++ case M25P80_DUAL:
+ case M25P80_QUAD:
+ return 1;
+ case M25P80_NORMAL:
+@@ -492,6 +496,8 @@ static inline int m25p80_dummy_cycles_read(struct m25p *flash)
+ static inline unsigned int m25p80_rx_nbits(const struct m25p *flash)
+ {
+ switch (flash->flash_read) {
++ case M25P80_DUAL:
++ return 2;
+ case M25P80_QUAD:
+ return 4;
+ default:
+@@ -855,7 +861,8 @@ struct flash_info {
+ #define SST_WRITE 0x04 /* use SST byte programming */
+ #define M25P_NO_FR 0x08 /* Can't do fastread */
+ #define SECT_4K_PMC 0x10 /* OPCODE_BE_4K_PMC works uniformly */
+-#define M25P80_QUAD_READ 0x20 /* Flash supports Quad Read */
++#define M25P80_DUAL_READ 0x20 /* Flash supports Dual Read */
++#define M25P80_QUAD_READ 0x40 /* Flash supports Quad Read */
+ };
+
+ #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \
+@@ -1226,7 +1233,7 @@ static int m25p_probe(struct spi_device *spi)
+ if (info->flags & M25P_NO_FR)
+ flash->flash_read = M25P80_NORMAL;
+
+- /* Quad-read mode takes precedence over fast/normal */
++ /* Quad/Dual-read mode takes precedence over fast/normal */
+ if (spi->mode & SPI_RX_QUAD && info->flags & M25P80_QUAD_READ) {
+ ret = set_quad_mode(flash, info->jedec_id);
+ if (ret) {
+@@ -1234,6 +1241,8 @@ static int m25p_probe(struct spi_device *spi)
+ return ret;
+ }
+ flash->flash_read = M25P80_QUAD;
++ } else if (spi->mode & SPI_RX_DUAL && info->flags & M25P80_DUAL_READ) {
++ flash->flash_read = M25P80_DUAL;
+ }
+
+ /* Default commands */
+@@ -1241,6 +1250,9 @@ static int m25p_probe(struct spi_device *spi)
+ case M25P80_QUAD:
+ flash->read_opcode = OPCODE_QUAD_READ;
+ break;
++ case M25P80_DUAL:
++ flash->read_opcode = OPCODE_DUAL_READ;
++ break;
+ case M25P80_FAST:
+ flash->read_opcode = OPCODE_FAST_READ;
+ break;
+@@ -1265,6 +1277,9 @@ static int m25p_probe(struct spi_device *spi)
+ case M25P80_QUAD:
+ flash->read_opcode = OPCODE_QUAD_READ_4B;
+ break;
++ case M25P80_DUAL:
++ flash->read_opcode = OPCODE_DUAL_READ_4B;
++ break;
+ case M25P80_FAST:
+ flash->read_opcode = OPCODE_FAST_READ_4B;
+ break;
+--
+2.1.2
+
diff --git a/patches.renesas/0010-mtd-m25p80-Enable-Dual-SPI-read-transfers-for-s25fl2.patch b/patches.renesas/0010-mtd-m25p80-Enable-Dual-SPI-read-transfers-for-s25fl2.patch
new file mode 100644
index 00000000000000..aed93dc947205a
--- /dev/null
+++ b/patches.renesas/0010-mtd-m25p80-Enable-Dual-SPI-read-transfers-for-s25fl2.patch
@@ -0,0 +1,35 @@
+From 8481ddf80b6ac692dc34706a066467761af5aa09 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 21 Jan 2014 13:59:19 +0100
+Subject: mtd: m25p80: Enable Dual SPI read transfers for s25fl256s1 and
+ s25fl512s
+
+Spansion s25fl256s1 and s25fl512s support Dual SPI transfers, hence set the
+M25P80_DUAL_READ flag.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+(cherry picked from commit f5e00838e83f6fc93f42c7a01b0c612031955b31)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/devices/m25p80.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index 73bf661100f7..f0871a2e449d 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -960,8 +960,8 @@ static const struct spi_device_id m25p_ids[] = {
+ { "s25sl032p", INFO(0x010215, 0x4d00, 64 * 1024, 64, 0) },
+ { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, 0) },
+ { "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) },
+- { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, M25P80_QUAD_READ) },
+- { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, M25P80_QUAD_READ) },
++ { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, M25P80_DUAL_READ | M25P80_QUAD_READ) },
++ { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, M25P80_DUAL_READ | M25P80_QUAD_READ) },
+ { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) },
+ { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) },
+ { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) },
+--
+2.1.2
+
diff --git a/patches.renesas/0011-mtd-delete-non-required-instances-of-include-linux-i.patch b/patches.renesas/0011-mtd-delete-non-required-instances-of-include-linux-i.patch
new file mode 100644
index 00000000000000..e0eb519b6fd450
--- /dev/null
+++ b/patches.renesas/0011-mtd-delete-non-required-instances-of-include-linux-i.patch
@@ -0,0 +1,505 @@
+From 7bbd27c561c5bccb9b208945f2a08ffe8424479d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 21 Jan 2014 16:22:52 -0500
+Subject: mtd: delete non-required instances of include <linux/init.h>
+
+None of these files are actually using any __init type directives
+and hence don't need to include <linux/init.h>. Most are just a
+left over from __devinit and __cpuinit removal, or simply due to
+code getting copied from one driver to the next.
+
+Cc: David Woodhouse <dwmw2@infradead.org>
+Cc: Brian Norris <computersforpeace@gmail.com>
+Cc: linux-mtd@lists.infradead.org
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+[Brian: dropped one incorrect hunk]
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+
+(cherry picked from commit 3ea5b037e750274659648b58fb97426566a90373)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/chips/cfi_cmdset_0001.c | 1 -
+ drivers/mtd/chips/cfi_cmdset_0002.c | 1 -
+ drivers/mtd/chips/cfi_cmdset_0020.c | 1 -
+ drivers/mtd/devices/m25p80.c | 1 -
+ drivers/mtd/devices/mtd_dataflash.c | 1 -
+ drivers/mtd/devices/sst25l.c | 1 -
+ drivers/mtd/inftlmount.c | 1 -
+ drivers/mtd/maps/bfin-async-flash.c | 1 -
+ drivers/mtd/maps/gpio-addr-flash.c | 1 -
+ drivers/mtd/maps/intel_vr_nor.c | 1 -
+ drivers/mtd/maps/ixp4xx.c | 1 -
+ drivers/mtd/maps/lantiq-flash.c | 1 -
+ drivers/mtd/maps/latch-addr-flash.c | 1 -
+ drivers/mtd/maps/pci.c | 1 -
+ drivers/mtd/maps/physmap_of.c | 1 -
+ drivers/mtd/maps/plat-ram.c | 1 -
+ drivers/mtd/maps/pxa2xx-flash.c | 1 -
+ drivers/mtd/maps/rbtx4939-flash.c | 1 -
+ drivers/mtd/maps/scb2_flash.c | 1 -
+ drivers/mtd/maps/sun_uflash.c | 1 -
+ drivers/mtd/mtd_blkdevs.c | 1 -
+ drivers/mtd/nand/ams-delta.c | 1 -
+ drivers/mtd/nand/au1550nd.c | 1 -
+ drivers/mtd/nand/bf5xx_nand.c | 1 -
+ drivers/mtd/nand/davinci_nand.c | 1 -
+ drivers/mtd/nand/fsl_elbc_nand.c | 1 -
+ drivers/mtd/nand/fsl_ifc_nand.c | 1 -
+ drivers/mtd/nand/gpio.c | 1 -
+ drivers/mtd/nand/mpc5121_nfc.c | 1 -
+ drivers/mtd/nand/nuc900_nand.c | 1 -
+ drivers/mtd/nand/pasemi_nand.c | 1 -
+ drivers/mtd/nand/s3c2410.c | 1 -
+ drivers/mtd/onenand/generic.c | 1 -
+ drivers/mtd/onenand/omap2.c | 1 -
+ drivers/mtd/onenand/onenand_base.c | 1 -
+ drivers/mtd/tests/mtd_test.c | 1 -
+ drivers/mtd/ubi/ubi.h | 1 -
+ 37 files changed, 37 deletions(-)
+
+diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
+index 77514430f1fe..a19719e00a69 100644
+--- a/drivers/mtd/chips/cfi_cmdset_0001.c
++++ b/drivers/mtd/chips/cfi_cmdset_0001.c
+@@ -21,7 +21,6 @@
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+-#include <linux/init.h>
+ #include <asm/io.h>
+ #include <asm/byteorder.h>
+
+diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
+index 89b9d6891532..718244d1211a 100644
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c
+@@ -24,7 +24,6 @@
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+-#include <linux/init.h>
+ #include <asm/io.h>
+ #include <asm/byteorder.h>
+
+diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
+index 096993f9711e..88529422c401 100644
+--- a/drivers/mtd/chips/cfi_cmdset_0020.c
++++ b/drivers/mtd/chips/cfi_cmdset_0020.c
+@@ -22,7 +22,6 @@
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+-#include <linux/init.h>
+ #include <asm/io.h>
+ #include <asm/byteorder.h>
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index f0871a2e449d..1e147a849c35 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -15,7 +15,6 @@
+ *
+ */
+
+-#include <linux/init.h>
+ #include <linux/err.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
+index 624069de4f28..8b278d2b15bb 100644
+--- a/drivers/mtd/devices/mtd_dataflash.c
++++ b/drivers/mtd/devices/mtd_dataflash.c
+@@ -10,7 +10,6 @@
+ * 2 of the License, or (at your option) any later version.
+ */
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/delay.h>
+ #include <linux/device.h>
+diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
+index 687bf27ec850..c63ecbcad0b7 100644
+--- a/drivers/mtd/devices/sst25l.c
++++ b/drivers/mtd/devices/sst25l.c
+@@ -15,7 +15,6 @@
+ *
+ */
+
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/device.h>
+ #include <linux/mutex.h>
+diff --git a/drivers/mtd/inftlmount.c b/drivers/mtd/inftlmount.c
+index 4adc0374fb6b..487e64f411a5 100644
+--- a/drivers/mtd/inftlmount.c
++++ b/drivers/mtd/inftlmount.c
+@@ -30,7 +30,6 @@
+ #include <asm/uaccess.h>
+ #include <linux/delay.h>
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nftl.h>
+ #include <linux/mtd/inftl.h>
+diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c
+index 5434d8ded015..6ea51e549045 100644
+--- a/drivers/mtd/maps/bfin-async-flash.c
++++ b/drivers/mtd/maps/bfin-async-flash.c
+@@ -14,7 +14,6 @@
+ * Licensed under the GPL-2 or later.
+ */
+
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
+index 1adba86474a5..a4c477b9fdd6 100644
+--- a/drivers/mtd/maps/gpio-addr-flash.c
++++ b/drivers/mtd/maps/gpio-addr-flash.c
+@@ -14,7 +14,6 @@
+ */
+
+ #include <linux/gpio.h>
+-#include <linux/init.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c
+index 46d195fca942..5ab71f0e1bcd 100644
+--- a/drivers/mtd/maps/intel_vr_nor.c
++++ b/drivers/mtd/maps/intel_vr_nor.c
+@@ -31,7 +31,6 @@
+ #include <linux/kernel.h>
+ #include <linux/slab.h>
+ #include <linux/pci.h>
+-#include <linux/init.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+ #include <linux/mtd/partitions.h>
+diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
+index d6b2451eab1d..6a589f1e2880 100644
+--- a/drivers/mtd/maps/ixp4xx.c
++++ b/drivers/mtd/maps/ixp4xx.c
+@@ -16,7 +16,6 @@
+ #include <linux/err.h>
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/slab.h>
+diff --git a/drivers/mtd/maps/lantiq-flash.c b/drivers/mtd/maps/lantiq-flash.c
+index 93c507a6f862..7aa682cd4d7e 100644
+--- a/drivers/mtd/maps/lantiq-flash.c
++++ b/drivers/mtd/maps/lantiq-flash.c
+@@ -13,7 +13,6 @@
+ #include <linux/kernel.h>
+ #include <linux/io.h>
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+ #include <linux/mtd/partitions.h>
+diff --git a/drivers/mtd/maps/latch-addr-flash.c b/drivers/mtd/maps/latch-addr-flash.c
+index 98bb5d5375d7..cadfbe051873 100644
+--- a/drivers/mtd/maps/latch-addr-flash.c
++++ b/drivers/mtd/maps/latch-addr-flash.c
+@@ -10,7 +10,6 @@
+ * kind, whether express or implied.
+ */
+
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
+index 36da518915b5..eb0242e0b2d9 100644
+--- a/drivers/mtd/maps/pci.c
++++ b/drivers/mtd/maps/pci.c
+@@ -14,7 +14,6 @@
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+ #include <linux/pci.h>
+-#include <linux/init.h>
+ #include <linux/slab.h>
+
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
+index d11109762ac5..217c25d7381b 100644
+--- a/drivers/mtd/maps/physmap_of.c
++++ b/drivers/mtd/maps/physmap_of.c
+@@ -15,7 +15,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/device.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
+index 10196f5a897d..76ace85ccdc6 100644
+--- a/drivers/mtd/maps/plat-ram.c
++++ b/drivers/mtd/maps/plat-ram.c
+@@ -23,7 +23,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/ioport.h>
+diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
+index 9aad854fe912..cb4d92eea9fe 100644
+--- a/drivers/mtd/maps/pxa2xx-flash.c
++++ b/drivers/mtd/maps/pxa2xx-flash.c
+@@ -13,7 +13,6 @@
+ #include <linux/types.h>
+ #include <linux/slab.h>
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/platform_device.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+diff --git a/drivers/mtd/maps/rbtx4939-flash.c b/drivers/mtd/maps/rbtx4939-flash.c
+index 93525121d69d..146b6047ed2b 100644
+--- a/drivers/mtd/maps/rbtx4939-flash.c
++++ b/drivers/mtd/maps/rbtx4939-flash.c
+@@ -13,7 +13,6 @@
+ #include <linux/module.h>
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/device.h>
+ #include <linux/platform_device.h>
+diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c
+index 3051c4c36240..b7a22a612a46 100644
+--- a/drivers/mtd/maps/scb2_flash.c
++++ b/drivers/mtd/maps/scb2_flash.c
+@@ -47,7 +47,6 @@
+ #include <linux/module.h>
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <asm/io.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/map.h>
+diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
+index 39cc4181f025..b6f1aac3510c 100644
+--- a/drivers/mtd/maps/sun_uflash.c
++++ b/drivers/mtd/maps/sun_uflash.c
+@@ -11,7 +11,6 @@
+ #include <linux/module.h>
+ #include <linux/fs.h>
+ #include <linux/errno.h>
+-#include <linux/init.h>
+ #include <linux/ioport.h>
+ #include <linux/of.h>
+ #include <linux/of_device.h>
+diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
+index 5073cbc796d8..0b2ccb68c0d0 100644
+--- a/drivers/mtd/mtd_blkdevs.c
++++ b/drivers/mtd/mtd_blkdevs.c
+@@ -30,7 +30,6 @@
+ #include <linux/blkpg.h>
+ #include <linux/spinlock.h>
+ #include <linux/hdreg.h>
+-#include <linux/init.h>
+ #include <linux/mutex.h>
+ #include <asm/uaccess.h>
+
+diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
+index 8611eb4b45fc..4936e9e0002f 100644
+--- a/drivers/mtd/nand/ams-delta.c
++++ b/drivers/mtd/nand/ams-delta.c
+@@ -17,7 +17,6 @@
+ */
+
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/delay.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c
+index 2880d888cfc5..7d84c4e4bf43 100644
+--- a/drivers/mtd/nand/au1550nd.c
++++ b/drivers/mtd/nand/au1550nd.c
+@@ -11,7 +11,6 @@
+
+ #include <linux/slab.h>
+ #include <linux/gpio.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/interrupt.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
+index 94f55dbde995..b7a24946ca26 100644
+--- a/drivers/mtd/nand/bf5xx_nand.c
++++ b/drivers/mtd/nand/bf5xx_nand.c
+@@ -37,7 +37,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/ioport.h>
+diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
+index a4989ec6292e..4f5f3223aeef 100644
+--- a/drivers/mtd/nand/davinci_nand.c
++++ b/drivers/mtd/nand/davinci_nand.c
+@@ -24,7 +24,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+ #include <linux/err.h>
+diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
+index c09ab95a2219..545a5c002f09 100644
+--- a/drivers/mtd/nand/fsl_elbc_nand.c
++++ b/drivers/mtd/nand/fsl_elbc_nand.c
+@@ -24,7 +24,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/ioport.h>
+diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
+index 90ca7e75d6f0..f8c77e311766 100644
+--- a/drivers/mtd/nand/fsl_ifc_nand.c
++++ b/drivers/mtd/nand/fsl_ifc_nand.c
+@@ -22,7 +22,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/of_address.h>
+ #include <linux/slab.h>
+diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
+index 8e6148aa4539..117ce333fdd4 100644
+--- a/drivers/mtd/nand/gpio.c
++++ b/drivers/mtd/nand/gpio.c
+@@ -18,7 +18,6 @@
+
+ #include <linux/kernel.h>
+ #include <linux/err.h>
+-#include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
+index 31ee7cfbc12b..e78841a2dcc3 100644
+--- a/drivers/mtd/nand/mpc5121_nfc.c
++++ b/drivers/mtd/nand/mpc5121_nfc.c
+@@ -30,7 +30,6 @@
+ #include <linux/gfp.h>
+ #include <linux/delay.h>
+ #include <linux/err.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c
+index 7360f7872d9a..1cb55dcf3ed6 100644
+--- a/drivers/mtd/nand/nuc900_nand.c
++++ b/drivers/mtd/nand/nuc900_nand.c
+@@ -10,7 +10,6 @@
+ */
+
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
+index 90f871acb0ef..2c98f9da7471 100644
+--- a/drivers/mtd/nand/pasemi_nand.c
++++ b/drivers/mtd/nand/pasemi_nand.c
+@@ -23,7 +23,6 @@
+ #undef DEBUG
+
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/nand.h>
+diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
+index f0918e7411d9..79acbb8691b5 100644
+--- a/drivers/mtd/nand/s3c2410.c
++++ b/drivers/mtd/nand/s3c2410.c
+@@ -29,7 +29,6 @@
+
+ #include <linux/module.h>
+ #include <linux/types.h>
+-#include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/io.h>
+diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
+index 8e1919b6f074..093c29ac1a13 100644
+--- a/drivers/mtd/onenand/generic.c
++++ b/drivers/mtd/onenand/generic.c
+@@ -13,7 +13,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/platform_device.h>
+ #include <linux/mtd/mtd.h>
+diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
+index 6547c84afc3a..d945473c3882 100644
+--- a/drivers/mtd/onenand/omap2.c
++++ b/drivers/mtd/onenand/omap2.c
+@@ -25,7 +25,6 @@
+
+ #include <linux/device.h>
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/onenand.h>
+ #include <linux/mtd/partitions.h>
+diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
+index 1de33b5d3903..531ccbcdc04b 100644
+--- a/drivers/mtd/onenand/onenand_base.c
++++ b/drivers/mtd/onenand/onenand_base.c
+@@ -24,7 +24,6 @@
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
+ #include <linux/slab.h>
+-#include <linux/init.h>
+ #include <linux/sched.h>
+ #include <linux/delay.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/mtd/tests/mtd_test.c b/drivers/mtd/tests/mtd_test.c
+index c818a63532e7..111ee46a7428 100644
+--- a/drivers/mtd/tests/mtd_test.c
++++ b/drivers/mtd/tests/mtd_test.c
+@@ -1,6 +1,5 @@
+ #define pr_fmt(fmt) "mtd_test: " fmt
+
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/sched.h>
+ #include <linux/printk.h>
+diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
+index 8ea6297a208f..41763223f7ea 100644
+--- a/drivers/mtd/ubi/ubi.h
++++ b/drivers/mtd/ubi/ubi.h
+@@ -22,7 +22,6 @@
+ #ifndef __UBI_UBI_H__
+ #define __UBI_UBI_H__
+
+-#include <linux/init.h>
+ #include <linux/types.h>
+ #include <linux/list.h>
+ #include <linux/rbtree.h>
+--
+2.1.2
+
diff --git a/patches.renesas/0012-mtd-m25p80-Use-positive-logic-to-check-JEDEC-ID.patch b/patches.renesas/0012-mtd-m25p80-Use-positive-logic-to-check-JEDEC-ID.patch
new file mode 100644
index 00000000000000..e0b66ac087a232
--- /dev/null
+++ b/patches.renesas/0012-mtd-m25p80-Use-positive-logic-to-check-JEDEC-ID.patch
@@ -0,0 +1,34 @@
+From 61002129d6ee6993d7986b0be19dc11b2627f2d6 Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Tue, 21 Jan 2014 15:56:34 +0800
+Subject: mtd: m25p80: Use positive logic to check JEDEC ID
+
+For slightly better readability.
+
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+(cherry picked from commit b2fda1296bb8e213a6bad3937326ae98c4c4773c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/devices/m25p80.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index 1e147a849c35..c6e6d8e8ef7b 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -1078,9 +1078,8 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi)
+ for (tmp = 0; tmp < ARRAY_SIZE(m25p_ids) - 1; tmp++) {
+ info = (void *)m25p_ids[tmp].driver_data;
+ if (info->jedec_id == jedec) {
+- if (info->ext_id != 0 && info->ext_id != ext_jedec)
+- continue;
+- return &m25p_ids[tmp];
++ if (info->ext_id == 0 || info->ext_id == ext_jedec)
++ return &m25p_ids[tmp];
+ }
+ }
+ dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);
+--
+2.1.2
+
diff --git a/patches.renesas/0013-mtd-m25p80-add-support-for-the-Spansion-s25fl008k-ch.patch b/patches.renesas/0013-mtd-m25p80-add-support-for-the-Spansion-s25fl008k-ch.patch
new file mode 100644
index 00000000000000..e1b8be3e4b6919
--- /dev/null
+++ b/patches.renesas/0013-mtd-m25p80-add-support-for-the-Spansion-s25fl008k-ch.patch
@@ -0,0 +1,30 @@
+From ebdbea2419e70363e674e9f04a8eccf3f329ede2 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 09:51:18 +0100
+Subject: mtd: m25p80: add support for the Spansion s25fl008k chip
+
+Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+(cherry picked from commit bec44c45c245b38662f1e61bf0bde95fac1e7fb5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/devices/m25p80.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index c6e6d8e8ef7b..882b72072ae7 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -971,6 +971,7 @@ static const struct spi_device_id m25p_ids[] = {
+ { "s25sl016a", INFO(0x010214, 0, 64 * 1024, 32, 0) },
+ { "s25sl032a", INFO(0x010215, 0, 64 * 1024, 64, 0) },
+ { "s25sl064a", INFO(0x010216, 0, 64 * 1024, 128, 0) },
++ { "s25fl008k", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) },
+ { "s25fl016k", INFO(0xef4015, 0, 64 * 1024, 32, SECT_4K) },
+ { "s25fl064k", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) },
+
+--
+2.1.2
+
diff --git a/patches.renesas/0014-mtd-m25p80-add-Macronix-mx66l1g55g-1Gbit-SPI-flash.patch b/patches.renesas/0014-mtd-m25p80-add-Macronix-mx66l1g55g-1Gbit-SPI-flash.patch
new file mode 100644
index 00000000000000..a8ecbc05826821
--- /dev/null
+++ b/patches.renesas/0014-mtd-m25p80-add-Macronix-mx66l1g55g-1Gbit-SPI-flash.patch
@@ -0,0 +1,28 @@
+From 975123a25fd885f6d96c09fba187281eb3cdd3e7 Mon Sep 17 00:00:00 2001
+From: Brian Norris <computersforpeace@gmail.com>
+Date: Wed, 29 Jan 2014 13:39:43 -0800
+Subject: mtd: m25p80: add Macronix mx66l1g55g 1Gbit SPI flash
+
+Signed-off-by: Brian Norris <computersforpeace@gmail.com>
+Acked-by: Marek Vasut <marex@denx.de>
+(cherry picked from commit 6f7db7f3203a0bd48170807adeb53dd401d29110)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mtd/devices/m25p80.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
+index 882b72072ae7..524dab3ac938 100644
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -940,6 +940,7 @@ static const struct spi_device_id m25p_ids[] = {
+ { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) },
+ { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) },
+ { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, M25P80_QUAD_READ) },
++ { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, M25P80_QUAD_READ) },
+
+ /* Micron */
+ { "n25q064", INFO(0x20ba17, 0, 64 * 1024, 128, 0) },
+--
+2.1.2
+
diff --git a/patches.renesas/0015-pinctrl-Quiet-logging-about-missing-DT-nodes-when-no.patch b/patches.renesas/0015-pinctrl-Quiet-logging-about-missing-DT-nodes-when-no.patch
new file mode 100644
index 00000000000000..c4f554bd77fc90
--- /dev/null
+++ b/patches.renesas/0015-pinctrl-Quiet-logging-about-missing-DT-nodes-when-no.patch
@@ -0,0 +1,36 @@
+From 4f31f26145b2244452c4889d43cd41d62a989da3 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@linaro.org>
+Date: Thu, 30 Jan 2014 18:57:20 +0000
+Subject: pinctrl: Quiet logging about missing DT nodes when not using DT
+
+On systems which were not booted using DT it is entirely unsurprising that
+device nodes don't have any DT information and this is going to happen for
+every single device in the system. Make pinctrl be less chatty about this
+situation by only logging in the case where we have DT.
+
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 5d88dceac736a779fdf6208bbd0a06e81fe25300)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/devicetree.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
+index 340fb4e6c600..eda13de2e7c0 100644
+--- a/drivers/pinctrl/devicetree.c
++++ b/drivers/pinctrl/devicetree.c
+@@ -186,7 +186,9 @@ int pinctrl_dt_to_map(struct pinctrl *p)
+
+ /* CONFIG_OF enabled, p->dev not instantiated from DT */
+ if (!np) {
+- dev_dbg(p->dev, "no of_node; not parsing pinctrl DT\n");
++ if (of_have_populated_dt())
++ dev_dbg(p->dev,
++ "no of_node; not parsing pinctrl DT\n");
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0016-drm-rcar-du-Handle-encoder-initialization-failures.patch b/patches.renesas/0016-drm-rcar-du-Handle-encoder-initialization-failures.patch
new file mode 100644
index 00000000000000..a8196fbed8af53
--- /dev/null
+++ b/patches.renesas/0016-drm-rcar-du-Handle-encoder-initialization-failures.patch
@@ -0,0 +1,35 @@
+From 1e13b65c0d0a4eafcaa9db060ef5d6029f12660b Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 1 Apr 2014 13:03:52 +0200
+Subject: drm/rcar-du: Handle encoder initialization failures
+
+The rcar_du_encoder_init() function can fail and return an error code.
+Don't ignore it.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+(cherry picked from commit d9961b22716ddf59ca307fe862f93ff0ea919952)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+index fbeabd9a281f..a87edfac111f 100644
+--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
++++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+@@ -248,7 +248,10 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
+ continue;
+ }
+
+- rcar_du_encoder_init(rcdu, pdata->type, pdata->output, pdata);
++ ret = rcar_du_encoder_init(rcdu, pdata->type, pdata->output,
++ pdata);
++ if (ret < 0)
++ return ret;
+ }
+
+ /* Set the possible CRTCs and possible clones. There's always at least
+--
+2.1.2
+
diff --git a/patches.renesas/0017-ASoC-rsnd-tidyup-register-naming-of-BUSIF_MODE.patch b/patches.renesas/0017-ASoC-rsnd-tidyup-register-naming-of-BUSIF_MODE.patch
new file mode 100644
index 00000000000000..2e3dc1c8d5efce
--- /dev/null
+++ b/patches.renesas/0017-ASoC-rsnd-tidyup-register-naming-of-BUSIF_MODE.patch
@@ -0,0 +1,62 @@
+From 239e78b54c84bc46741089b834f5b144a6d192fc Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:37:39 -0800
+Subject: ASoC: rsnd: tidyup register naming of BUSIF_MODE
+
+Gen1:SRU has only 1 BUSIF_MODE,
+but Gen2:SSIU/SCU has SRCm_BUSIF_MODE, and SSIn_BUSIF_MODE.
+This patch rename current BUSIF_MODE to SRC_BUSIF_MODE.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 0290d2a42cb476358303d05fbe2475dd50889907)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/gen.c | 2 +-
+ sound/soc/sh/rcar/rsnd.h | 2 +-
+ sound/soc/sh/rcar/scu.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index add088bd4b2a..cbdbbfa322b8 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -317,7 +317,7 @@ static int rsnd_gen1_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ RSND_GEN1_S_REG(gen, SRU, SRC_ROUTE_CTRL, 0xc0),
+ RSND_GEN1_S_REG(gen, SRU, SSI_MODE0, 0xD0),
+ RSND_GEN1_S_REG(gen, SRU, SSI_MODE1, 0xD4),
+- RSND_GEN1_M_REG(gen, SRU, BUSIF_MODE, 0x20, 0x4),
++ RSND_GEN1_M_REG(gen, SRU, SRC_BUSIF_MODE, 0x20, 0x4),
+ RSND_GEN1_M_REG(gen, SRU, SRC_ROUTE_MODE0,0x50, 0x8),
+ RSND_GEN1_M_REG(gen, SRU, SRC_SWRSR, 0x200, 0x40),
+ RSND_GEN1_M_REG(gen, SRU, SRC_SRCIR, 0x204, 0x40),
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 4ca66cd899c8..f62b9eb274e1 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -39,8 +39,8 @@ enum rsnd_reg {
+ RSND_REG_SRC_ROUTE_CTRL, /* for Gen1 */
+ RSND_REG_SSI_MODE0,
+ RSND_REG_SSI_MODE1,
+- RSND_REG_BUSIF_MODE,
+ RSND_REG_INT_ENABLE, /* for Gen2 */
++ RSND_REG_SRC_BUSIF_MODE,
+ RSND_REG_SRC_ROUTE_MODE0,
+ RSND_REG_SRC_SWRSR,
+ RSND_REG_SRC_SRCIR,
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 9bb08bb1d455..9b9daa3821a3 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -211,7 +211,7 @@ static int rsnd_scu_convert_rate_ctrl(struct rsnd_priv *priv,
+ rsnd_mod_write(mod, SRC_SRCIR, 0);
+
+ /* use DMA transfer */
+- rsnd_mod_write(mod, BUSIF_MODE, 1);
++ rsnd_mod_write(mod, SRC_BUSIF_MODE, 1);
+
+ return 0;
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0018-ASoC-rsnd-cleanup-debug-information-method.patch b/patches.renesas/0018-ASoC-rsnd-cleanup-debug-information-method.patch
new file mode 100644
index 00000000000000..b0781cb77a0f4d
--- /dev/null
+++ b/patches.renesas/0018-ASoC-rsnd-cleanup-debug-information-method.patch
@@ -0,0 +1,122 @@
+From 428c58d7a7d9cd3195721482425f39898f972a5f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:08 -0800
+Subject: ASoC: rsnd: cleanup debug information method
+
+rsnd_mod debug information is implemented
+in each callback functions now.
+But, it can be implemented in rsnd_mod_call(),
+and share this code.
+This patch adds it
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 92d9587ede108a7e73f80d0767aedf2c4edb47d8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 11 ++++++++++-
+ sound/soc/sh/rcar/scu.c | 2 --
+ sound/soc/sh/rcar/ssi.c | 12 ------------
+ 3 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index f62b9eb274e1..faacdcb8f05b 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -152,10 +152,19 @@ struct rsnd_mod {
+ #define rsnd_mod_id(mod) ((mod)->id)
+ #define for_each_rsnd_mod(pos, n, io) \
+ list_for_each_entry_safe(pos, n, &(io)->head, list)
++#define __rsnd_mod_call(mod, func, rdai, io) \
++({ \
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
++ struct device *dev = rsnd_priv_to_dev(priv); \
++ dev_dbg(dev, "%s-%d-%s\n", \
++ rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
++ (mod)->ops->func(mod, rdai, io); \
++})
++
+ #define rsnd_mod_call(mod, func, rdai, io) \
+ (!(mod) ? -ENODEV : \
+ !((mod)->ops->func) ? 0 : \
+- (mod)->ops->func(mod, rdai, io))
++ __rsnd_mod_call(mod, func, rdai, io))
+
+ void rsnd_mod_init(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 9b9daa3821a3..e4b82ab31dca 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -300,8 +300,6 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
+ if (ret < 0)
+ return ret;
+
+- dev_dbg(dev, "%s%d start\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+ return 0;
+ }
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 4b8cf7ca9d19..df775f0c8a2c 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -324,7 +324,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ {
+ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct device *dev = rsnd_priv_to_dev(priv);
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ u32 cr;
+
+@@ -371,8 +370,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+
+ rsnd_ssi_mode_set(priv, rdai, ssi);
+
+- dev_dbg(dev, "%s.%d init\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+ return 0;
+ }
+
+@@ -384,8 +381,6 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct device *dev = rsnd_priv_to_dev(priv);
+
+- dev_dbg(dev, "%s.%d quit\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+ if (ssi->err > 0)
+ dev_warn(dev, "ssi under/over flow err = %d\n", ssi->err);
+
+@@ -450,7 +445,6 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+- struct device *dev = rsnd_priv_to_dev(priv);
+
+ /* enable PIO IRQ */
+ ssi->cr_etc = UIEN | OIEN | DIEN;
+@@ -461,8 +455,6 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+
+ rsnd_ssi_hw_start(ssi, rdai, io);
+
+- dev_dbg(dev, "%s.%d start\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+ return 0;
+ }
+
+@@ -470,12 +462,8 @@ static int rsnd_ssi_pio_stop(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+
+- dev_dbg(dev, "%s.%d stop\n", rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+ ssi->cr_etc = 0;
+
+ rsnd_ssi_hw_stop(ssi, rdai);
+--
+2.1.2
+
diff --git a/patches.renesas/0019-ASoC-rsnd-remove-meaningless-rsnd_ssi_non.patch b/patches.renesas/0019-ASoC-rsnd-remove-meaningless-rsnd_ssi_non.patch
new file mode 100644
index 00000000000000..a34d3d6b4b3e94
--- /dev/null
+++ b/patches.renesas/0019-ASoC-rsnd-remove-meaningless-rsnd_ssi_non.patch
@@ -0,0 +1,48 @@
+From ffcacc0264f7f6d7c812c70e0ff17eaf0ed4bd7a Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:17 -0800
+Subject: ASoC: rsnd: remove meaningless rsnd_ssi_non()
+
+rsnd_ssi_non_ops callback functions are never called.
+remove these meaningless callback
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6acef1721c1046be8b5f44b839c28817cfbd66c6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/ssi.c | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index df775f0c8a2c..ef3d45045d1f 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -555,24 +555,8 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
+ /*
+ * Non SSI
+ */
+-static int rsnd_ssi_non(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct device *dev = rsnd_priv_to_dev(priv);
+-
+- dev_dbg(dev, "%s\n", __func__);
+-
+- return 0;
+-}
+-
+ static struct rsnd_mod_ops rsnd_ssi_non_ops = {
+ .name = "ssi (non)",
+- .init = rsnd_ssi_non,
+- .quit = rsnd_ssi_non,
+- .start = rsnd_ssi_non,
+- .stop = rsnd_ssi_non,
+ };
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0020-ASoC-rsnd-control-SCU-ops-in-probe-timing.patch b/patches.renesas/0020-ASoC-rsnd-control-SCU-ops-in-probe-timing.patch
new file mode 100644
index 00000000000000..d67490653d50c0
--- /dev/null
+++ b/patches.renesas/0020-ASoC-rsnd-control-SCU-ops-in-probe-timing.patch
@@ -0,0 +1,97 @@
+From 4b24bc4c0a1df601316e85449136ebfd005d75ab Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:26 -0800
+Subject: ASoC: rsnd: control SCU ops in probe timing
+
+SCU will be used if platform requested to use.
+Current driver is checking it in runtime,
+but, it can be decided in probe timing.
+This patch do it
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 013f38fe260af6f505ad5da5f6b0db3e42ca1fbb)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 30 +++++++++++-------------------
+ 1 file changed, 11 insertions(+), 19 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index e4b82ab31dca..ab5f1d21731e 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -270,24 +270,10 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- struct device *dev = rsnd_priv_to_dev(priv);
+ int ret;
+
+- /*
+- * SCU will be used if it has RSND_SCU_USE_HPBIF flags
+- */
+- if (!rsnd_scu_hpbif_is_enable(mod)) {
+- /* it use PIO transter */
+- dev_dbg(dev, "%s%d is not used\n",
+- rsnd_mod_name(mod), rsnd_mod_id(mod));
+-
+- return 0;
+- }
+-
+ clk_enable(scu->clk);
+
+- /* it use DMA transter */
+-
+ ret = rsnd_src_set_route_if_gen1(priv, mod, rdai, io);
+ if (ret < 0)
+ return ret;
+@@ -310,9 +296,6 @@ static int rsnd_scu_stop(struct rsnd_mod *mod,
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+
+- if (!rsnd_scu_hpbif_is_enable(mod))
+- return 0;
+-
+ rsnd_scu_transfer_stop(priv, mod, rdai, io);
+
+ clk_disable(scu->clk);
+@@ -326,6 +309,10 @@ static struct rsnd_mod_ops rsnd_scu_ops = {
+ .stop = rsnd_scu_stop,
+ };
+
++static struct rsnd_mod_ops rsnd_scu_non_ops = {
++ .name = "scu (non)",
++};
++
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+ {
+ if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
+@@ -340,6 +327,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_scu *scu;
++ struct rsnd_mod_ops *ops;
+ struct clk *clk;
+ char name[RSND_SCU_NAME_SIZE];
+ int i, nr;
+@@ -364,11 +352,15 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+- rsnd_mod_init(priv, &scu->mod,
+- &rsnd_scu_ops, i);
+ scu->info = &info->scu_info[i];
+ scu->clk = clk;
+
++ ops = &rsnd_scu_non_ops;
++ if (rsnd_scu_hpbif_is_enable(&scu->mod))
++ ops = &rsnd_scu_ops;
++
++ rsnd_mod_init(priv, &scu->mod, ops, i);
++
+ dev_dbg(dev, "SCU%d probed\n", i);
+ }
+ dev_dbg(dev, "scu probed\n");
+--
+2.1.2
+
diff --git a/patches.renesas/0021-ASoC-rsnd-add-rsnd_scu_init-and-separate-init-start.patch b/patches.renesas/0021-ASoC-rsnd-add-rsnd_scu_init-and-separate-init-start.patch
new file mode 100644
index 00000000000000..8420bf1a8da1c1
--- /dev/null
+++ b/patches.renesas/0021-ASoC-rsnd-add-rsnd_scu_init-and-separate-init-start.patch
@@ -0,0 +1,85 @@
+From 7ae4a85f32ec9e06c35111591cc873a59b012715 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:33 -0800
+Subject: ASoC: rsnd: add rsnd_scu_init(), and separate init/start
+
+Current scu.c has rsnd_scu_start(),
+and, operation of initialization/start
+are implemented in this function.
+This patch adds new rsnd_scu_init() and separates
+rsnd_scu_start(), since rsnd_mod_ops has .init/.start callbacks.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit a204d90c91208d9b63ba309a1c44f582751e58c9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 29 +++++++++++++++++++++++------
+ 1 file changed, 23 insertions(+), 6 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index ab5f1d21731e..e1e08738b9d4 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -264,7 +264,7 @@ bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
+ return !!(flags & RSND_SCU_USE_HPBIF);
+ }
+
+-static int rsnd_scu_start(struct rsnd_mod *mod,
++static int rsnd_scu_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+@@ -282,13 +282,30 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_transfer_start(priv, mod, rdai, io);
+- if (ret < 0)
+- return ret;
++ return 0;
++}
++
++static int rsnd_scu_quit(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ clk_disable(scu->clk);
+
+ return 0;
+ }
+
++static int rsnd_scu_start(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ return rsnd_scu_transfer_start(priv, mod, rdai, io);
++}
++
+ static int rsnd_scu_stop(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -298,13 +315,13 @@ static int rsnd_scu_stop(struct rsnd_mod *mod,
+
+ rsnd_scu_transfer_stop(priv, mod, rdai, io);
+
+- clk_disable(scu->clk);
+-
+ return 0;
+ }
+
+ static struct rsnd_mod_ops rsnd_scu_ops = {
+ .name = "scu",
++ .init = rsnd_scu_init,
++ .quit = rsnd_scu_quit,
+ .start = rsnd_scu_start,
+ .stop = rsnd_scu_stop,
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0022-ASoC-rsnd-remove-meaningless-function-parameter.patch b/patches.renesas/0022-ASoC-rsnd-remove-meaningless-function-parameter.patch
new file mode 100644
index 00000000000000..a9b855eafd0034
--- /dev/null
+++ b/patches.renesas/0022-ASoC-rsnd-remove-meaningless-function-parameter.patch
@@ -0,0 +1,74 @@
+From d1d78368ec2c7f6149bf6734027172069e21fe41 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:42 -0800
+Subject: ASoC: rsnd: remove meaningless function parameter
+
+struct rsnd_priv *priv on rsnd_scu_init/start/stop()
+are no longer needed
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 47718dc7d8ca5f5509ac9beb13486642306bb36b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index e1e08738b9d4..ece539b758d1 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -50,7 +50,7 @@ struct rsnd_scu {
+ i++)
+
+ /* Gen1 only */
+-static int rsnd_src_set_route_if_gen1(struct rsnd_priv *priv,
++static int rsnd_src_set_route_if_gen1(
+ struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -69,6 +69,7 @@ static int rsnd_src_set_route_if_gen1(struct rsnd_priv *priv,
+ { 0x3, 28, }, /* 7 */
+ { 0x3, 30, }, /* 8 */
+ };
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ u32 mask;
+ u32 val;
+@@ -149,11 +150,12 @@ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ return rate;
+ }
+
+-static int rsnd_scu_convert_rate_ctrl(struct rsnd_priv *priv,
++static int rsnd_scu_convert_rate_ctrl(
+ struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ u32 convert_rate = rsnd_scu_convert_rate(scu);
+@@ -268,17 +270,16 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ int ret;
+
+ clk_enable(scu->clk);
+
+- ret = rsnd_src_set_route_if_gen1(priv, mod, rdai, io);
++ ret = rsnd_src_set_route_if_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_convert_rate_ctrl(priv, mod, rdai, io);
++ ret = rsnd_scu_convert_rate_ctrl(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0023-ASoC-rsnd-merge-rsnd_scu_start-stop-and-rsnd_scu_tra.patch b/patches.renesas/0023-ASoC-rsnd-merge-rsnd_scu_start-stop-and-rsnd_scu_tra.patch
new file mode 100644
index 00000000000000..8e5404af152459
--- /dev/null
+++ b/patches.renesas/0023-ASoC-rsnd-merge-rsnd_scu_start-stop-and-rsnd_scu_tra.patch
@@ -0,0 +1,103 @@
+From f91f9c1dcad96f344d743d62c2bf7b962f00b7cb Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:38:50 -0800
+Subject: ASoC: rsnd: merge rsnd_scu_start/stop() and
+ rsnd_scu_transfer_start/stop()
+
+rsnd_scu_transfer_start/stop() are no longer needed.
+merge into rsnd_scu_start/stop()
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit e7ce74eaa76591e5a4905d0fc07a278533447b80)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 56 +++++++++++++------------------------------------
+ 1 file changed, 14 insertions(+), 42 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index ece539b758d1..5d2dbbbf9d98 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -218,46 +218,6 @@ static int rsnd_scu_convert_rate_ctrl(
+ return 0;
+ }
+
+-static int rsnd_scu_transfer_start(struct rsnd_priv *priv,
+- struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- int id = rsnd_mod_id(mod);
+- u32 val;
+-
+- if (rsnd_is_gen1(priv)) {
+- val = (1 << id);
+- rsnd_mod_bset(mod, SRC_ROUTE_CTRL, val, val);
+- }
+-
+- if (rsnd_scu_convert_rate(scu))
+- rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
+-
+- return 0;
+-}
+-
+-static int rsnd_scu_transfer_stop(struct rsnd_priv *priv,
+- struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- int id = rsnd_mod_id(mod);
+- u32 mask;
+-
+- if (rsnd_is_gen1(priv)) {
+- mask = (1 << id);
+- rsnd_mod_bset(mod, SRC_ROUTE_CTRL, mask, 0);
+- }
+-
+- if (rsnd_scu_convert_rate(scu))
+- rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
+-
+- return 0;
+-}
+-
+ bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
+ {
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+@@ -303,8 +263,15 @@ static int rsnd_scu_start(struct rsnd_mod *mod,
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ int id = rsnd_mod_id(mod);
+
+- return rsnd_scu_transfer_start(priv, mod, rdai, io);
++ if (rsnd_is_gen1(priv))
++ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), (1 << id));
++
++ if (rsnd_scu_convert_rate(scu))
++ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
++
++ return 0;
+ }
+
+ static int rsnd_scu_stop(struct rsnd_mod *mod,
+@@ -313,8 +280,13 @@ static int rsnd_scu_stop(struct rsnd_mod *mod,
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ int id = rsnd_mod_id(mod);
++
++ if (rsnd_is_gen1(priv))
++ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), 0);
+
+- rsnd_scu_transfer_stop(priv, mod, rdai, io);
++ if (rsnd_scu_convert_rate(scu))
++ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
+
+ return 0;
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0024-ASoC-rsnd-rsnd_dai_is_clk_master-can-be-shared.patch b/patches.renesas/0024-ASoC-rsnd-rsnd_dai_is_clk_master-can-be-shared.patch
new file mode 100644
index 00000000000000..1ee4e285448c6d
--- /dev/null
+++ b/patches.renesas/0024-ASoC-rsnd-rsnd_dai_is_clk_master-can-be-shared.patch
@@ -0,0 +1,81 @@
+From b6ecea4baf55e2fe786be5aff3cb17c742da5bed Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:12 -0800
+Subject: ASoC: rsnd: rsnd_dai_is_clk_master() can be shared
+
+Current rsnd driver is using ssi local
+rsnd_rdai_is_clk_master() for checking clock master.
+But it can be rsnd_dai_is_clk_master(), and share in each file
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit e779a20da90b12d17af74fe544fafd814b66dc63)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 1 +
+ sound/soc/sh/rcar/ssi.c | 9 ++++-----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index faacdcb8f05b..cd396dda85c5 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -215,6 +215,7 @@ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai);
+
+ void rsnd_dai_pointer_update(struct rsnd_dai_stream *io, int cnt);
+ int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
++#define rsnd_dai_is_clk_master(rdai) ((rdai)->clk_master)
+
+ /*
+ * R-Car Gen1/Gen2
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index ef3d45045d1f..ddcca067908c 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -95,7 +95,6 @@ struct rsnd_ssiu {
+ #define rsnd_ssi_dma_available(ssi) \
+ rsnd_dma_available(rsnd_mod_to_dma(&(ssi)->mod))
+ #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent)
+-#define rsnd_rdai_is_clk_master(rdai) ((rdai)->clk_master)
+ #define rsnd_ssi_mode_flags(p) ((p)->info->flags)
+ #define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id)
+ #define rsnd_ssi_to_ssiu(ssi)\
+@@ -133,7 +132,7 @@ static void rsnd_ssi_mode_set(struct rsnd_priv *priv,
+ #define ssi_parent_set(p, sync, adg, ext) \
+ do { \
+ ssi->parent = ssiu->ssi + p; \
+- if (rsnd_rdai_is_clk_master(rdai)) \
++ if (rsnd_dai_is_clk_master(rdai)) \
+ val = adg; \
+ else \
+ val = ext; \
+@@ -252,7 +251,7 @@ static void rsnd_ssi_hw_start(struct rsnd_ssi *ssi,
+ if (0 == ssi->usrcnt) {
+ clk_enable(ssi->clk);
+
+- if (rsnd_rdai_is_clk_master(rdai)) {
++ if (rsnd_dai_is_clk_master(rdai)) {
+ if (rsnd_ssi_clk_from_parent(ssi))
+ rsnd_ssi_hw_start(ssi->parent, rdai, io);
+ else
+@@ -302,7 +301,7 @@ static void rsnd_ssi_hw_stop(struct rsnd_ssi *ssi,
+ rsnd_mod_write(&ssi->mod, SSICR, cr); /* disabled all */
+ rsnd_ssi_status_check(&ssi->mod, IIRQ);
+
+- if (rsnd_rdai_is_clk_master(rdai)) {
++ if (rsnd_dai_is_clk_master(rdai)) {
+ if (rsnd_ssi_clk_from_parent(ssi))
+ rsnd_ssi_hw_stop(ssi->parent, rdai);
+ else
+@@ -522,7 +521,7 @@ static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
+ rsnd_ssi_hw_start(ssi, ssi->rdai, io);
+
+ /* enable WS continue */
+- if (rsnd_rdai_is_clk_master(rdai))
++ if (rsnd_dai_is_clk_master(rdai))
+ rsnd_mod_write(&ssi->mod, SSIWSR, CONT);
+
+ return 0;
+--
+2.1.2
+
diff --git a/patches.renesas/0025-ASoC-rsnd-remove-pin-sync-option.patch b/patches.renesas/0025-ASoC-rsnd-remove-pin-sync-option.patch
new file mode 100644
index 00000000000000..1dc607de3c3bfe
--- /dev/null
+++ b/patches.renesas/0025-ASoC-rsnd-remove-pin-sync-option.patch
@@ -0,0 +1,47 @@
+From 2e74326d526e256077b30c1395f2e8bdd96ac2c0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:23 -0800
+Subject: ASoC: rsnd: remove pin sync option
+
+Renesas Chip is supporting multi pin sound,
+but the HW setting is very difficult and confusable.
+But driver is supporting it halfway.
+Remove SYNC option at this point.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6f3ab6c1c022e7a4877d38940cd45ae7804a15e2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 1 +
+ sound/soc/sh/rcar/ssi.c | 2 --
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index 6add6ccc811e..1d19bfc2486d 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -35,6 +35,7 @@
+ */
+ #define RSND_SSI_CLK_PIN_SHARE (1 << 31)
+ #define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
++#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */
+
+ #define RSND_SSI_PLAY (1 << 24)
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index ddcca067908c..68393a9f91bf 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -136,8 +136,6 @@ static void rsnd_ssi_mode_set(struct rsnd_priv *priv,
+ val = adg; \
+ else \
+ val = ext; \
+- if (flags & RSND_SSI_SYNC) \
+- val |= sync; \
+ } while (0)
+
+ flags = rsnd_ssi_mode_flags(ssi);
+--
+2.1.2
+
diff --git a/patches.renesas/0026-ASoC-rsnd-SSI_MODE0-1-settings-goes-to-scu.c.patch b/patches.renesas/0026-ASoC-rsnd-SSI_MODE0-1-settings-goes-to-scu.c.patch
new file mode 100644
index 00000000000000..f494e10a26c0a2
--- /dev/null
+++ b/patches.renesas/0026-ASoC-rsnd-SSI_MODE0-1-settings-goes-to-scu.c.patch
@@ -0,0 +1,250 @@
+From 3f9a38e9470a0ac77423ec3118000f1273f8889f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:32 -0800
+Subject: ASoC: rsnd: SSI_MODE0/1 settings goes to scu.c
+
+SRU (Gen1) / SCU (Gen2) / SSIU (Gen2) are controlled under scu.c.
+(SCU + SSIU (Gen2) was SRU (Gen1))
+And register of SSI_MODE0/1 are mapped on these IP.
+But these have been implemented under ssi.c on this driver.
+The naming is very confusable,
+but it should be implemented under scu.c
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 7b5ce9759a60ebdffa1e76224ccb3d85bd06e4ac)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 1 +
+ sound/soc/sh/rcar/scu.c | 45 ++++++++++++++++++++++
+ sound/soc/sh/rcar/ssi.c | 98 ++++++++++++++----------------------------------
+ 3 files changed, 74 insertions(+), 70 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index cd396dda85c5..85b926229b81 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -321,5 +321,6 @@ void rsnd_ssi_remove(struct platform_device *pdev,
+ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
+ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+ int dai_id, int is_play);
++int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
+
+ #endif
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 5d2dbbbf9d98..ade10474a0cf 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -49,6 +49,46 @@ struct rsnd_scu {
+ ((pos) = (struct rsnd_scu *)(priv)->scu + i); \
+ i++)
+
++static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ int id = rsnd_mod_id(mod);
++
++ /*
++ * SSI_MODE0
++ */
++ rsnd_mod_bset(mod, SSI_MODE0, (1 << id),
++ rsnd_scu_hpbif_is_enable(mod) ? 0 : (1 << id));
++
++ /*
++ * SSI_MODE1
++ */
++ if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) {
++ int shift = -1;
++ switch (id) {
++ case 1:
++ shift = 0;
++ break;
++ case 2:
++ shift = 2;
++ break;
++ case 4:
++ shift = 16;
++ break;
++ }
++
++ if (shift >= 0)
++ rsnd_mod_bset(mod, SSI_MODE1,
++ 0x3 << shift,
++ rsnd_dai_is_clk_master(rdai) ?
++ 0x2 << shift : 0x1 << shift);
++ }
++
++ return 0;
++}
++
+ /* Gen1 only */
+ static int rsnd_src_set_route_if_gen1(
+ struct rsnd_mod *mod,
+@@ -235,6 +275,10 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+
+ clk_enable(scu->clk);
+
++ ret = rsnd_scu_ssi_mode_init(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
+ ret = rsnd_src_set_route_if_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+@@ -301,6 +345,7 @@ static struct rsnd_mod_ops rsnd_scu_ops = {
+
+ static struct rsnd_mod_ops rsnd_scu_non_ops = {
+ .name = "scu (non)",
++ .init = rsnd_scu_ssi_mode_init,
+ };
+
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 68393a9f91bf..0f314db8cb50 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -75,9 +75,6 @@ struct rsnd_ssi {
+ };
+
+ struct rsnd_ssiu {
+- u32 ssi_mode0;
+- u32 ssi_mode1;
+-
+ int ssi_nr;
+ struct rsnd_ssi *ssi;
+ };
+@@ -100,70 +97,6 @@ struct rsnd_ssiu {
+ #define rsnd_ssi_to_ssiu(ssi)\
+ (((struct rsnd_ssiu *)((ssi) - rsnd_mod_id(&(ssi)->mod))) - 1)
+
+-static void rsnd_ssi_mode_set(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_ssi *ssi)
+-{
+- struct device *dev = rsnd_priv_to_dev(priv);
+- struct rsnd_mod *scu;
+- struct rsnd_ssiu *ssiu = rsnd_ssi_to_ssiu(ssi);
+- int id = rsnd_mod_id(&ssi->mod);
+- u32 flags;
+- u32 val;
+-
+- scu = rsnd_scu_mod_get(priv, rsnd_mod_id(&ssi->mod));
+-
+- /*
+- * SSI_MODE0
+- */
+-
+- /* see also BUSIF_MODE */
+- if (rsnd_scu_hpbif_is_enable(scu)) {
+- ssiu->ssi_mode0 &= ~(1 << id);
+- dev_dbg(dev, "SSI%d uses DEPENDENT mode\n", id);
+- } else {
+- ssiu->ssi_mode0 |= (1 << id);
+- dev_dbg(dev, "SSI%d uses INDEPENDENT mode\n", id);
+- }
+-
+- /*
+- * SSI_MODE1
+- */
+-#define ssi_parent_set(p, sync, adg, ext) \
+- do { \
+- ssi->parent = ssiu->ssi + p; \
+- if (rsnd_dai_is_clk_master(rdai)) \
+- val = adg; \
+- else \
+- val = ext; \
+- } while (0)
+-
+- flags = rsnd_ssi_mode_flags(ssi);
+- if (flags & RSND_SSI_CLK_PIN_SHARE) {
+-
+- val = 0;
+- switch (id) {
+- case 1:
+- ssi_parent_set(0, (1 << 4), (0x2 << 0), (0x1 << 0));
+- break;
+- case 2:
+- ssi_parent_set(0, (1 << 4), (0x2 << 2), (0x1 << 2));
+- break;
+- case 4:
+- ssi_parent_set(3, (1 << 20), (0x2 << 16), (0x1 << 16));
+- break;
+- case 8:
+- ssi_parent_set(7, 0, 0, 0);
+- break;
+- }
+-
+- ssiu->ssi_mode1 |= val;
+- }
+-
+- rsnd_mod_write(&ssi->mod, SSI_MODE0, ssiu->ssi_mode0);
+- rsnd_mod_write(&ssi->mod, SSI_MODE1, ssiu->ssi_mode1);
+-}
+-
+ static void rsnd_ssi_status_check(struct rsnd_mod *mod,
+ u32 bit)
+ {
+@@ -320,7 +253,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ u32 cr;
+
+@@ -365,8 +297,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ ssi->cr_own = cr;
+ ssi->err = -1; /* ignore 1st error */
+
+- rsnd_ssi_mode_set(priv, rdai, ssi);
+-
+ return 0;
+ }
+
+@@ -588,6 +518,32 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
+ return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod;
+ }
+
++int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
++{
++ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
++
++ return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE);
++}
++
++static void rsnd_ssi_parent_clk_setup(struct rsnd_priv *priv, struct rsnd_ssi *ssi)
++{
++ if (!rsnd_ssi_is_pin_sharing(&ssi->mod))
++ return;
++
++ switch (rsnd_mod_id(&ssi->mod)) {
++ case 1:
++ case 2:
++ ssi->parent = rsnd_mod_to_ssi(rsnd_ssi_mod_get(priv, 0));
++ break;
++ case 4:
++ ssi->parent = rsnd_mod_to_ssi(rsnd_ssi_mod_get(priv, 3));
++ break;
++ case 8:
++ ssi->parent = rsnd_mod_to_ssi(rsnd_ssi_mod_get(priv, 7));
++ break;
++ }
++}
++
+ int rsnd_ssi_probe(struct platform_device *pdev,
+ struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+@@ -668,6 +624,8 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ }
+
+ rsnd_mod_init(priv, &ssi->mod, ops, i);
++
++ rsnd_ssi_parent_clk_setup(priv, ssi);
+ }
+
+ dev_dbg(dev, "ssi probed\n");
+--
+2.1.2
+
diff --git a/patches.renesas/0027-ASoC-rsnd-remove-ssiu-from-ssi.c.patch b/patches.renesas/0027-ASoC-rsnd-remove-ssiu-from-ssi.c.patch
new file mode 100644
index 00000000000000..745ec14b560f18
--- /dev/null
+++ b/patches.renesas/0027-ASoC-rsnd-remove-ssiu-from-ssi.c.patch
@@ -0,0 +1,106 @@
+From 15589fc6b732809fd7e5dd7ba0b85499a7ec7585 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:40 -0800
+Subject: ASoC: rsnd: remove ssiu from ssi.c
+
+Now, SSI_MODE0/1 are controlled under scu.c
+ssiu is no longer needed on ssi.c
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit dd27d808f9e084e7e9c4719c17f17d1fa35c45a6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 3 ++-
+ sound/soc/sh/rcar/ssi.c | 24 +++++++-----------------
+ 2 files changed, 9 insertions(+), 18 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 85b926229b81..e92b1f438f74 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -280,7 +280,8 @@ struct rsnd_priv {
+ /*
+ * below value will be filled on rsnd_ssi_probe()
+ */
+- void *ssiu;
++ void *ssi;
++ int ssi_nr;
+
+ /*
+ * below value will be filled on rsnd_dai_probe()
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 0f314db8cb50..dc72439da58d 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -74,18 +74,13 @@ struct rsnd_ssi {
+ unsigned int rate;
+ };
+
+-struct rsnd_ssiu {
+- int ssi_nr;
+- struct rsnd_ssi *ssi;
+-};
+-
+ #define for_each_rsnd_ssi(pos, priv, i) \
+ for (i = 0; \
+ (i < rsnd_ssi_nr(priv)) && \
+- ((pos) = ((struct rsnd_ssiu *)((priv)->ssiu))->ssi + i); \
++ ((pos) = ((struct rsnd_ssi *)(priv)->ssi + i)); \
+ i++)
+
+-#define rsnd_ssi_nr(priv) (((struct rsnd_ssiu *)((priv)->ssiu))->ssi_nr)
++#define rsnd_ssi_nr(priv) ((priv)->ssi_nr)
+ #define rsnd_mod_to_ssi(_mod) container_of((_mod), struct rsnd_ssi, mod)
+ #define rsnd_dma_to_ssi(dma) rsnd_mod_to_ssi(rsnd_dma_to_mod(dma))
+ #define rsnd_ssi_pio_available(ssi) ((ssi)->info->pio_irq > 0)
+@@ -94,8 +89,6 @@ struct rsnd_ssiu {
+ #define rsnd_ssi_clk_from_parent(ssi) ((ssi)->parent)
+ #define rsnd_ssi_mode_flags(p) ((p)->info->flags)
+ #define rsnd_ssi_dai_id(ssi) ((ssi)->info->dai_id)
+-#define rsnd_ssi_to_ssiu(ssi)\
+- (((struct rsnd_ssiu *)((ssi) - rsnd_mod_id(&(ssi)->mod))) - 1)
+
+ static void rsnd_ssi_status_check(struct rsnd_mod *mod,
+ u32 bit)
+@@ -515,7 +508,7 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
+ if (WARN_ON(id < 0 || id >= rsnd_ssi_nr(priv)))
+ id = 0;
+
+- return &(((struct rsnd_ssiu *)(priv->ssiu))->ssi + id)->mod;
++ return &((struct rsnd_ssi *)(priv->ssi) + id)->mod;
+ }
+
+ int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
+@@ -552,7 +545,6 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_mod_ops *ops;
+ struct clk *clk;
+- struct rsnd_ssiu *ssiu;
+ struct rsnd_ssi *ssi;
+ char name[RSND_SSI_NAME_SIZE];
+ int i, nr, ret;
+@@ -561,16 +553,14 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ * init SSI
+ */
+ nr = info->ssi_info_nr;
+- ssiu = devm_kzalloc(dev, sizeof(*ssiu) + (sizeof(*ssi) * nr),
+- GFP_KERNEL);
+- if (!ssiu) {
++ ssi = devm_kzalloc(dev, sizeof(*ssi) * nr, GFP_KERNEL);
++ if (!ssi) {
+ dev_err(dev, "SSI allocate failed\n");
+ return -ENOMEM;
+ }
+
+- priv->ssiu = ssiu;
+- ssiu->ssi = (struct rsnd_ssi *)(ssiu + 1);
+- ssiu->ssi_nr = nr;
++ priv->ssi = ssi;
++ priv->ssi_nr = nr;
+
+ for_each_rsnd_ssi(ssi, priv, i) {
+ pinfo = &info->ssi_info[i];
+--
+2.1.2
+
diff --git a/patches.renesas/0028-ASoC-rsnd-rename-rsnd_scu_convert_rate_ctrl.patch b/patches.renesas/0028-ASoC-rsnd-rename-rsnd_scu_convert_rate_ctrl.patch
new file mode 100644
index 00000000000000..103e546290bce4
--- /dev/null
+++ b/patches.renesas/0028-ASoC-rsnd-rename-rsnd_scu_convert_rate_ctrl.patch
@@ -0,0 +1,48 @@
+From 4c373a71fd59e08583ca8e70476d3d1a7862050f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:48 -0800
+Subject: ASoC: rsnd: rename rsnd_scu_convert_rate_ctrl()
+
+rsnd_scu_convert_rate_ctrl() is unclear naming,
+and there is "rsnd_scu_convert_rate" variable.
+These are confusable.
+it renamed to rsnd_scu_set_convert_rate()
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit f80e1c96339a45992b5dded0474288e52bd3b18d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index ade10474a0cf..872a115cd224 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -190,10 +190,9 @@ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ return rate;
+ }
+
+-static int rsnd_scu_convert_rate_ctrl(
+- struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+@@ -283,7 +282,7 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_convert_rate_ctrl(mod, rdai, io);
++ ret = rsnd_scu_set_convert_rate(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0029-ASoC-rsnd-explain-SRC-bypass-mode-settings-in-commen.patch b/patches.renesas/0029-ASoC-rsnd-explain-SRC-bypass-mode-settings-in-commen.patch
new file mode 100644
index 00000000000000..873aac8af0b8c8
--- /dev/null
+++ b/patches.renesas/0029-ASoC-rsnd-explain-SRC-bypass-mode-settings-in-commen.patch
@@ -0,0 +1,75 @@
+From 071ccf09cd95cfa486cab493611cb16b7e144294 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:39:56 -0800
+Subject: ASoC: rsnd: explain SRC bypass mode settings in comment
+
+SRC bypass mode is useful for debugging.
+This patch explains SRC bypass mode settings in comment
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 41c6221c39accdc4fe2b0c0fa196b6302b704e57)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 45 insertions(+)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 872a115cd224..076aa71bc102 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -40,6 +40,51 @@ struct rsnd_scu {
+ *
+ */
+
++/*
++ * How to use SRC bypass mode for debugging
++ *
++ * SRC has bypass mode, and it is useful for debugging.
++ * In Gen2 case,
++ * SRCm_MODE controls whether SRC is used or not
++ * SSI_MODE0 controls whether SSIU which receives SRC data
++ * is used or not.
++ * Both SRCm_MODE/SSI_MODE0 settings are needed if you use SRC,
++ * but SRC bypass mode needs SSI_MODE0 only.
++ *
++ * This driver request
++ * struct rsnd_scu_platform_info {
++ * u32 flags;
++ * u32 convert_rate;
++ * }
++ *
++ * rsnd_scu_hpbif_is_enable() will be true
++ * if flags had RSND_SCU_USE_HPBIF,
++ * and it controls whether SSIU is used or not.
++ *
++ * rsnd_scu_convert_rate() indicates
++ * above convert_rate, and it controls
++ * whether SRC is used or not.
++ *
++ * ex) doesn't use SRC
++ * struct rsnd_scu_platform_info info = {
++ * .flags = 0,
++ * .convert_rate = 0,
++ * };
++ *
++ * ex) uses SRC
++ * struct rsnd_scu_platform_info info = {
++ * .flags = RSND_SCU_USE_HPBIF,
++ * .convert_rate = 48000,
++ * };
++ *
++ * ex) uses SRC bypass mode
++ * struct rsnd_scu_platform_info info = {
++ * .flags = RSND_SCU_USE_HPBIF,
++ * .convert_rate = 0,
++ * };
++ *
++ */
++
+ #define rsnd_mod_to_scu(_mod) \
+ container_of((_mod), struct rsnd_scu, mod)
+
+--
+2.1.2
+
diff --git a/patches.renesas/0030-ASoC-rsnd-remove-duplicate-priv-from-rsnd_dma.patch b/patches.renesas/0030-ASoC-rsnd-remove-duplicate-priv-from-rsnd_dma.patch
new file mode 100644
index 00000000000000..3feec31c94c361
--- /dev/null
+++ b/patches.renesas/0030-ASoC-rsnd-remove-duplicate-priv-from-rsnd_dma.patch
@@ -0,0 +1,63 @@
+From 5f1876530f98b226d1475d4b3e6d5949ac98896f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:03 -0800
+Subject: ASoC: rsnd: remove duplicate *priv from rsnd_dma
+
+*priv pointer exists under rsnd_mod,
+and, it can get rsnd_mod pointer from rsnd_dma.
+remove duplicate rsnd_dma :: priv
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9b5ab573a81b9ac0df90b74d732651fdf8b24525)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 5 ++---
+ sound/soc/sh/rcar/rsnd.h | 1 -
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 743de5e3b1e1..ed8611f9c64f 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -156,7 +156,7 @@ void rsnd_dma_stop(struct rsnd_dma *dma)
+ static void rsnd_dma_complete(void *data)
+ {
+ struct rsnd_dma *dma = (struct rsnd_dma *)data;
+- struct rsnd_priv *priv = dma->priv;
++ struct rsnd_priv *priv = rsnd_mod_to_priv(rsnd_dma_to_mod(dma));
+ unsigned long flags;
+
+ rsnd_lock(priv, flags);
+@@ -172,7 +172,7 @@ static void rsnd_dma_complete(void *data)
+ static void rsnd_dma_do_work(struct work_struct *work)
+ {
+ struct rsnd_dma *dma = container_of(work, struct rsnd_dma, work);
+- struct rsnd_priv *priv = dma->priv;
++ struct rsnd_priv *priv = rsnd_mod_to_priv(rsnd_dma_to_mod(dma));
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct dma_async_tx_descriptor *desc;
+ dma_addr_t buf;
+@@ -246,7 +246,6 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
+ goto rsnd_dma_init_err;
+
+ dma->dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+- dma->priv = priv;
+ dma->inquiry = inquiry;
+ dma->complete = complete;
+ INIT_WORK(&dma->work, rsnd_dma_do_work);
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index e92b1f438f74..33c01fb9f5fd 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -96,7 +96,6 @@ void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg,
+ * R-Car DMA
+ */
+ struct rsnd_dma {
+- struct rsnd_priv *priv;
+ struct sh_dmae_slave slave;
+ struct work_struct work;
+ struct dma_chan *chan;
+--
+2.1.2
+
diff --git a/patches.renesas/0031-ASoC-rsnd-non-0-is-error-on-probe.patch b/patches.renesas/0031-ASoC-rsnd-non-0-is-error-on-probe.patch
new file mode 100644
index 00000000000000..c13fd041b4b12a
--- /dev/null
+++ b/patches.renesas/0031-ASoC-rsnd-non-0-is-error-on-probe.patch
@@ -0,0 +1,51 @@
+From ac052396d2d048f0737bace5471c33267d4dd0af Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:13 -0800
+Subject: ASoC: rsnd: non 0 is error on probe
+
+Some xxx_probe() returns not only -Exx, but also PTR_ERR().
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 106d2eff563b2abdb34872cb8ec7b19766edaffc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index ed8611f9c64f..4fd57351c54a 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -737,23 +737,23 @@ static int rsnd_probe(struct platform_device *pdev)
+ * init each module
+ */
+ ret = rsnd_gen_probe(pdev, info, priv);
+- if (ret < 0)
++ if (ret)
+ return ret;
+
+ ret = rsnd_scu_probe(pdev, info, priv);
+- if (ret < 0)
++ if (ret)
+ return ret;
+
+ ret = rsnd_adg_probe(pdev, info, priv);
+- if (ret < 0)
++ if (ret)
+ return ret;
+
+ ret = rsnd_ssi_probe(pdev, info, priv);
+- if (ret < 0)
++ if (ret)
+ return ret;
+
+ ret = rsnd_dai_probe(pdev, info, priv);
+- if (ret < 0)
++ if (ret)
+ return ret;
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0032-ASoC-rsnd-fixup-Gen2-module-naming.patch b/patches.renesas/0032-ASoC-rsnd-fixup-Gen2-module-naming.patch
new file mode 100644
index 00000000000000..d6e85149a46120
--- /dev/null
+++ b/patches.renesas/0032-ASoC-rsnd-fixup-Gen2-module-naming.patch
@@ -0,0 +1,31 @@
+From daddccac8880ad7241917463983fca5a9eb39512 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:20 -0800
+Subject: ASoC: rsnd: fixup Gen2 module naming
+
+Gen2 has SCU, not SRU
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 64de62b38641dec05905930024133726c540040e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/gen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index cbdbbfa322b8..76828c20fb50 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -283,7 +283,7 @@ static int rsnd_gen2_probe(struct platform_device *pdev,
+ return ret;
+
+ dev_dbg(dev, "Gen2 device probed\n");
+- dev_dbg(dev, "SRU : %08x => %p\n", scu_res->start,
++ dev_dbg(dev, "SCU : %08x => %p\n", scu_res->start,
+ gen->base[RSND_GEN2_SCU]);
+ dev_dbg(dev, "ADG : %08x => %p\n", adg_res->start,
+ gen->base[RSND_GEN2_ADG]);
+--
+2.1.2
+
diff --git a/patches.renesas/0033-ASoC-rsnd-don-t-use-schedule_work-when-rsnd_dma_star.patch b/patches.renesas/0033-ASoC-rsnd-don-t-use-schedule_work-when-rsnd_dma_star.patch
new file mode 100644
index 00000000000000..7b8881f5604fe8
--- /dev/null
+++ b/patches.renesas/0033-ASoC-rsnd-don-t-use-schedule_work-when-rsnd_dma_star.patch
@@ -0,0 +1,67 @@
+From 4a24a5f5cab4e1f170c8ced6e375579903cd2c7f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:27 -0800
+Subject: ASoC: rsnd: don't use schedule_work() when rsnd_dma_start()
+
+rsnd_dma_start() is the function to start DMAEngine.
+Current code is using schedule_work() for it,
+but it breaks DMAC/SSI register setting timing.
+Don't use schedule_work() on it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit f5cab3b8976d59c6166228874a5af3d87c94c723)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 4fd57351c54a..11eb0e35b9ce 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -132,6 +132,7 @@ void rsnd_mod_init(struct rsnd_priv *priv,
+ /*
+ * rsnd_dma functions
+ */
++static void __rsnd_dma_start(struct rsnd_dma *dma);
+ static void rsnd_dma_continue(struct rsnd_dma *dma)
+ {
+ /* push next A or B plane */
+@@ -143,7 +144,7 @@ void rsnd_dma_start(struct rsnd_dma *dma)
+ {
+ /* push both A and B plane*/
+ dma->submit_loop = 2;
+- schedule_work(&dma->work);
++ __rsnd_dma_start(dma);
+ }
+
+ void rsnd_dma_stop(struct rsnd_dma *dma)
+@@ -169,9 +170,8 @@ static void rsnd_dma_complete(void *data)
+ rsnd_unlock(priv, flags);
+ }
+
+-static void rsnd_dma_do_work(struct work_struct *work)
++static void __rsnd_dma_start(struct rsnd_dma *dma)
+ {
+- struct rsnd_dma *dma = container_of(work, struct rsnd_dma, work);
+ struct rsnd_priv *priv = rsnd_mod_to_priv(rsnd_dma_to_mod(dma));
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct dma_async_tx_descriptor *desc;
+@@ -204,6 +204,13 @@ static void rsnd_dma_do_work(struct work_struct *work)
+ }
+ }
+
++static void rsnd_dma_do_work(struct work_struct *work)
++{
++ struct rsnd_dma *dma = container_of(work, struct rsnd_dma, work);
++
++ __rsnd_dma_start(dma);
++}
++
+ int rsnd_dma_available(struct rsnd_dma *dma)
+ {
+ return !!dma->chan;
+--
+2.1.2
+
diff --git a/patches.renesas/0034-ASoC-rsnd-SCU-should-be-called-before-SSI.patch b/patches.renesas/0034-ASoC-rsnd-SCU-should-be-called-before-SSI.patch
new file mode 100644
index 00000000000000..6a062559ec8cd8
--- /dev/null
+++ b/patches.renesas/0034-ASoC-rsnd-SCU-should-be-called-before-SSI.patch
@@ -0,0 +1,39 @@
+From a90d8fa2564da6fc05815a6e74836290183fd505 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:34 -0800
+Subject: ASoC: rsnd: SCU should be called before SSI
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit be213ac1af893410eb8256010edf136b4099e827)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/gen.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 76828c20fb50..db486aae6b8b 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -182,14 +182,14 @@ int rsnd_gen_path_init(struct rsnd_priv *priv,
+ rsnd_dai_is_play(rdai, io));
+ id = rsnd_mod_id(mod);
+
+- /* SSI */
+- mod = rsnd_ssi_mod_get(priv, id);
++ /* SCU */
++ mod = rsnd_scu_mod_get(priv, id);
+ ret = rsnd_dai_connect(rdai, mod, io);
+ if (ret < 0)
+ return ret;
+
+- /* SCU */
+- mod = rsnd_scu_mod_get(priv, id);
++ /* SSI */
++ mod = rsnd_ssi_mod_get(priv, id);
+ ret = rsnd_dai_connect(rdai, mod, io);
+
+ return ret;
+--
+2.1.2
+
diff --git a/patches.renesas/0035-ASoC-rsnd-clarify-scu.c-area.patch b/patches.renesas/0035-ASoC-rsnd-clarify-scu.c-area.patch
new file mode 100644
index 00000000000000..a9a712cfcad155
--- /dev/null
+++ b/patches.renesas/0035-ASoC-rsnd-clarify-scu.c-area.patch
@@ -0,0 +1,43 @@
+From 16bb4732b1468feb8aa080b0ffe232257eb673ff Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:41 -0800
+Subject: ASoC: rsnd: clarify scu.c area
+
+scu.c cares SRU(Gen1) / SCU(Gen2) / SSIU(Gen2)
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c926b746055adfd915936c67244e635e9c7a3d84)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 076aa71bc102..1adc85825f4e 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -41,6 +41,20 @@ struct rsnd_scu {
+ */
+
+ /*
++ * scu.c is caring...
++ *
++ * Gen1
++ *
++ * [mem] -> [SRU] -> [SSI]
++ * |--------|
++ *
++ * Gen2
++ *
++ * [mem] -> [SCU] -> [SSIU] -> [SSI]
++ * |-----------------|
++ */
++
++/*
+ * How to use SRC bypass mode for debugging
+ *
+ * SRC has bypass mode, and it is useful for debugging.
+--
+2.1.2
+
diff --git a/patches.renesas/0036-ASoC-rsnd-Merge-macros-in-scu.c.patch b/patches.renesas/0036-ASoC-rsnd-Merge-macros-in-scu.c.patch
new file mode 100644
index 00000000000000..8aa965d8649546
--- /dev/null
+++ b/patches.renesas/0036-ASoC-rsnd-Merge-macros-in-scu.c.patch
@@ -0,0 +1,68 @@
+From baa79efb1f633bef236d9c820ad743091244cd55 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:47 -0800
+Subject: ASoC: rsnd: Merge macros in scu.c
+
+Merge #define lines, since these are defined
+in the scattering place
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 39cf3c4064b8db25efe501fec8e3c48a578b4b58)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 1adc85825f4e..8181ec55ad21 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -16,9 +16,6 @@ struct rsnd_scu {
+ struct clk *clk;
+ };
+
+-#define rsnd_scu_mode_flags(p) ((p)->info->flags)
+-#define rsnd_scu_convert_rate(p) ((p)->info->convert_rate)
+-
+ #define RSND_SCU_NAME_SIZE 16
+
+ /*
+@@ -30,6 +27,18 @@ struct rsnd_scu {
+ #define OTBL_18 (6 << 16)
+ #define OTBL_16 (8 << 16)
+
++#define rsnd_scu_mode_flags(p) ((p)->info->flags)
++#define rsnd_scu_convert_rate(p) ((p)->info->convert_rate)
++#define rsnd_mod_to_scu(_mod) \
++ container_of((_mod), struct rsnd_scu, mod)
++
++#define for_each_rsnd_scu(pos, priv, i) \
++ for ((i) = 0; \
++ ((i) < rsnd_scu_nr(priv)) && \
++ ((pos) = (struct rsnd_scu *)(priv)->scu + i); \
++ i++)
++
++
+ /*
+ * image of SRC (Sampling Rate Converter)
+ *
+@@ -99,15 +108,6 @@ struct rsnd_scu {
+ *
+ */
+
+-#define rsnd_mod_to_scu(_mod) \
+- container_of((_mod), struct rsnd_scu, mod)
+-
+-#define for_each_rsnd_scu(pos, priv, i) \
+- for ((i) = 0; \
+- ((i) < rsnd_scu_nr(priv)) && \
+- ((pos) = (struct rsnd_scu *)(priv)->scu + i); \
+- i++)
+-
+ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+--
+2.1.2
+
diff --git a/patches.renesas/0037-ASoC-rsnd-rsnd_scu_hpbif_is_enable-become-macro.patch b/patches.renesas/0037-ASoC-rsnd-rsnd_scu_hpbif_is_enable-become-macro.patch
new file mode 100644
index 00000000000000..b2260293f37b77
--- /dev/null
+++ b/patches.renesas/0037-ASoC-rsnd-rsnd_scu_hpbif_is_enable-become-macro.patch
@@ -0,0 +1,85 @@
+From 3e8a5317ed44bde97263b5de32d3e8578ec403d0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:40:54 -0800
+Subject: ASoC: rsnd: rsnd_scu_hpbif_is_enable() become macro
+
+rsnd_scu_hpbif_is_enable() is used only scu.c now.
+It can be local macro
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 96c7c0d6f8c6e09e9123f0518130c047c5de40f6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 1 -
+ sound/soc/sh/rcar/scu.c | 15 +++++----------
+ 2 files changed, 5 insertions(+), 11 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 33c01fb9f5fd..a9c58305e2f1 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -303,7 +303,6 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ void rsnd_scu_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+-bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod);
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_mod *ssi_mod,
+ struct snd_pcm_runtime *runtime);
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 8181ec55ad21..2f839f72c99c 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -31,6 +31,8 @@ struct rsnd_scu {
+ #define rsnd_scu_convert_rate(p) ((p)->info->convert_rate)
+ #define rsnd_mod_to_scu(_mod) \
+ container_of((_mod), struct rsnd_scu, mod)
++#define rsnd_scu_hpbif_is_enable(scu) \
++ (rsnd_scu_mode_flags(scu) & RSND_SCU_USE_HPBIF)
+
+ #define for_each_rsnd_scu(pos, priv, i) \
+ for ((i) = 0; \
+@@ -113,13 +115,14 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ int id = rsnd_mod_id(mod);
+
+ /*
+ * SSI_MODE0
+ */
+ rsnd_mod_bset(mod, SSI_MODE0, (1 << id),
+- rsnd_scu_hpbif_is_enable(mod) ? 0 : (1 << id));
++ rsnd_scu_hpbif_is_enable(scu) ? 0 : (1 << id));
+
+ /*
+ * SSI_MODE1
+@@ -316,14 +319,6 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-bool rsnd_scu_hpbif_is_enable(struct rsnd_mod *mod)
+-{
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- u32 flags = rsnd_scu_mode_flags(scu);
+-
+- return !!(flags & RSND_SCU_USE_HPBIF);
+-}
+-
+ static int rsnd_scu_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -449,7 +444,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ scu->clk = clk;
+
+ ops = &rsnd_scu_non_ops;
+- if (rsnd_scu_hpbif_is_enable(&scu->mod))
++ if (rsnd_scu_hpbif_is_enable(scu))
+ ops = &rsnd_scu_ops;
+
+ rsnd_mod_init(priv, &scu->mod, ops, i);
+--
+2.1.2
+
diff --git a/patches.renesas/0038-ASoC-rsnd-merge-SRC-clock-timing-setting.patch b/patches.renesas/0038-ASoC-rsnd-merge-SRC-clock-timing-setting.patch
new file mode 100644
index 00000000000000..fd60f45938132b
--- /dev/null
+++ b/patches.renesas/0038-ASoC-rsnd-merge-SRC-clock-timing-setting.patch
@@ -0,0 +1,182 @@
+From 0a1192000a62c95652af288c7f29e5249eb450f0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:41:10 -0800
+Subject: ASoC: rsnd: merge SRC clock timing/setting
+
+SRC clock and timing setting register
+exist in SRU and ADG on Gen1.
+But, these are merged into ADG on Gen2.
+Current driver is supporting Gen1 SRC only
+at this point, but, above settings are
+set as different function.
+This patch merges these as preparation of Gen2 support.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 28dc4b63cdb96f2448a677320fcc0eb112e13e3f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 20 ++++----------------
+ sound/soc/sh/rcar/rsnd.h | 8 ++++----
+ sound/soc/sh/rcar/scu.c | 48 +++++++++++++++++++++++++++++++++++-------------
+ 3 files changed, 43 insertions(+), 33 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index a53235c4d1b0..5bdffa480245 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -30,10 +30,10 @@ struct rsnd_adg {
+ i++, (pos) = adg->clk[i])
+ #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg)
+
+-static int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
+- struct rsnd_mod *mod,
+- unsigned int src_rate,
+- unsigned int dst_rate)
++int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
++ struct rsnd_mod *mod,
++ unsigned int src_rate,
++ unsigned int dst_rate)
+ {
+ struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
+ struct device *dev = rsnd_priv_to_dev(priv);
+@@ -91,18 +91,6 @@ find_rate:
+ return 0;
+ }
+
+-int rsnd_adg_set_convert_clk(struct rsnd_priv *priv,
+- struct rsnd_mod *mod,
+- unsigned int src_rate,
+- unsigned int dst_rate)
+-{
+- if (rsnd_is_gen1(priv))
+- return rsnd_adg_set_convert_clk_gen1(priv, mod,
+- src_rate, dst_rate);
+-
+- return -EINVAL;
+-}
+-
+ static void rsnd_adg_set_ssi_clk(struct rsnd_mod *mod, u32 val)
+ {
+ int id = rsnd_mod_id(mod);
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index a9c58305e2f1..39914558e857 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -246,10 +246,10 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+ void rsnd_adg_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-int rsnd_adg_set_convert_clk(struct rsnd_priv *priv,
+- struct rsnd_mod *mod,
+- unsigned int src_rate,
+- unsigned int dst_rate);
++int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
++ struct rsnd_mod *mod,
++ unsigned int src_rate,
++ unsigned int dst_rate);
+
+ /*
+ * R-Car sound priv
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 2f839f72c99c..e2ffcc415057 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -172,10 +172,8 @@ static int rsnd_src_set_route_if_gen1(
+ { 0x3, 30, }, /* 8 */
+ };
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ u32 mask;
+ u32 val;
+- int shift;
+ int id;
+
+ /*
+@@ -197,6 +195,23 @@ static int rsnd_src_set_route_if_gen1(
+
+ rsnd_mod_bset(mod, SRC_ROUTE_SEL, mask, val);
+
++ return 0;
++}
++
++static int rsnd_scu_set_convert_timing_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
++ u32 convert_rate = rsnd_scu_convert_rate(scu);
++ u32 mask;
++ u32 val;
++ int shift;
++ int id = rsnd_mod_id(mod);
++ int ret;
++
+ /*
+ * SRC_TIMING_SELECT
+ */
+@@ -209,12 +224,23 @@ static int rsnd_src_set_route_if_gen1(
+ * SSI WS is used as source clock if SRC is not used
+ * (when playback, source/destination become reverse when capture)
+ */
+- if (rsnd_scu_convert_rate(scu)) /* use ADG */
++ ret = 0;
++ if (convert_rate) {
++ /* use ADG */
+ val = 0;
+- else if (8 == id) /* use SSI WS, but SRU8 is special */
++ ret = rsnd_adg_set_convert_clk_gen1(priv, mod,
++ runtime->rate,
++ convert_rate);
++ } else if (8 == id) {
++ /* use SSI WS, but SRU8 is special */
+ val = id << shift;
+- else /* use SSI WS */
++ } else {
++ /* use SSI WS */
+ val = (id + 1) << shift;
++ }
++
++ if (ret < 0)
++ return ret;
+
+ switch (id / 4) {
+ case 0:
+@@ -284,7 +310,6 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+
+ if (convert_rate) {
+ u32 fsrate = 0x0400000 / convert_rate * runtime->rate;
+- int ret;
+
+ /* Enable the initial value of IFS */
+ rsnd_mod_write(mod, SRC_IFSCR, 1);
+@@ -301,13 +326,6 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+ if (rsnd_is_gen1(priv)) {
+ /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */
+ }
+-
+- /* set convert clock */
+- ret = rsnd_adg_set_convert_clk(priv, mod,
+- runtime->rate,
+- convert_rate);
+- if (ret < 0)
+- return ret;
+ }
+
+ /* Cancel the initialization and operate the SRC function */
+@@ -340,6 +358,10 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+ if (ret < 0)
+ return ret;
+
++ ret = rsnd_scu_set_convert_timing_gen1(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0039-ASoC-rsnd-add-rsnd_ssi_is_play.patch b/patches.renesas/0039-ASoC-rsnd-add-rsnd_ssi_is_play.patch
new file mode 100644
index 00000000000000..bc3249b0bf0e8b
--- /dev/null
+++ b/patches.renesas/0039-ASoC-rsnd-add-rsnd_ssi_is_play.patch
@@ -0,0 +1,67 @@
+From 6d5caf063ad0b3e1040350212705d24f056d6939 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:41:17 -0800
+Subject: ASoC: rsnd: add rsnd_ssi_is_play()
+
+SCU needs SSI direction if Gen2.
+Add rsnd_ssi_is_play() function for it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 32f27ebf9b625df610c12408ea15bae37be75eaf)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 1 +
+ sound/soc/sh/rcar/ssi.c | 11 +++++++++--
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 39914558e857..b1874eb71436 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -321,5 +321,6 @@ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
+ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+ int dai_id, int is_play);
+ int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
++int rsnd_ssi_is_play(struct rsnd_mod *mod);
+
+ #endif
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index dc72439da58d..bae309c9f0fb 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -494,7 +494,7 @@ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+ if (rsnd_ssi_dai_id(ssi) != dai_id)
+ continue;
+
+- has_play = !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY);
++ has_play = rsnd_ssi_is_play(&ssi->mod);
+
+ if (is_play == has_play)
+ return &ssi->mod;
+@@ -518,6 +518,13 @@ int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
+ return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_CLK_PIN_SHARE);
+ }
+
++int rsnd_ssi_is_play(struct rsnd_mod *mod)
++{
++ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
++
++ return !!(rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY);
++}
++
+ static void rsnd_ssi_parent_clk_setup(struct rsnd_priv *priv, struct rsnd_ssi *ssi)
+ {
+ if (!rsnd_ssi_is_pin_sharing(&ssi->mod))
+@@ -582,7 +589,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ if (pinfo->dma_id > 0) {
+ ret = rsnd_dma_init(
+ priv, rsnd_mod_to_dma(&ssi->mod),
+- (rsnd_ssi_mode_flags(ssi) & RSND_SSI_PLAY),
++ rsnd_ssi_is_play(&ssi->mod),
+ pinfo->dma_id,
+ rsnd_ssi_dma_inquiry,
+ rsnd_ssi_dma_complete);
+--
+2.1.2
+
diff --git a/patches.renesas/0040-ASoC-rsnd-extracts-Gen1-Gen2-common-parts.patch b/patches.renesas/0040-ASoC-rsnd-extracts-Gen1-Gen2-common-parts.patch
new file mode 100644
index 00000000000000..bc49d0b8dfdc37
--- /dev/null
+++ b/patches.renesas/0040-ASoC-rsnd-extracts-Gen1-Gen2-common-parts.patch
@@ -0,0 +1,482 @@
+From e055532069fb171e266999873458ac552e718a26 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:41:36 -0800
+Subject: ASoC: rsnd: extracts Gen1/Gen2 common parts
+
+Renesas sound IP Gen1/Gen2 are similar, but different.
+This patch extracts Gen1/Gen2 common and dependency parts,
+and create Gen1/Gen2 ops to control it.
+
+According to this structure, SSIU setup which
+has been implemented on ssi.c can be moved to scu.c
+(SRU/SSIU/SCU should be implemented on scu.c)
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 1b7b08efbe7419cc3e082f2b5ec8ae89f7af43d1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 2 +-
+ sound/soc/sh/rcar/scu.c | 336 ++++++++++++++++++++++++++++-------------------
+ sound/soc/sh/rcar/ssi.c | 5 -
+ 3 files changed, 205 insertions(+), 138 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index b1874eb71436..c397dc8edee5 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -48,7 +48,7 @@ enum rsnd_reg {
+ RSND_REG_SRC_IFSCR,
+ RSND_REG_SRC_IFSVR,
+ RSND_REG_SRC_SRCCR,
+- RSND_REG_SRC_MNFSR,
++ RSND_REG_SRC_MNFSR, /* for Gen1 */
+
+ /* ADG */
+ RSND_REG_BRRA,
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index e2ffcc415057..29d8990e3f0f 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -110,6 +110,9 @@ struct rsnd_scu {
+ *
+ */
+
++/*
++ * Gen1/Gen2 common functions
++ */
+ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -151,11 +154,145 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-/* Gen1 only */
+-static int rsnd_src_set_route_if_gen1(
+- struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
++ struct rsnd_mod *ssi_mod,
++ struct snd_pcm_runtime *runtime)
++{
++ struct rsnd_scu *scu;
++ unsigned int rate;
++
++ /* this function is assuming SSI id = SCU id here */
++ scu = rsnd_mod_to_scu(rsnd_scu_mod_get(priv, rsnd_mod_id(ssi_mod)));
++
++ /*
++ * return convert rate if SRC is used,
++ * otherwise, return runtime->rate as usual
++ */
++ rate = rsnd_scu_convert_rate(scu);
++ if (!rate)
++ rate = runtime->rate;
++
++ return rate;
++}
++
++static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ u32 convert_rate = rsnd_scu_convert_rate(scu);
++ u32 adinr = runtime->channels;
++ u32 fsrate = 0;
++
++ if (convert_rate)
++ fsrate = 0x0400000 / convert_rate * runtime->rate;
++
++ /* set/clear soft reset */
++ rsnd_mod_write(mod, SRC_SWRSR, 0);
++ rsnd_mod_write(mod, SRC_SWRSR, 1);
++
++ /*
++ * Initialize the operation of the SRC internal circuits
++ * see rsnd_scu_start()
++ */
++ rsnd_mod_write(mod, SRC_SRCIR, 1);
++
++ /* Set channel number and output bit length */
++ switch (runtime->sample_bits) {
++ case 16:
++ adinr |= OTBL_16;
++ break;
++ case 32:
++ adinr |= OTBL_24;
++ break;
++ default:
++ return -EIO;
++ }
++ rsnd_mod_write(mod, SRC_ADINR, adinr);
++
++ /* Enable the initial value of IFS */
++ if (fsrate) {
++ rsnd_mod_write(mod, SRC_IFSCR, 1);
++
++ /* Set initial value of IFS */
++ rsnd_mod_write(mod, SRC_IFSVR, fsrate);
++ }
++
++ /* use DMA transfer */
++ rsnd_mod_write(mod, SRC_BUSIF_MODE, 1);
++
++ return 0;
++}
++
++static int rsnd_scu_init(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ int ret;
++
++ clk_enable(scu->clk);
++
++ ret = rsnd_scu_ssi_mode_init(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
++ return 0;
++}
++
++static int rsnd_scu_quit(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ clk_disable(scu->clk);
++
++ return 0;
++}
++
++static int rsnd_scu_start(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ /*
++ * Cancel the initialization and operate the SRC function
++ * see rsnd_scu_set_convert_rate()
++ */
++ rsnd_mod_write(mod, SRC_SRCIR, 0);
++
++ if (rsnd_scu_convert_rate(scu))
++ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
++
++ return 0;
++}
++
++
++static int rsnd_scu_stop(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ if (rsnd_scu_convert_rate(scu))
++ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
++
++ return 0;
++}
++
++static struct rsnd_mod_ops rsnd_scu_non_ops = {
++ .name = "scu (non)",
++};
++
++/*
++ * Gen1 functions
++ */
++static int rsnd_src_set_route_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+ struct scu_route_config {
+ u32 mask;
+@@ -171,17 +308,10 @@ static int rsnd_src_set_route_if_gen1(
+ { 0x3, 28, }, /* 7 */
+ { 0x3, 30, }, /* 8 */
+ };
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ u32 mask;
+ u32 val;
+ int id;
+
+- /*
+- * Gen1 only
+- */
+- if (!rsnd_is_gen1(priv))
+- return 0;
+-
+ id = rsnd_mod_id(mod);
+ if (id < 0 || id >= ARRAY_SIZE(routes))
+ return -EIO;
+@@ -257,104 +387,43 @@ static int rsnd_scu_set_convert_timing_gen1(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+- struct rsnd_mod *ssi_mod,
+- struct snd_pcm_runtime *runtime)
+-{
+- struct rsnd_scu *scu;
+- unsigned int rate;
+-
+- /* this function is assuming SSI id = SCU id here */
+- scu = rsnd_mod_to_scu(rsnd_scu_mod_get(priv, rsnd_mod_id(ssi_mod)));
+-
+- /*
+- * return convert rate if SRC is used,
+- * otherwise, return runtime->rate as usual
+- */
+- rate = rsnd_scu_convert_rate(scu);
+- if (!rate)
+- rate = runtime->rate;
+-
+- return rate;
+-}
+-
+-static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++static int rsnd_scu_set_convert_rate_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- u32 convert_rate = rsnd_scu_convert_rate(scu);
+- u32 adinr = runtime->channels;
+-
+- /* set/clear soft reset */
+- rsnd_mod_write(mod, SRC_SWRSR, 0);
+- rsnd_mod_write(mod, SRC_SWRSR, 1);
+-
+- /* Initialize the operation of the SRC internal circuits */
+- rsnd_mod_write(mod, SRC_SRCIR, 1);
+-
+- /* Set channel number and output bit length */
+- switch (runtime->sample_bits) {
+- case 16:
+- adinr |= OTBL_16;
+- break;
+- case 32:
+- adinr |= OTBL_24;
+- break;
+- default:
+- return -EIO;
+- }
+- rsnd_mod_write(mod, SRC_ADINR, adinr);
+-
+- if (convert_rate) {
+- u32 fsrate = 0x0400000 / convert_rate * runtime->rate;
+-
+- /* Enable the initial value of IFS */
+- rsnd_mod_write(mod, SRC_IFSCR, 1);
+-
+- /* Set initial value of IFS */
+- rsnd_mod_write(mod, SRC_IFSVR, fsrate);
+-
+- /* Select SRC mode (fixed value) */
+- rsnd_mod_write(mod, SRC_SRCCR, 0x00010110);
++ int ret;
+
+- /* Set the restriction value of the FS ratio (98%) */
+- rsnd_mod_write(mod, SRC_MNFSR, fsrate / 100 * 98);
++ ret = rsnd_scu_set_convert_rate(mod, rdai, io);
++ if (ret < 0)
++ return ret;
+
+- if (rsnd_is_gen1(priv)) {
+- /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */
+- }
+- }
++ /* Select SRC mode (fixed value) */
++ rsnd_mod_write(mod, SRC_SRCCR, 0x00010110);
+
+- /* Cancel the initialization and operate the SRC function */
+- rsnd_mod_write(mod, SRC_SRCIR, 0);
++ /* Set the restriction value of the FS ratio (98%) */
++ rsnd_mod_write(mod, SRC_MNFSR,
++ rsnd_mod_read(mod, SRC_IFSVR) / 100 * 98);
+
+- /* use DMA transfer */
+- rsnd_mod_write(mod, SRC_BUSIF_MODE, 1);
++ /* no SRC_BFSSR settings, since SRC_SRCCR::BUFMD is 0 */
+
+ return 0;
+ }
+
+-static int rsnd_scu_init(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++static int rsnd_scu_init_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ int ret;
+
+- clk_enable(scu->clk);
+-
+- ret = rsnd_scu_ssi_mode_init(mod, rdai, io);
++ ret = rsnd_scu_init(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_src_set_route_if_gen1(mod, rdai, io);
++ ret = rsnd_src_set_route_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_set_convert_rate(mod, rdai, io);
++ ret = rsnd_scu_set_convert_rate_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+@@ -365,62 +434,58 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_quit(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++static int rsnd_scu_start_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ int id = rsnd_mod_id(mod);
+
+- clk_disable(scu->clk);
++ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), (1 << id));
+
+- return 0;
++ return rsnd_scu_start(mod, rdai, io);
+ }
+
+-static int rsnd_scu_start(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++static int rsnd_scu_stop_gen1(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ int id = rsnd_mod_id(mod);
+
+- if (rsnd_is_gen1(priv))
+- rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), (1 << id));
+-
+- if (rsnd_scu_convert_rate(scu))
+- rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
++ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), 0);
+
+- return 0;
++ return rsnd_scu_stop(mod, rdai, io);
+ }
+
+-static int rsnd_scu_stop(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- int id = rsnd_mod_id(mod);
++static struct rsnd_mod_ops rsnd_scu_gen1_ops = {
++ .name = "sru (gen1)",
++ .init = rsnd_scu_init_gen1,
++ .quit = rsnd_scu_quit,
++ .start = rsnd_scu_start_gen1,
++ .stop = rsnd_scu_stop_gen1,
++};
+
+- if (rsnd_is_gen1(priv))
+- rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), 0);
++static struct rsnd_mod_ops rsnd_scu_non_gen1_ops = {
++ .name = "non-sru (gen1)",
++ .init = rsnd_scu_ssi_mode_init,
++};
+
+- if (rsnd_scu_convert_rate(scu))
+- rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
++/*
++ * Gen2 functions
++ */
++static int rsnd_scu_start_non_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ /* enable PIO interrupt */
++ rsnd_mod_write(mod, INT_ENABLE, 0x0f000000);
+
+ return 0;
+ }
+
+-static struct rsnd_mod_ops rsnd_scu_ops = {
+- .name = "scu",
+- .init = rsnd_scu_init,
+- .quit = rsnd_scu_quit,
+- .start = rsnd_scu_start,
+- .stop = rsnd_scu_stop,
+-};
+-
+-static struct rsnd_mod_ops rsnd_scu_non_ops = {
+- .name = "scu (non)",
++static struct rsnd_mod_ops rsnd_scu_non_gen2_ops = {
++ .name = "non-scu (gen2)",
+ .init = rsnd_scu_ssi_mode_init,
++ .start = rsnd_scu_start_non_gen2,
+ };
+
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+@@ -466,8 +531,15 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ scu->clk = clk;
+
+ ops = &rsnd_scu_non_ops;
+- if (rsnd_scu_hpbif_is_enable(scu))
+- ops = &rsnd_scu_ops;
++ if (rsnd_scu_hpbif_is_enable(scu)) {
++ if (rsnd_is_gen1(priv))
++ ops = &rsnd_scu_gen1_ops;
++ } else {
++ if (rsnd_is_gen1(priv))
++ ops = &rsnd_scu_non_gen1_ops;
++ if (rsnd_is_gen2(priv))
++ ops = &rsnd_scu_non_gen2_ops;
++ }
+
+ rsnd_mod_init(priv, &scu->mod, ops, i);
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index bae309c9f0fb..b7f464ebcdc0 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -363,16 +363,11 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
+
+ /* enable PIO IRQ */
+ ssi->cr_etc = UIEN | OIEN | DIEN;
+
+- /* enable PIO interrupt if gen2 */
+- if (rsnd_is_gen2(priv))
+- rsnd_mod_write(&ssi->mod, INT_ENABLE, 0x0f000000);
+-
+ rsnd_ssi_hw_start(ssi, rdai, io);
+
+ return 0;
+--
+2.1.2
+
diff --git a/patches.renesas/0041-ASoC-rsnd-remove-SSI-dependent-DMAEngine-callback.patch b/patches.renesas/0041-ASoC-rsnd-remove-SSI-dependent-DMAEngine-callback.patch
new file mode 100644
index 00000000000000..85b932fceb45e8
--- /dev/null
+++ b/patches.renesas/0041-ASoC-rsnd-remove-SSI-dependent-DMAEngine-callback.patch
@@ -0,0 +1,294 @@
+From 61b2df02c0b40d872eeb1e70c8569653e285f4b6 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:41:44 -0800
+Subject: ASoC: rsnd: remove SSI dependent DMAEngine callback
+
+Renesas Gen2 sound will use 2 DMAC
+which are Audio-DMAC, and Audio-DMAC-peri-peri.
+Current driver has callback function for each DMAC,
+because it assumed each DMAC needs special settings.
+But it became clear that these can share settings.
+This patch removes unnecessary callback
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 4686a0ad9aaee89495f181e5755d153e7fe7ffe6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 38 +++++++++++++++++++++++++++-----------
+ sound/soc/sh/rcar/rsnd.h | 10 +++++-----
+ sound/soc/sh/rcar/ssi.c | 47 ++++++++---------------------------------------
+ 3 files changed, 40 insertions(+), 55 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 11eb0e35b9ce..b5af6f5145ea 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -143,6 +143,7 @@ static void rsnd_dma_continue(struct rsnd_dma *dma)
+ void rsnd_dma_start(struct rsnd_dma *dma)
+ {
+ /* push both A and B plane*/
++ dma->offset = 0;
+ dma->submit_loop = 2;
+ __rsnd_dma_start(dma);
+ }
+@@ -157,12 +158,26 @@ void rsnd_dma_stop(struct rsnd_dma *dma)
+ static void rsnd_dma_complete(void *data)
+ {
+ struct rsnd_dma *dma = (struct rsnd_dma *)data;
++ struct rsnd_mod *mod = rsnd_dma_to_mod(dma);
+ struct rsnd_priv *priv = rsnd_mod_to_priv(rsnd_dma_to_mod(dma));
++ struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
+ unsigned long flags;
+
+ rsnd_lock(priv, flags);
+
+- dma->complete(dma);
++ /*
++ * Renesas sound Gen1 needs 1 DMAC,
++ * Gen2 needs 2 DMAC.
++ * In Gen2 case, it are Audio-DMAC, and Audio-DMAC-peri-peri.
++ * But, Audio-DMAC-peri-peri doesn't have interrupt,
++ * and this driver is assuming that here.
++ *
++ * If Audio-DMAC-peri-peri has interrpt,
++ * rsnd_dai_pointer_update() will be called twice,
++ * ant it will breaks io->byte_pos
++ */
++
++ rsnd_dai_pointer_update(io, io->byte_per_period);
+
+ if (dma->submit_loop)
+ rsnd_dma_continue(dma);
+@@ -172,17 +187,21 @@ static void rsnd_dma_complete(void *data)
+
+ static void __rsnd_dma_start(struct rsnd_dma *dma)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(rsnd_dma_to_mod(dma));
++ struct rsnd_mod *mod = rsnd_dma_to_mod(dma);
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct dma_async_tx_descriptor *desc;
+ dma_addr_t buf;
+- size_t len;
++ size_t len = io->byte_per_period;
+ int i;
+
+ for (i = 0; i < dma->submit_loop; i++) {
+
+- if (dma->inquiry(dma, &buf, &len) < 0)
+- return;
++ buf = runtime->dma_addr +
++ rsnd_dai_pointer_offset(io, dma->offset + len);
++ dma->offset = len;
+
+ desc = dmaengine_prep_slave_single(
+ dma->chan, buf, len, dma->dir,
+@@ -217,10 +236,7 @@ int rsnd_dma_available(struct rsnd_dma *dma)
+ }
+
+ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
+- int is_play, int id,
+- int (*inquiry)(struct rsnd_dma *dma,
+- dma_addr_t *buf, int *len),
+- int (*complete)(struct rsnd_dma *dma))
++ int is_play, int id)
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct dma_slave_config cfg;
+@@ -253,8 +269,6 @@ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
+ goto rsnd_dma_init_err;
+
+ dma->dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
+- dma->inquiry = inquiry;
+- dma->complete = complete;
+ INIT_WORK(&dma->work, rsnd_dma_do_work);
+
+ return 0;
+@@ -307,6 +321,7 @@ int rsnd_dai_connect(struct rsnd_dai *rdai,
+ }
+
+ list_add_tail(&mod->list, &io->head);
++ mod->io = io;
+
+ return 0;
+ }
+@@ -314,6 +329,7 @@ int rsnd_dai_connect(struct rsnd_dai *rdai,
+ int rsnd_dai_disconnect(struct rsnd_mod *mod)
+ {
+ list_del_init(&mod->list);
++ mod->io = NULL;
+
+ return 0;
+ }
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index c397dc8edee5..b2c717d2ba7e 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -100,19 +100,16 @@ struct rsnd_dma {
+ struct work_struct work;
+ struct dma_chan *chan;
+ enum dma_data_direction dir;
+- int (*inquiry)(struct rsnd_dma *dma, dma_addr_t *buf, int *len);
+- int (*complete)(struct rsnd_dma *dma);
+
+ int submit_loop;
++ int offset; /* it cares A/B plane */
+ };
+
+ void rsnd_dma_start(struct rsnd_dma *dma);
+ void rsnd_dma_stop(struct rsnd_dma *dma);
+ int rsnd_dma_available(struct rsnd_dma *dma);
+ int rsnd_dma_init(struct rsnd_priv *priv, struct rsnd_dma *dma,
+- int is_play, int id,
+- int (*inquiry)(struct rsnd_dma *dma, dma_addr_t *buf, int *len),
+- int (*complete)(struct rsnd_dma *dma));
++ int is_play, int id);
+ void rsnd_dma_quit(struct rsnd_priv *priv,
+ struct rsnd_dma *dma);
+
+@@ -137,17 +134,20 @@ struct rsnd_mod_ops {
+ struct rsnd_dai_stream *io);
+ };
+
++struct rsnd_dai_stream;
+ struct rsnd_mod {
+ int id;
+ struct rsnd_priv *priv;
+ struct rsnd_mod_ops *ops;
+ struct list_head list; /* connect to rsnd_dai playback/capture */
+ struct rsnd_dma dma;
++ struct rsnd_dai_stream *io;
+ };
+
+ #define rsnd_mod_to_priv(mod) ((mod)->priv)
+ #define rsnd_mod_to_dma(mod) (&(mod)->dma)
+ #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma)
++#define rsnd_mod_to_io(mod) ((mod)->io)
+ #define rsnd_mod_id(mod) ((mod)->id)
+ #define for_each_rsnd_mod(pos, n, io) \
+ list_for_each_entry_safe(pos, n, &(io)->head, list)
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index b7f464ebcdc0..d3371d798d54 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -64,12 +64,10 @@ struct rsnd_ssi {
+ struct rsnd_mod mod;
+
+ struct rsnd_dai *rdai;
+- struct rsnd_dai_stream *io;
+ u32 cr_own;
+ u32 cr_clk;
+ u32 cr_etc;
+ int err;
+- int dma_offset;
+ unsigned int usrcnt;
+ unsigned int rate;
+ };
+@@ -286,7 +284,6 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ * set ssi parameter
+ */
+ ssi->rdai = rdai;
+- ssi->io = io;
+ ssi->cr_own = cr;
+ ssi->err = -1; /* ignore 1st error */
+
+@@ -305,7 +302,6 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
+ dev_warn(dev, "ssi under/over flow err = %d\n", ssi->err);
+
+ ssi->rdai = NULL;
+- ssi->io = NULL;
+ ssi->cr_own = 0;
+ ssi->err = 0;
+
+@@ -329,8 +325,9 @@ static void rsnd_ssi_record_error(struct rsnd_ssi *ssi, u32 status)
+ static irqreturn_t rsnd_ssi_pio_interrupt(int irq, void *data)
+ {
+ struct rsnd_ssi *ssi = data;
+- struct rsnd_dai_stream *io = ssi->io;
+- u32 status = rsnd_mod_read(&ssi->mod, SSISR);
++ struct rsnd_mod *mod = &ssi->mod;
++ struct rsnd_dai_stream *io = rsnd_mod_to_io(mod);
++ u32 status = rsnd_mod_read(mod, SSISR);
+ irqreturn_t ret = IRQ_NONE;
+
+ if (io && (status & DIRQ)) {
+@@ -347,9 +344,9 @@ static irqreturn_t rsnd_ssi_pio_interrupt(int irq, void *data)
+ * see rsnd_ssi_init()
+ */
+ if (rsnd_dai_is_play(rdai, io))
+- rsnd_mod_write(&ssi->mod, SSITDR, *buf);
++ rsnd_mod_write(mod, SSITDR, *buf);
+ else
+- *buf = rsnd_mod_read(&ssi->mod, SSIRDR);
++ *buf = rsnd_mod_read(mod, SSIRDR);
+
+ rsnd_dai_pointer_update(io, sizeof(*buf));
+
+@@ -394,33 +391,6 @@ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
+ .stop = rsnd_ssi_pio_stop,
+ };
+
+-static int rsnd_ssi_dma_inquiry(struct rsnd_dma *dma, dma_addr_t *buf, int *len)
+-{
+- struct rsnd_ssi *ssi = rsnd_dma_to_ssi(dma);
+- struct rsnd_dai_stream *io = ssi->io;
+- struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+-
+- *len = io->byte_per_period;
+- *buf = runtime->dma_addr +
+- rsnd_dai_pointer_offset(io, ssi->dma_offset + *len);
+- ssi->dma_offset = *len; /* it cares A/B plane */
+-
+- return 0;
+-}
+-
+-static int rsnd_ssi_dma_complete(struct rsnd_dma *dma)
+-{
+- struct rsnd_ssi *ssi = rsnd_dma_to_ssi(dma);
+- struct rsnd_dai_stream *io = ssi->io;
+- u32 status = rsnd_mod_read(&ssi->mod, SSISR);
+-
+- rsnd_ssi_record_error(ssi, status);
+-
+- rsnd_dai_pointer_update(ssi->io, io->byte_per_period);
+-
+- return 0;
+-}
+-
+ static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -430,7 +400,6 @@ static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
+
+ /* enable DMA transfer */
+ ssi->cr_etc = DMEN;
+- ssi->dma_offset = 0;
+
+ rsnd_dma_start(dma);
+
+@@ -452,6 +421,8 @@ static int rsnd_ssi_dma_stop(struct rsnd_mod *mod,
+
+ ssi->cr_etc = 0;
+
++ rsnd_ssi_record_error(ssi, rsnd_mod_read(mod, SSISR));
++
+ rsnd_ssi_hw_stop(ssi, rdai);
+
+ rsnd_dma_stop(dma);
+@@ -585,9 +556,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ ret = rsnd_dma_init(
+ priv, rsnd_mod_to_dma(&ssi->mod),
+ rsnd_ssi_is_play(&ssi->mod),
+- pinfo->dma_id,
+- rsnd_ssi_dma_inquiry,
+- rsnd_ssi_dma_complete);
++ pinfo->dma_id);
+ if (ret < 0)
+ dev_info(dev, "SSI DMA failed. try PIO transter\n");
+ else
+--
+2.1.2
+
diff --git a/patches.renesas/0042-ASoC-rsnd-rsnd_ssi_probe-goes-forwarder-than-rsnd_sc.patch b/patches.renesas/0042-ASoC-rsnd-rsnd_ssi_probe-goes-forwarder-than-rsnd_sc.patch
new file mode 100644
index 00000000000000..b9382376a7dd8d
--- /dev/null
+++ b/patches.renesas/0042-ASoC-rsnd-rsnd_ssi_probe-goes-forwarder-than-rsnd_sc.patch
@@ -0,0 +1,42 @@
+From c1d504912fbbe920023441b77ef2f642db387e9a Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:41:51 -0800
+Subject: ASoC: rsnd: rsnd_ssi_probe() goes forwarder than rsnd_scu_probe()
+
+rsnd_ssi_probe() goes forwarder than rsnd_scu_probe(),
+since scu will need ssi information on Gen2
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit eb854f6dff24a59378acc8d8eda57a3543a25acc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index b5af6f5145ea..f316a663e4d3 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -763,15 +763,15 @@ static int rsnd_probe(struct platform_device *pdev)
+ if (ret)
+ return ret;
+
+- ret = rsnd_scu_probe(pdev, info, priv);
++ ret = rsnd_ssi_probe(pdev, info, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_adg_probe(pdev, info, priv);
++ ret = rsnd_scu_probe(pdev, info, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_ssi_probe(pdev, info, priv);
++ ret = rsnd_adg_probe(pdev, info, priv);
+ if (ret)
+ return ret;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0043-ASoC-rsnd-add-Gen2-SRC-and-DMAEngine-support.patch b/patches.renesas/0043-ASoC-rsnd-add-Gen2-SRC-and-DMAEngine-support.patch
new file mode 100644
index 00000000000000..7d662d2e833756
--- /dev/null
+++ b/patches.renesas/0043-ASoC-rsnd-add-Gen2-SRC-and-DMAEngine-support.patch
@@ -0,0 +1,447 @@
+From 64f5ba8a014816f325db53d7ce02ee2027f659bb Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 23 Jan 2014 18:42:00 -0800
+Subject: ASoC: rsnd: add Gen2 SRC and DMAEngine support
+
+Renesas sound Gen2 has SRC (= Sampling Rate Converter)
+which needs 2 DMAC.
+The data path image when you use SRC on Gen2 is
+
+[mem] -> Audio-DMAC -> SRC -> Audio-DMAC-peri-peri -> SSIU -> SSI
+
+This patch support SRC and DMAEnine.
+It is tested on R-Car H2 Lager board
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 629509c5bc478c0343d94c8c70812396f44447fb)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 6 +++
+ sound/soc/sh/rcar/adg.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++
+ sound/soc/sh/rcar/gen.c | 26 +++++++++
+ sound/soc/sh/rcar/rsnd.h | 25 +++++++++
+ sound/soc/sh/rcar/scu.c | 117 ++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 312 insertions(+)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index 1d19bfc2486d..2be05aea54f9 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -56,9 +56,15 @@ struct rsnd_ssi_platform_info {
+ */
+ #define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
+
++#define RSND_SCU_SET(rate, _dma_id) \
++ { .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
++#define RSND_SCU_UNUSED \
++ { .flags = 0, .convert_rate = 0, .dma_id = 0, }
++
+ struct rsnd_scu_platform_info {
+ u32 flags;
+ u32 convert_rate; /* sampling rate convert */
++ int dma_id; /* for Gen2 SCU */
+ };
+
+ /*
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 5bdffa480245..821791e15d04 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -30,6 +30,144 @@ struct rsnd_adg {
+ i++, (pos) = adg->clk[i])
+ #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg)
+
++
++static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_mod *mod)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ int id = rsnd_mod_id(mod);
++ int ws = id;
++
++ if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) {
++ switch (id) {
++ case 1:
++ case 2:
++ ws = 0;
++ break;
++ case 4:
++ ws = 3;
++ break;
++ case 8:
++ ws = 7;
++ break;
++ }
++ }
++
++ return (0x6 + ws) << 8;
++}
++
++static int rsnd_adg_set_src_timsel_gen2(struct rsnd_dai *rdai,
++ struct rsnd_mod *mod,
++ struct rsnd_dai_stream *io,
++ u32 timsel)
++{
++ int is_play = rsnd_dai_is_play(rdai, io);
++ int id = rsnd_mod_id(mod);
++ int shift = (id % 2) ? 16 : 0;
++ u32 mask, ws;
++ u32 in, out;
++
++ ws = rsnd_adg_ssi_ws_timing_gen2(mod);
++
++ in = (is_play) ? timsel : ws;
++ out = (is_play) ? ws : timsel;
++
++ in = in << shift;
++ out = out << shift;
++ mask = 0xffff << shift;
++
++ switch (id / 2) {
++ case 0:
++ rsnd_mod_bset(mod, SRCIN_TIMSEL0, mask, in);
++ rsnd_mod_bset(mod, SRCOUT_TIMSEL0, mask, out);
++ break;
++ case 1:
++ rsnd_mod_bset(mod, SRCIN_TIMSEL1, mask, in);
++ rsnd_mod_bset(mod, SRCOUT_TIMSEL1, mask, out);
++ break;
++ case 2:
++ rsnd_mod_bset(mod, SRCIN_TIMSEL2, mask, in);
++ rsnd_mod_bset(mod, SRCOUT_TIMSEL2, mask, out);
++ break;
++ case 3:
++ rsnd_mod_bset(mod, SRCIN_TIMSEL3, mask, in);
++ rsnd_mod_bset(mod, SRCOUT_TIMSEL3, mask, out);
++ break;
++ case 4:
++ rsnd_mod_bset(mod, SRCIN_TIMSEL4, mask, in);
++ rsnd_mod_bset(mod, SRCOUT_TIMSEL4, mask, out);
++ break;
++ }
++
++ return 0;
++}
++
++int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io,
++ unsigned int src_rate,
++ unsigned int dst_rate)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
++ struct device *dev = rsnd_priv_to_dev(priv);
++ int idx, sel, div, step;
++ u32 val;
++ unsigned int min, diff;
++ unsigned int sel_rate [] = {
++ clk_get_rate(adg->clk[CLKA]), /* 0000: CLKA */
++ clk_get_rate(adg->clk[CLKB]), /* 0001: CLKB */
++ clk_get_rate(adg->clk[CLKC]), /* 0010: CLKC */
++ adg->rbga_rate_for_441khz_div_6,/* 0011: RBGA */
++ adg->rbgb_rate_for_48khz_div_6, /* 0100: RBGB */
++ };
++
++ min = ~0;
++ val = 0;
++ for (sel = 0; sel < ARRAY_SIZE(sel_rate); sel++) {
++ idx = 0;
++ step = 2;
++
++ if (!sel_rate[sel])
++ continue;
++
++ for (div = 2; div <= 98304; div += step) {
++ diff = abs(src_rate - sel_rate[sel] / div);
++ if (min > diff) {
++ val = (sel << 8) | idx;
++ min = diff;
++ }
++
++ /*
++ * step of 0_0000 / 0_0001 / 0_1101
++ * are out of order
++ */
++ if ((idx > 2) && (idx % 2))
++ step *= 2;
++ if (idx == 0x1c) {
++ div += step;
++ step *= 2;
++ }
++ idx++;
++ }
++ }
++
++ if (min == ~0) {
++ dev_err(dev, "no Input clock\n");
++ return -EIO;
++ }
++
++ return rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val);
++}
++
++int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ u32 val = rsnd_adg_ssi_ws_timing_gen2(mod);
++
++ return rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val);
++}
++
+ int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ unsigned int src_rate,
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index db486aae6b8b..3e03a8bc4f75 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -229,14 +229,40 @@ static int rsnd_gen2_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ RSND_GEN2_S_REG(gen, SSIU, SSI_MODE0, 0x800),
+ RSND_GEN2_S_REG(gen, SSIU, SSI_MODE1, 0x804),
+ /* FIXME: it needs SSI_MODE2/3 in the future */
++ RSND_GEN2_S_REG(gen, SSIU, SSI_CONTROL, 0x810),
++ RSND_GEN2_M_REG(gen, SSIU, SSI_BUSIF_MODE, 0x0, 0x80),
++ RSND_GEN2_M_REG(gen, SSIU, SSI_BUSIF_ADINR,0x4, 0x80),
++ RSND_GEN2_M_REG(gen, SSIU, SSI_CTRL, 0x10, 0x80),
+ RSND_GEN2_M_REG(gen, SSIU, INT_ENABLE, 0x18, 0x80),
+
++ RSND_GEN2_M_REG(gen, SCU, SRC_BUSIF_MODE, 0x0, 0x20),
++ RSND_GEN2_M_REG(gen, SCU, SRC_ROUTE_MODE0,0xc, 0x20),
++ RSND_GEN2_M_REG(gen, SCU, SRC_CTRL, 0x10, 0x20),
++ RSND_GEN2_M_REG(gen, SCU, SRC_SWRSR, 0x200, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_SRCIR, 0x204, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_ADINR, 0x214, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_IFSCR, 0x21c, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_IFSVR, 0x220, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_SRCCR, 0x224, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_BSDSR, 0x22c, 0x40),
++ RSND_GEN2_M_REG(gen, SCU, SRC_BSISR, 0x238, 0x40),
++
+ RSND_GEN2_S_REG(gen, ADG, BRRA, 0x00),
+ RSND_GEN2_S_REG(gen, ADG, BRRB, 0x04),
+ RSND_GEN2_S_REG(gen, ADG, SSICKR, 0x08),
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL0, 0x0c),
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL1, 0x10),
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL2, 0x14),
++ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL0, 0x34),
++ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL1, 0x38),
++ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL2, 0x3c),
++ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL3, 0x40),
++ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL4, 0x44),
++ RSND_GEN2_S_REG(gen, ADG, SRCOUT_TIMSEL0, 0x48),
++ RSND_GEN2_S_REG(gen, ADG, SRCOUT_TIMSEL1, 0x4c),
++ RSND_GEN2_S_REG(gen, ADG, SRCOUT_TIMSEL2, 0x50),
++ RSND_GEN2_S_REG(gen, ADG, SRCOUT_TIMSEL3, 0x54),
++ RSND_GEN2_S_REG(gen, ADG, SRCOUT_TIMSEL4, 0x58),
+
+ RSND_GEN2_M_REG(gen, SSI, SSICR, 0x00, 0x40),
+ RSND_GEN2_M_REG(gen, SSI, SSISR, 0x04, 0x40),
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index b2c717d2ba7e..8b66dc15fa73 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -37,6 +37,11 @@ enum rsnd_reg {
+ RSND_REG_SRC_TMG_SEL1, /* for Gen1 */
+ RSND_REG_SRC_TMG_SEL2, /* for Gen1 */
+ RSND_REG_SRC_ROUTE_CTRL, /* for Gen1 */
++ RSND_REG_SRC_CTRL, /* for Gen2 */
++ RSND_REG_SSI_CTRL, /* for Gen2 */
++ RSND_REG_SSI_CONTROL,
++ RSND_REG_SSI_BUSIF_MODE, /* for Gen2 */
++ RSND_REG_SSI_BUSIF_ADINR, /* for Gen2 */
+ RSND_REG_SSI_MODE0,
+ RSND_REG_SSI_MODE1,
+ RSND_REG_INT_ENABLE, /* for Gen2 */
+@@ -49,6 +54,8 @@ enum rsnd_reg {
+ RSND_REG_SRC_IFSVR,
+ RSND_REG_SRC_SRCCR,
+ RSND_REG_SRC_MNFSR, /* for Gen1 */
++ RSND_REG_SRC_BSDSR, /* for Gen2 */
++ RSND_REG_SRC_BSISR, /* for Gen2 */
+
+ /* ADG */
+ RSND_REG_BRRA,
+@@ -60,6 +67,16 @@ enum rsnd_reg {
+ RSND_REG_AUDIO_CLK_SEL3, /* for Gen1 */
+ RSND_REG_AUDIO_CLK_SEL4, /* for Gen1 */
+ RSND_REG_AUDIO_CLK_SEL5, /* for Gen1 */
++ RSND_REG_SRCIN_TIMSEL0, /* for Gen2 */
++ RSND_REG_SRCIN_TIMSEL1, /* for Gen2 */
++ RSND_REG_SRCIN_TIMSEL2, /* for Gen2 */
++ RSND_REG_SRCIN_TIMSEL3, /* for Gen2 */
++ RSND_REG_SRCIN_TIMSEL4, /* for Gen2 */
++ RSND_REG_SRCOUT_TIMSEL0, /* for Gen2 */
++ RSND_REG_SRCOUT_TIMSEL1, /* for Gen2 */
++ RSND_REG_SRCOUT_TIMSEL2, /* for Gen2 */
++ RSND_REG_SRCOUT_TIMSEL3, /* for Gen2 */
++ RSND_REG_SRCOUT_TIMSEL4, /* for Gen2 */
+
+ /* SSI */
+ RSND_REG_SSICR,
+@@ -250,6 +267,14 @@ int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ unsigned int src_rate,
+ unsigned int dst_rate);
++int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io,
++ unsigned int src_rate,
++ unsigned int dst_rate);
++int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io);
+
+ /*
+ * R-Car sound priv
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 29d8990e3f0f..6e5c763e1040 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -33,6 +33,8 @@ struct rsnd_scu {
+ container_of((_mod), struct rsnd_scu, mod)
+ #define rsnd_scu_hpbif_is_enable(scu) \
+ (rsnd_scu_mode_flags(scu) & RSND_SCU_USE_HPBIF)
++#define rsnd_scu_dma_available(scu) \
++ rsnd_dma_available(rsnd_mod_to_dma(&(scu)->mod))
+
+ #define for_each_rsnd_scu(pos, priv, i) \
+ for ((i) = 0; \
+@@ -472,6 +474,103 @@ static struct rsnd_mod_ops rsnd_scu_non_gen1_ops = {
+ /*
+ * Gen2 functions
+ */
++static int rsnd_scu_set_convert_rate_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ int ret;
++
++ ret = rsnd_scu_set_convert_rate(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
++ rsnd_mod_write(mod, SSI_BUSIF_ADINR, rsnd_mod_read(mod, SRC_ADINR));
++ rsnd_mod_write(mod, SSI_BUSIF_MODE, rsnd_mod_read(mod, SRC_BUSIF_MODE));
++
++ rsnd_mod_write(mod, SRC_SRCCR, 0x00011110);
++
++ rsnd_mod_write(mod, SRC_BSDSR, 0x01800000);
++ rsnd_mod_write(mod, SRC_BSISR, 0x00100060);
++
++ return 0;
++}
++
++static int rsnd_scu_set_convert_timing_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ u32 convert_rate = rsnd_scu_convert_rate(scu);
++ int ret;
++
++ if (convert_rate)
++ ret = rsnd_adg_set_convert_clk_gen2(mod, rdai, io,
++ runtime->rate,
++ convert_rate);
++ else
++ ret = rsnd_adg_set_convert_timing_gen2(mod, rdai, io);
++
++ return ret;
++}
++
++static int rsnd_scu_init_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ int ret;
++
++ ret = rsnd_scu_init(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
++ ret = rsnd_scu_set_convert_rate_gen2(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
++ ret = rsnd_scu_set_convert_timing_gen2(mod, rdai, io);
++ if (ret < 0)
++ return ret;
++
++ return 0;
++}
++
++static int rsnd_scu_start_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ rsnd_dma_start(rsnd_mod_to_dma(&scu->mod));
++
++ rsnd_mod_write(mod, SSI_CTRL, 0x1);
++ rsnd_mod_write(mod, SRC_CTRL, 0x11);
++
++ return rsnd_scu_start(mod, rdai, io);
++}
++
++static int rsnd_scu_stop_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++
++ rsnd_mod_write(mod, SSI_CTRL, 0);
++ rsnd_mod_write(mod, SRC_CTRL, 0);
++
++ rsnd_dma_stop(rsnd_mod_to_dma(&scu->mod));
++
++ return rsnd_scu_stop(mod, rdai, io);
++}
++
++static struct rsnd_mod_ops rsnd_scu_gen2_ops = {
++ .name = "scu (gen2)",
++ .init = rsnd_scu_init_gen2,
++ .quit = rsnd_scu_quit,
++ .start = rsnd_scu_start_gen2,
++ .stop = rsnd_scu_stop_gen2,
++};
++
+ static int rsnd_scu_start_non_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -534,6 +633,17 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ if (rsnd_scu_hpbif_is_enable(scu)) {
+ if (rsnd_is_gen1(priv))
+ ops = &rsnd_scu_gen1_ops;
++ if (rsnd_is_gen2(priv)) {
++ struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, i);
++ int ret = rsnd_dma_init(priv,
++ rsnd_mod_to_dma(&scu->mod),
++ rsnd_ssi_is_play(ssi),
++ scu->info->dma_id);
++ if (ret < 0)
++ return ret;
++
++ ops = &rsnd_scu_gen2_ops;
++ }
+ } else {
+ if (rsnd_is_gen1(priv))
+ ops = &rsnd_scu_non_gen1_ops;
+@@ -553,4 +663,11 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ void rsnd_scu_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
++ struct rsnd_scu *scu;
++ int i;
++
++ for_each_rsnd_scu(scu, priv, i) {
++ if (rsnd_scu_dma_available(scu))
++ rsnd_dma_quit(priv, rsnd_mod_to_dma(&scu->mod));
++ }
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0044-ASoC-rsnd-use-device-dependency-clock.patch b/patches.renesas/0044-ASoC-rsnd-use-device-dependency-clock.patch
new file mode 100644
index 00000000000000..6e4b622c92c056
--- /dev/null
+++ b/patches.renesas/0044-ASoC-rsnd-use-device-dependency-clock.patch
@@ -0,0 +1,84 @@
+From 44d86b464a7e968b01df91eb8acc37167db5c415 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Fri, 7 Feb 2014 00:53:06 -0800
+Subject: ASoC: rsnd: use device dependency clock
+
+Current R-Car sound driver is using device
+independent audio clock, but it is not good
+design for DT support.
+This patch adds device dependent clock support.
+But, there are some platform which is using
+independent audio clock.
+It is still supported at this point,
+but it will be removed soon.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 8691d0748e566f8708f7a9139e760134f5dc3130)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 40 +++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 35 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 821791e15d04..8d3a82ef2db5 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -385,8 +385,9 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ {
+ struct rsnd_adg *adg;
+ struct device *dev = rsnd_priv_to_dev(priv);
+- struct clk *clk;
++ struct clk *clk, *clk_orig;
+ int i;
++ bool use_old_style = false;
+
+ adg = devm_kzalloc(dev, sizeof(*adg), GFP_KERNEL);
+ if (!adg) {
+@@ -394,10 +395,39 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ return -ENOMEM;
+ }
+
+- adg->clk[CLKA] = clk_get(NULL, "audio_clk_a");
+- adg->clk[CLKB] = clk_get(NULL, "audio_clk_b");
+- adg->clk[CLKC] = clk_get(NULL, "audio_clk_c");
+- adg->clk[CLKI] = clk_get(NULL, "audio_clk_internal");
++ clk_orig = clk_get(dev, NULL);
++ adg->clk[CLKA] = clk_get(dev, "clk_a");
++ adg->clk[CLKB] = clk_get(dev, "clk_b");
++ adg->clk[CLKC] = clk_get(dev, "clk_c");
++ adg->clk[CLKI] = clk_get(dev, "clk_i");
++
++ /*
++ * It request device dependent audio clock.
++ * But above all clks will indicate rsnd module clock
++ * if platform doesn't it
++ */
++ for_each_rsnd_clk(clk, adg, i) {
++ if (clk_orig == clk) {
++ dev_warn(dev,
++ "doesn't have device dependent clock, use independent clock\n");
++ use_old_style = true;
++ break;
++ }
++ }
++
++ /*
++ * note:
++ * these exist in order to keep compatible with
++ * platform which has device independent audio clock,
++ * but will be removed soon
++ */
++ if (use_old_style) {
++ adg->clk[CLKA] = clk_get(NULL, "audio_clk_a");
++ adg->clk[CLKB] = clk_get(NULL, "audio_clk_b");
++ adg->clk[CLKC] = clk_get(NULL, "audio_clk_c");
++ adg->clk[CLKI] = clk_get(NULL, "audio_clk_internal");
++ }
++
+ for_each_rsnd_clk(clk, adg, i) {
+ if (IS_ERR(clk)) {
+ dev_err(dev, "Audio clock failed\n");
+--
+2.1.2
+
diff --git a/patches.renesas/0045-ASoC-rsnd-tidyup-original-for_each_rsnd_xxx-macro.patch b/patches.renesas/0045-ASoC-rsnd-tidyup-original-for_each_rsnd_xxx-macro.patch
new file mode 100644
index 00000000000000..5d3a7fe1cb3d2b
--- /dev/null
+++ b/patches.renesas/0045-ASoC-rsnd-tidyup-original-for_each_rsnd_xxx-macro.patch
@@ -0,0 +1,59 @@
+From 369b362f76d6abaabaaceea53891c2cadd1c54f6 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 17:15:51 -0800
+Subject: ASoC: rsnd: tidyup original for_each_rsnd_xxx macro
+
+Current for_each_rsnd_xxx macro will read out-of-array's
+memory after last loop operation.
+It was not good C language operation, and the binary which was
+compiled by (at least) gcc 4.8.1 is broken
+This patch tidyup these issues
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 00463c113b6ba6506b4f1ebb9b3c5dd249f8750f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 7 ++++---
+ sound/soc/sh/rcar/rsnd.h | 7 ++++---
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 8d3a82ef2db5..bc8961c5e986 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -25,9 +25,10 @@ struct rsnd_adg {
+ };
+
+ #define for_each_rsnd_clk(pos, adg, i) \
+- for (i = 0, (pos) = adg->clk[i]; \
+- i < CLKMAX; \
+- i++, (pos) = adg->clk[i])
++ for (i = 0; \
++ (i < CLKMAX) && \
++ ((pos) = adg->clk[i]); \
++ i++)
+ #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg)
+
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 8b66dc15fa73..9e4efb40416b 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -216,9 +216,10 @@ struct rsnd_dai {
+
+ #define rsnd_dai_nr(priv) ((priv)->dai_nr)
+ #define for_each_rsnd_dai(rdai, priv, i) \
+- for (i = 0, (rdai) = rsnd_dai_get(priv, i); \
+- i < rsnd_dai_nr(priv); \
+- i++, (rdai) = rsnd_dai_get(priv, i))
++ for (i = 0; \
++ (i < rsnd_dai_nr(priv)) && \
++ ((rdai) = rsnd_dai_get(priv, i)); \
++ i++)
+
+ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id);
+ int rsnd_dai_disconnect(struct rsnd_mod *mod);
+--
+2.1.2
+
diff --git a/patches.renesas/0046-ASoC-rsnd-set-DIV_EN-register-on-rsnd_adg_set_conver.patch b/patches.renesas/0046-ASoC-rsnd-set-DIV_EN-register-on-rsnd_adg_set_conver.patch
new file mode 100644
index 00000000000000..49f6301e2d7b7a
--- /dev/null
+++ b/patches.renesas/0046-ASoC-rsnd-set-DIV_EN-register-on-rsnd_adg_set_conver.patch
@@ -0,0 +1,92 @@
+From 54b69d3a68d075a6ffd180d9396580fa8e9802e8 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 21:04:12 -0800
+Subject: ASoC: rsnd: set DIV_EN register on rsnd_adg_set_convert_clk_gen2()
+
+DIV_EN register enable bit is required when you use Gen2 SRC
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ee2c828d21b2381c813df257235d3c635269e435)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 16 +++++++++++++---
+ sound/soc/sh/rcar/gen.c | 1 +
+ sound/soc/sh/rcar/rsnd.h | 1 +
+ 3 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index bc8961c5e986..af9e4407aa89 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -111,8 +111,8 @@ int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_adg *adg = rsnd_priv_to_adg(priv);
+ struct device *dev = rsnd_priv_to_dev(priv);
+- int idx, sel, div, step;
+- u32 val;
++ int idx, sel, div, step, ret;
++ u32 val, en;
+ unsigned int min, diff;
+ unsigned int sel_rate [] = {
+ clk_get_rate(adg->clk[CLKA]), /* 0000: CLKA */
+@@ -124,6 +124,7 @@ int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
+
+ min = ~0;
+ val = 0;
++ en = 0;
+ for (sel = 0; sel < ARRAY_SIZE(sel_rate); sel++) {
+ idx = 0;
+ step = 2;
+@@ -136,6 +137,7 @@ int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
+ if (min > diff) {
+ val = (sel << 8) | idx;
+ min = diff;
++ en = 1 << (sel + 1); /* fixme */
+ }
+
+ /*
+@@ -157,7 +159,15 @@ int rsnd_adg_set_convert_clk_gen2(struct rsnd_mod *mod,
+ return -EIO;
+ }
+
+- return rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val);
++ ret = rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val);
++ if (ret < 0) {
++ dev_err(dev, "timsel error\n");
++ return ret;
++ }
++
++ rsnd_mod_bset(mod, DIV_EN, en, en);
++
++ return 0;
+ }
+
+ int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 3e03a8bc4f75..0a43b906ffdf 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -253,6 +253,7 @@ static int rsnd_gen2_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL0, 0x0c),
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL1, 0x10),
+ RSND_GEN2_S_REG(gen, ADG, AUDIO_CLK_SEL2, 0x14),
++ RSND_GEN2_S_REG(gen, ADG, DIV_EN, 0x30),
+ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL0, 0x34),
+ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL1, 0x38),
+ RSND_GEN2_S_REG(gen, ADG, SRCIN_TIMSEL2, 0x3c),
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 9e4efb40416b..d4093907dfd8 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -67,6 +67,7 @@ enum rsnd_reg {
+ RSND_REG_AUDIO_CLK_SEL3, /* for Gen1 */
+ RSND_REG_AUDIO_CLK_SEL4, /* for Gen1 */
+ RSND_REG_AUDIO_CLK_SEL5, /* for Gen1 */
++ RSND_REG_DIV_EN, /* for Gen2 */
+ RSND_REG_SRCIN_TIMSEL0, /* for Gen2 */
+ RSND_REG_SRCIN_TIMSEL1, /* for Gen2 */
+ RSND_REG_SRCIN_TIMSEL2, /* for Gen2 */
+--
+2.1.2
+
diff --git a/patches.renesas/0047-ASoC-rsnd-print-error-if-there-is-SRC-settings-misma.patch b/patches.renesas/0047-ASoC-rsnd-print-error-if-there-is-SRC-settings-misma.patch
new file mode 100644
index 00000000000000..91c2a3d37d69d8
--- /dev/null
+++ b/patches.renesas/0047-ASoC-rsnd-print-error-if-there-is-SRC-settings-misma.patch
@@ -0,0 +1,37 @@
+From 9b49d8d751219bfc78c1d5b54daddaa49a7dcef7 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 21:05:26 -0800
+Subject: ASoC: rsnd: print error if there is SRC settings mismatch
+
+rsnd request clock master if SRC is used
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit a2070feede404484296aace813b6c518582a3f8e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 6e5c763e1040..3984d4b4f2df 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -122,6 +122,14 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+ int id = rsnd_mod_id(mod);
++ u32 convert_rate = rsnd_scu_convert_rate(scu);
++
++ if (convert_rate && !rsnd_dai_is_clk_master(rdai)) {
++ struct device *dev = rsnd_priv_to_dev(priv);
++
++ dev_err(dev, "rsnd should be clk master when you rate convert\n");
++ return -EINVAL;
++ }
+
+ /*
+ * SSI_MODE0
+--
+2.1.2
+
diff --git a/patches.renesas/0048-ASoC-rsnd-move-priv-member-settings-to-upper-side.patch b/patches.renesas/0048-ASoC-rsnd-move-priv-member-settings-to-upper-side.patch
new file mode 100644
index 00000000000000..5a5fad3dbfaf40
--- /dev/null
+++ b/patches.renesas/0048-ASoC-rsnd-move-priv-member-settings-to-upper-side.patch
@@ -0,0 +1,44 @@
+From 26e0e909a5dca7e742f06748331c5846dd049c84 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:14:33 -0800
+Subject: ASoC: rsnd: move priv member settings to upper side
+
+There is no big meaning, but preparation for platform dai support
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 498480731e232d7c9a96a338924b5a275121e091)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index f316a663e4d3..a8e6aa6cb334 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -594,6 +594,10 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ return -ENOMEM;
+ }
+
++ priv->dai_nr = dai_nr;
++ priv->daidrv = drv;
++ priv->rdai = rdai;
++
+ for (i = 0; i < dai_nr; i++) {
+
+ pmod = rsnd_ssi_mod_get_frm_dai(priv, i, 1);
+@@ -630,10 +634,6 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ cmod ? "capture" : " -- ");
+ }
+
+- priv->dai_nr = dai_nr;
+- priv->daidrv = drv;
+- priv->rdai = rdai;
+-
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0049-ASoC-rsnd-move-rsnd_mod_call-macro.patch b/patches.renesas/0049-ASoC-rsnd-move-rsnd_mod_call-macro.patch
new file mode 100644
index 00000000000000..664418ce7d58b1
--- /dev/null
+++ b/patches.renesas/0049-ASoC-rsnd-move-rsnd_mod_call-macro.patch
@@ -0,0 +1,89 @@
+From 71f1f9e46eaa394c736493fd43fe6dd90b2b004a Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:14:41 -0800
+Subject: ASoC: rsnd: move rsnd_mod_call() macro
+
+core.c is the only user of rsnd_mod_call() macro.
+Move it to core.c from rsnd.h
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit d870a91e9d0eae524ac2da7cbdc7e399a71b86c4)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 34 ++++++++++++++++++++++++----------
+ sound/soc/sh/rcar/rsnd.h | 13 -------------
+ 2 files changed, 24 insertions(+), 23 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index a8e6aa6cb334..5f6d9fef23d1 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -291,16 +291,30 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+ /*
+ * rsnd_dai functions
+ */
+-#define rsnd_dai_call(rdai, io, fn) \
+-({ \
+- struct rsnd_mod *mod, *n; \
+- int ret = 0; \
+- for_each_rsnd_mod(mod, n, io) { \
+- ret = rsnd_mod_call(mod, fn, rdai, io); \
+- if (ret < 0) \
+- break; \
+- } \
+- ret; \
++#define __rsnd_mod_call(mod, func, rdai, io) \
++({ \
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
++ struct device *dev = rsnd_priv_to_dev(priv); \
++ dev_dbg(dev, "%s [%d] %s\n", \
++ rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
++ (mod)->ops->func(mod, rdai, io); \
++})
++
++#define rsnd_mod_call(mod, func, rdai, io) \
++ (!(mod) ? -ENODEV : \
++ !((mod)->ops->func) ? 0 : \
++ __rsnd_mod_call(mod, func, (rdai), (io)))
++
++#define rsnd_dai_call(rdai, io, fn) \
++({ \
++ struct rsnd_mod *mod, *n; \
++ int ret = 0; \
++ for_each_rsnd_mod(mod, n, (io)) { \
++ ret = rsnd_mod_call(mod, fn, (rdai), (io)); \
++ if (ret < 0) \
++ break; \
++ } \
++ ret; \
+ })
+
+ int rsnd_dai_connect(struct rsnd_dai *rdai,
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index d4093907dfd8..fb1e0cee08b6 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -169,19 +169,6 @@ struct rsnd_mod {
+ #define rsnd_mod_id(mod) ((mod)->id)
+ #define for_each_rsnd_mod(pos, n, io) \
+ list_for_each_entry_safe(pos, n, &(io)->head, list)
+-#define __rsnd_mod_call(mod, func, rdai, io) \
+-({ \
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \
+- struct device *dev = rsnd_priv_to_dev(priv); \
+- dev_dbg(dev, "%s-%d-%s\n", \
+- rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \
+- (mod)->ops->func(mod, rdai, io); \
+-})
+-
+-#define rsnd_mod_call(mod, func, rdai, io) \
+- (!(mod) ? -ENODEV : \
+- !((mod)->ops->func) ? 0 : \
+- __rsnd_mod_call(mod, func, rdai, io))
+
+ void rsnd_mod_init(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+--
+2.1.2
+
diff --git a/patches.renesas/0050-ASoC-rsnd-remove-verbose-function-parameter.patch b/patches.renesas/0050-ASoC-rsnd-remove-verbose-function-parameter.patch
new file mode 100644
index 00000000000000..ad829db3bdc8e6
--- /dev/null
+++ b/patches.renesas/0050-ASoC-rsnd-remove-verbose-function-parameter.patch
@@ -0,0 +1,191 @@
+From d87b0ab780b8d825dff81f88b4dc097c32bf7e11 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:15:00 -0800
+Subject: ASoC: rsnd: remove verbose function parameter
+
+priv has rcar_snd_info pointer.
+having priv and info in same time is verbose.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 5da39cf30454bbf3e92f56935e7d137e5bd2c830)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 1 -
+ sound/soc/sh/rcar/core.c | 11 +++++------
+ sound/soc/sh/rcar/gen.c | 7 ++-----
+ sound/soc/sh/rcar/rsnd.h | 5 +----
+ sound/soc/sh/rcar/scu.c | 2 +-
+ sound/soc/sh/rcar/ssi.c | 2 +-
+ 6 files changed, 10 insertions(+), 18 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index af9e4407aa89..69d9394f3697 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -391,7 +391,6 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg)
+ }
+
+ int rsnd_adg_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
+ struct rsnd_adg *adg;
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 5f6d9fef23d1..b2370f68e645 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -577,7 +577,6 @@ static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
+ };
+
+ static int rsnd_dai_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
+ struct snd_soc_dai_driver *drv;
+@@ -773,23 +772,23 @@ static int rsnd_probe(struct platform_device *pdev)
+ /*
+ * init each module
+ */
+- ret = rsnd_gen_probe(pdev, info, priv);
++ ret = rsnd_gen_probe(pdev, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_ssi_probe(pdev, info, priv);
++ ret = rsnd_ssi_probe(pdev, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_scu_probe(pdev, info, priv);
++ ret = rsnd_scu_probe(pdev, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_adg_probe(pdev, info, priv);
++ ret = rsnd_adg_probe(pdev, priv);
+ if (ret)
+ return ret;
+
+- ret = rsnd_dai_probe(pdev, info, priv);
++ ret = rsnd_dai_probe(pdev, priv);
+ if (ret)
+ return ret;
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 0a43b906ffdf..bcb98f4be831 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -276,7 +276,6 @@ static int rsnd_gen2_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ }
+
+ static int rsnd_gen2_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+@@ -374,7 +373,6 @@ static int rsnd_gen1_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ }
+
+ static int rsnd_gen1_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+@@ -419,7 +417,6 @@ static int rsnd_gen1_probe(struct platform_device *pdev,
+ * Gen
+ */
+ int rsnd_gen_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+@@ -436,9 +433,9 @@ int rsnd_gen_probe(struct platform_device *pdev,
+
+ ret = -ENODEV;
+ if (rsnd_is_gen1(priv))
+- ret = rsnd_gen1_probe(pdev, info, priv);
++ ret = rsnd_gen1_probe(pdev, priv);
+ else if (rsnd_is_gen2(priv))
+- ret = rsnd_gen2_probe(pdev, info, priv);
++ ret = rsnd_gen2_probe(pdev, priv);
+
+ if (ret < 0)
+ dev_err(dev, "unknown generation R-Car sound device\n");
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index fb1e0cee08b6..8ac28acc7086 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -226,7 +226,6 @@ int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
+ * R-Car Gen1/Gen2
+ */
+ int rsnd_gen_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv);
+ void rsnd_gen_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+@@ -248,7 +247,6 @@ void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
+ int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod);
+ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate);
+ int rsnd_adg_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv);
+ void rsnd_adg_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+@@ -305,6 +303,7 @@ struct rsnd_priv {
+ };
+
+ #define rsnd_priv_to_dev(priv) ((priv)->dev)
++#define rsnd_priv_to_info(priv) ((priv)->info)
+ #define rsnd_lock(priv, flags) spin_lock_irqsave(&priv->lock, flags)
+ #define rsnd_unlock(priv, flags) spin_unlock_irqrestore(&priv->lock, flags)
+
+@@ -312,7 +311,6 @@ struct rsnd_priv {
+ * R-Car SCU
+ */
+ int rsnd_scu_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv);
+ void rsnd_scu_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+@@ -327,7 +325,6 @@ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ * R-Car SSI
+ */
+ int rsnd_ssi_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv);
+ void rsnd_ssi_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 3984d4b4f2df..82d8b20a6ffb 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -604,9 +604,9 @@ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+ }
+
+ int rsnd_scu_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_scu *scu;
+ struct rsnd_mod_ops *ops;
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index d3371d798d54..2460c9f564de 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -511,9 +511,9 @@ static void rsnd_ssi_parent_clk_setup(struct rsnd_priv *priv, struct rsnd_ssi *s
+ }
+
+ int rsnd_ssi_probe(struct platform_device *pdev,
+- struct rcar_snd_info *info,
+ struct rsnd_priv *priv)
+ {
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ struct rsnd_ssi_platform_info *pinfo;
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_mod_ops *ops;
+--
+2.1.2
+
diff --git a/patches.renesas/0051-ASoC-rsnd-remove-verbose-debug-message-from-scu-ssi.patch b/patches.renesas/0051-ASoC-rsnd-remove-verbose-debug-message-from-scu-ssi.patch
new file mode 100644
index 00000000000000..36075bb67b4b9d
--- /dev/null
+++ b/patches.renesas/0051-ASoC-rsnd-remove-verbose-debug-message-from-scu-ssi.patch
@@ -0,0 +1,44 @@
+From 4f941694919aaf6a45c8fe3195f719ad70b3409c Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:15:07 -0800
+Subject: ASoC: rsnd: remove verbose debug message from scu/ssi
+
+scu/ssi probe() already have more detail debug message.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 98455ed5ddbfbcbcd0adb300c6cb1964ed0a6931)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 1 -
+ sound/soc/sh/rcar/ssi.c | 2 --
+ 2 files changed, 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 82d8b20a6ffb..882e837d39d1 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -663,7 +663,6 @@ int rsnd_scu_probe(struct platform_device *pdev,
+
+ dev_dbg(dev, "SCU%d probed\n", i);
+ }
+- dev_dbg(dev, "scu probed\n");
+
+ return 0;
+ }
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 2460c9f564de..38a62a883b83 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -589,8 +589,6 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ rsnd_ssi_parent_clk_setup(priv, ssi);
+ }
+
+- dev_dbg(dev, "ssi probed\n");
+-
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0052-ASoC-rsnd-unify-rdai-naming.patch b/patches.renesas/0052-ASoC-rsnd-unify-rdai-naming.patch
new file mode 100644
index 00000000000000..8c2473b74ceadb
--- /dev/null
+++ b/patches.renesas/0052-ASoC-rsnd-unify-rdai-naming.patch
@@ -0,0 +1,87 @@
+From 61379b88cf8e0c0a77aced0e65ef9dc751b28a86 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:15:18 -0800
+Subject: ASoC: rsnd: unify rdai naming
+
+struct rsnd_dai is called as "rdai",
+but its size has been called as "dai_nr".
+Unify these as "rdai"
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ecba9e724c5775aebd3a28e831643160c7146e83)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 8 ++++----
+ sound/soc/sh/rcar/rsnd.h | 6 +++---
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index b2370f68e645..f0745af316be 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -352,7 +352,7 @@ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai)
+ {
+ int id = rdai - priv->rdai;
+
+- if ((id < 0) || (id >= rsnd_dai_nr(priv)))
++ if ((id < 0) || (id >= rsnd_rdai_nr(priv)))
+ return -EINVAL;
+
+ return id;
+@@ -360,7 +360,7 @@ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai)
+
+ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id)
+ {
+- if ((id < 0) || (id >= rsnd_dai_nr(priv)))
++ if ((id < 0) || (id >= rsnd_rdai_nr(priv)))
+ return NULL;
+
+ return priv->rdai + id;
+@@ -607,7 +607,7 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ return -ENOMEM;
+ }
+
+- priv->dai_nr = dai_nr;
++ priv->rdai_nr = dai_nr;
+ priv->daidrv = drv;
+ priv->rdai = rdai;
+
+@@ -802,7 +802,7 @@ static int rsnd_probe(struct platform_device *pdev)
+ }
+
+ ret = snd_soc_register_component(dev, &rsnd_soc_component,
+- priv->daidrv, rsnd_dai_nr(priv));
++ priv->daidrv, rsnd_rdai_nr(priv));
+ if (ret < 0) {
+ dev_err(dev, "cannot snd dai register\n");
+ goto exit_snd_soc;
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 8ac28acc7086..3962a50977e5 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -202,10 +202,10 @@ struct rsnd_dai {
+ unsigned int data_alignment:1;
+ };
+
+-#define rsnd_dai_nr(priv) ((priv)->dai_nr)
++#define rsnd_rdai_nr(priv) ((priv)->rdai_nr)
+ #define for_each_rsnd_dai(rdai, priv, i) \
+ for (i = 0; \
+- (i < rsnd_dai_nr(priv)) && \
++ (i < rsnd_rdai_nr(priv)) && \
+ ((rdai) = rsnd_dai_get(priv, i)); \
+ i++)
+
+@@ -299,7 +299,7 @@ struct rsnd_priv {
+ */
+ struct snd_soc_dai_driver *daidrv;
+ struct rsnd_dai *rdai;
+- int dai_nr;
++ int rdai_nr;
+ };
+
+ #define rsnd_priv_to_dev(priv) ((priv)->dev)
+--
+2.1.2
+
diff --git a/patches.renesas/0053-ASoC-rsnd-tidyup-RSND_SSI_xxx-flags.patch b/patches.renesas/0053-ASoC-rsnd-tidyup-RSND_SSI_xxx-flags.patch
new file mode 100644
index 00000000000000..02480b53633323
--- /dev/null
+++ b/patches.renesas/0053-ASoC-rsnd-tidyup-RSND_SSI_xxx-flags.patch
@@ -0,0 +1,35 @@
+From fb29b59283f4ca382757e4c0137597080067dfcc Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 24 Feb 2014 22:15:33 -0800
+Subject: ASoC: rsnd: tidyup RSND_SSI_xxx flags
+
+6f3ab6c1c022e7a4877d38940cd45ae7804a15e2
+(ASoC: rsnd: remove pin sync option)
+added unused RSND_SSI_CLK_FROM_ADG flag.
+It should remove RSND_SSI_SYNC.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 697dce94ed37e0653e5bba593f11e2b14877cd63)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index 2be05aea54f9..e3d585c67685 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -34,9 +34,6 @@
+ * B : SSI direction
+ */
+ #define RSND_SSI_CLK_PIN_SHARE (1 << 31)
+-#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
+-#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */
+-
+ #define RSND_SSI_PLAY (1 << 24)
+
+ #define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
+--
+2.1.2
+
diff --git a/patches.renesas/0054-ASoC-rsnd-run-rsnd_path_init-when-probe-timing.patch b/patches.renesas/0054-ASoC-rsnd-run-rsnd_path_init-when-probe-timing.patch
new file mode 100644
index 00000000000000..fa2100dd8e2044
--- /dev/null
+++ b/patches.renesas/0054-ASoC-rsnd-run-rsnd_path_init-when-probe-timing.patch
@@ -0,0 +1,278 @@
+From d28fce5de9fe5a7a117c0aa9e4875d640efcddef Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:42:47 -0800
+Subject: ASoC: rsnd: run rsnd_path_init() when probe() timing
+
+Current rsnd SSIU/SSI/SCU/SRU path is set
+when playback/capture starts up.
+But it is meaningless method, since the path is based
+on platform and can be set in probe() timing.
+This patch sets the path on probe() timing.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9bfed6cf4fa2cd2c5e80431244348b0c5d933cf5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 94 +++++++++++++++++++++++++++++++++++++++---------
+ sound/soc/sh/rcar/gen.c | 56 -----------------------------
+ sound/soc/sh/rcar/rsnd.h | 9 -----
+ 3 files changed, 78 insertions(+), 81 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index f0745af316be..96cb78612a7d 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -317,9 +317,9 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+ ret; \
+ })
+
+-int rsnd_dai_connect(struct rsnd_dai *rdai,
+- struct rsnd_mod *mod,
+- struct rsnd_dai_stream *io)
++static int rsnd_dai_connect(struct rsnd_dai *rdai,
++ struct rsnd_mod *mod,
++ struct rsnd_dai_stream *io)
+ {
+ if (!mod)
+ return -EIO;
+@@ -340,7 +340,7 @@ int rsnd_dai_connect(struct rsnd_dai *rdai,
+ return 0;
+ }
+
+-int rsnd_dai_disconnect(struct rsnd_mod *mod)
++static int rsnd_dai_disconnect(struct rsnd_mod *mod)
+ {
+ list_del_init(&mod->list);
+ mod->io = NULL;
+@@ -418,10 +418,6 @@ static int rsnd_dai_stream_init(struct rsnd_dai_stream *io,
+ {
+ struct snd_pcm_runtime *runtime = substream->runtime;
+
+- if (!list_empty(&io->head))
+- return -EIO;
+-
+- INIT_LIST_HEAD(&io->head);
+ io->substream = substream;
+ io->byte_pos = 0;
+ io->period_pos = 0;
+@@ -476,10 +472,6 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+ if (ret < 0)
+ goto dai_trigger_end;
+
+- ret = rsnd_gen_path_init(priv, rdai, io);
+- if (ret < 0)
+- goto dai_trigger_end;
+-
+ ret = rsnd_dai_call(rdai, io, init);
+ if (ret < 0)
+ goto dai_trigger_end;
+@@ -497,10 +489,6 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+ if (ret < 0)
+ goto dai_trigger_end;
+
+- ret = rsnd_gen_path_exit(priv, rdai, io);
+- if (ret < 0)
+- goto dai_trigger_end;
+-
+ ret = rsnd_platform_call(priv, dai, stop, ssi_id);
+ if (ret < 0)
+ goto dai_trigger_end;
+@@ -576,6 +564,70 @@ static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
+ .set_fmt = rsnd_soc_dai_set_fmt,
+ };
+
++static int rsnd_path_init(struct rsnd_priv *priv,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_mod *mod;
++ int ret;
++ int id;
++
++ /*
++ * Gen1 is created by SRU/SSI, and this SRU is base module of
++ * Gen2's SCU/SSIU/SSI. (Gen2 SCU/SSIU came from SRU)
++ *
++ * Easy image is..
++ * Gen1 SRU = Gen2 SCU + SSIU + etc
++ *
++ * Gen2 SCU path is very flexible, but, Gen1 SRU (SCU parts) is
++ * using fixed path.
++ *
++ * Then, SSI id = SCU id here
++ */
++ /* get SSI's ID */
++ mod = rsnd_ssi_mod_get_frm_dai(priv,
++ rsnd_dai_id(priv, rdai),
++ rsnd_dai_is_play(rdai, io));
++ if (!mod)
++ return 0;
++ id = rsnd_mod_id(mod);
++ ret = 0;
++
++ /* SCU */
++ mod = rsnd_scu_mod_get(priv, id);
++ if (mod) {
++ ret = rsnd_dai_connect(rdai, mod, io);
++ if (ret < 0)
++ return ret;
++ }
++
++ /* SSI */
++ mod = rsnd_ssi_mod_get(priv, id);
++ if (mod) {
++ ret = rsnd_dai_connect(rdai, mod, io);
++ if (ret < 0)
++ return ret;
++ }
++
++ return ret;
++}
++
++static int rsnd_path_exit(struct rsnd_priv *priv,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_mod *mod, *n;
++ int ret = 0;
++
++ /*
++ * remove all mod from rdai
++ */
++ for_each_rsnd_mod(mod, n, io)
++ ret |= rsnd_dai_disconnect(mod);
++
++ return ret;
++}
++
+ static int rsnd_dai_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+@@ -634,12 +686,14 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ drv[i].playback.formats = RSND_FMTS;
+ drv[i].playback.channels_min = 2;
+ drv[i].playback.channels_max = 2;
++ rsnd_path_init(priv, &rdai[i], &rdai[i].playback);
+ }
+ if (cmod) {
+ drv[i].capture.rates = RSND_RATES;
+ drv[i].capture.formats = RSND_FMTS;
+ drv[i].capture.channels_min = 2;
+ drv[i].capture.channels_max = 2;
++ rsnd_path_init(priv, &rdai[i], &rdai[i].capture);
+ }
+
+ dev_dbg(dev, "%s (%s/%s)\n", rdai[i].name,
+@@ -653,6 +707,14 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ static void rsnd_dai_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
++ struct rsnd_dai *rdai;
++ int i;
++
++ for (i = 0; i < rsnd_rdai_nr(priv); i++) {
++ rdai = rsnd_dai_get(priv, i);
++ rsnd_path_exit(priv, rdai, &rdai->playback);
++ rsnd_path_exit(priv, rdai, &rdai->capture);
++ }
+ }
+
+ /*
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index bcb98f4be831..4f2c1d0c6970 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -155,62 +155,6 @@ static int rsnd_gen_regmap_init(struct rsnd_priv *priv,
+ return 0;
+ }
+
+-int rsnd_gen_path_init(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_mod *mod;
+- int ret;
+- int id;
+-
+- /*
+- * Gen1 is created by SRU/SSI, and this SRU is base module of
+- * Gen2's SCU/SSIU/SSI. (Gen2 SCU/SSIU came from SRU)
+- *
+- * Easy image is..
+- * Gen1 SRU = Gen2 SCU + SSIU + etc
+- *
+- * Gen2 SCU path is very flexible, but, Gen1 SRU (SCU parts) is
+- * using fixed path.
+- *
+- * Then, SSI id = SCU id here
+- */
+-
+- /* get SSI's ID */
+- mod = rsnd_ssi_mod_get_frm_dai(priv,
+- rsnd_dai_id(priv, rdai),
+- rsnd_dai_is_play(rdai, io));
+- id = rsnd_mod_id(mod);
+-
+- /* SCU */
+- mod = rsnd_scu_mod_get(priv, id);
+- ret = rsnd_dai_connect(rdai, mod, io);
+- if (ret < 0)
+- return ret;
+-
+- /* SSI */
+- mod = rsnd_ssi_mod_get(priv, id);
+- ret = rsnd_dai_connect(rdai, mod, io);
+-
+- return ret;
+-}
+-
+-int rsnd_gen_path_exit(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_mod *mod, *n;
+- int ret = 0;
+-
+- /*
+- * remove all mod from rdai
+- */
+- for_each_rsnd_mod(mod, n, io)
+- ret |= rsnd_dai_disconnect(mod);
+-
+- return ret;
+-}
+-
+ /*
+ * Gen2
+ */
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 3962a50977e5..6a25203e0f08 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -210,9 +210,6 @@ struct rsnd_dai {
+ i++)
+
+ struct rsnd_dai *rsnd_dai_get(struct rsnd_priv *priv, int id);
+-int rsnd_dai_disconnect(struct rsnd_mod *mod);
+-int rsnd_dai_connect(struct rsnd_dai *rdai, struct rsnd_mod *mod,
+- struct rsnd_dai_stream *io);
+ int rsnd_dai_is_play(struct rsnd_dai *rdai, struct rsnd_dai_stream *io);
+ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai);
+ #define rsnd_dai_get_platform_info(rdai) ((rdai)->info)
+@@ -229,12 +226,6 @@ int rsnd_gen_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+ void rsnd_gen_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-int rsnd_gen_path_init(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io);
+-int rsnd_gen_path_exit(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io);
+ void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ enum rsnd_reg reg);
+--
+2.1.2
+
diff --git a/patches.renesas/0055-ASoC-rsnd-use-mod-array-instead-of-list-on-rdai.patch b/patches.renesas/0055-ASoC-rsnd-use-mod-array-instead-of-list-on-rdai.patch
new file mode 100644
index 00000000000000..dfdbeb844e8370
--- /dev/null
+++ b/patches.renesas/0055-ASoC-rsnd-use-mod-array-instead-of-list-on-rdai.patch
@@ -0,0 +1,223 @@
+From 44680793de15ac3605394c9a4814d2a32e90e0ef Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:42:55 -0800
+Subject: ASoC: rsnd: use mod array instead of list on rdai
+
+struct rsnd_dai_stream used list for mod list.
+It added only odd flexibility to current driver, and
+it is a factor which makes extendibility difficult.
+rsnd use mod array instead of list from now.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit a126021d144bae88a563db2b57b0ad5eb1ee66d9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 42 +++++++++++++++++++++++-------------------
+ sound/soc/sh/rcar/rsnd.h | 12 ++++++++----
+ sound/soc/sh/rcar/scu.c | 2 +-
+ sound/soc/sh/rcar/ssi.c | 2 +-
+ 4 files changed, 33 insertions(+), 25 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 96cb78612a7d..416b0782503a 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -121,12 +121,13 @@ char *rsnd_mod_name(struct rsnd_mod *mod)
+ void rsnd_mod_init(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ struct rsnd_mod_ops *ops,
++ enum rsnd_mod_type type,
+ int id)
+ {
+ mod->priv = priv;
+ mod->id = id;
+ mod->ops = ops;
+- INIT_LIST_HEAD(&mod->list);
++ mod->type = type;
+ }
+
+ /*
+@@ -307,9 +308,12 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+
+ #define rsnd_dai_call(rdai, io, fn) \
+ ({ \
+- struct rsnd_mod *mod, *n; \
+- int ret = 0; \
+- for_each_rsnd_mod(mod, n, (io)) { \
++ struct rsnd_mod *mod; \
++ int ret = 0, i; \
++ for (i = 0; i < RSND_MOD_MAX; i++) { \
++ mod = (io)->mod[i]; \
++ if (!mod) \
++ continue; \
+ ret = rsnd_mod_call(mod, fn, (rdai), (io)); \
+ if (ret < 0) \
+ break; \
+@@ -317,14 +321,13 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+ ret; \
+ })
+
+-static int rsnd_dai_connect(struct rsnd_dai *rdai,
+- struct rsnd_mod *mod,
++static int rsnd_dai_connect(struct rsnd_mod *mod,
+ struct rsnd_dai_stream *io)
+ {
+ if (!mod)
+ return -EIO;
+
+- if (!list_empty(&mod->list)) {
++ if (io->mod[mod->type]) {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct device *dev = rsnd_priv_to_dev(priv);
+
+@@ -334,15 +337,15 @@ static int rsnd_dai_connect(struct rsnd_dai *rdai,
+ return -EIO;
+ }
+
+- list_add_tail(&mod->list, &io->head);
++ io->mod[mod->type] = mod;
+ mod->io = io;
+
+ return 0;
+ }
+
+-static int rsnd_dai_disconnect(struct rsnd_mod *mod)
++static int rsnd_dai_disconnect(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
+ {
+- list_del_init(&mod->list);
++ io->mod[mod->type] = NULL;
+ mod->io = NULL;
+
+ return 0;
+@@ -596,7 +599,7 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ /* SCU */
+ mod = rsnd_scu_mod_get(priv, id);
+ if (mod) {
+- ret = rsnd_dai_connect(rdai, mod, io);
++ ret = rsnd_dai_connect(mod, io);
+ if (ret < 0)
+ return ret;
+ }
+@@ -604,7 +607,7 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ /* SSI */
+ mod = rsnd_ssi_mod_get(priv, id);
+ if (mod) {
+- ret = rsnd_dai_connect(rdai, mod, io);
++ ret = rsnd_dai_connect(mod, io);
+ if (ret < 0)
+ return ret;
+ }
+@@ -616,14 +619,18 @@ static int rsnd_path_exit(struct rsnd_priv *priv,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_mod *mod, *n;
+- int ret = 0;
++ struct rsnd_mod *mod;
++ int ret = 0, i;
+
+ /*
+ * remove all mod from rdai
+ */
+- for_each_rsnd_mod(mod, n, io)
+- ret |= rsnd_dai_disconnect(mod);
++ for (i = 0; i < RSND_MOD_MAX; i++) {
++ mod = io->mod[i];
++ if (!mod)
++ continue;
++ ret |= rsnd_dai_disconnect(mod, io);
++ }
+
+ return ret;
+ }
+@@ -671,9 +678,6 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ /*
+ * init rsnd_dai
+ */
+- INIT_LIST_HEAD(&rdai[i].playback.head);
+- INIT_LIST_HEAD(&rdai[i].capture.head);
+-
+ snprintf(rdai[i].name, RSND_DAI_NAME_SIZE, "rsnd-dai.%d", i);
+
+ /*
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 6a25203e0f08..7767a8f1994a 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -135,6 +135,11 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+ /*
+ * R-Car sound mod
+ */
++enum rsnd_mod_type {
++ RSND_MOD_SCU = 0,
++ RSND_MOD_SSI,
++ RSND_MOD_MAX,
++};
+
+ struct rsnd_mod_ops {
+ char *name;
+@@ -155,9 +160,9 @@ struct rsnd_mod_ops {
+ struct rsnd_dai_stream;
+ struct rsnd_mod {
+ int id;
++ enum rsnd_mod_type type;
+ struct rsnd_priv *priv;
+ struct rsnd_mod_ops *ops;
+- struct list_head list; /* connect to rsnd_dai playback/capture */
+ struct rsnd_dma dma;
+ struct rsnd_dai_stream *io;
+ };
+@@ -167,12 +172,11 @@ struct rsnd_mod {
+ #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma)
+ #define rsnd_mod_to_io(mod) ((mod)->io)
+ #define rsnd_mod_id(mod) ((mod)->id)
+-#define for_each_rsnd_mod(pos, n, io) \
+- list_for_each_entry_safe(pos, n, &(io)->head, list)
+
+ void rsnd_mod_init(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ struct rsnd_mod_ops *ops,
++ enum rsnd_mod_type type,
+ int id);
+ char *rsnd_mod_name(struct rsnd_mod *mod);
+
+@@ -181,8 +185,8 @@ char *rsnd_mod_name(struct rsnd_mod *mod);
+ */
+ #define RSND_DAI_NAME_SIZE 16
+ struct rsnd_dai_stream {
+- struct list_head head; /* head of rsnd_mod list */
+ struct snd_pcm_substream *substream;
++ struct rsnd_mod *mod[RSND_MOD_MAX];
+ int byte_pos;
+ int period_pos;
+ int byte_per_period;
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 882e837d39d1..81264ecd82ac 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -659,7 +659,7 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ ops = &rsnd_scu_non_gen2_ops;
+ }
+
+- rsnd_mod_init(priv, &scu->mod, ops, i);
++ rsnd_mod_init(priv, &scu->mod, ops, RSND_MOD_SCU, i);
+
+ dev_dbg(dev, "SCU%d probed\n", i);
+ }
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 38a62a883b83..480dde5076b7 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -584,7 +584,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ dev_dbg(dev, "SSI%d use PIO transfer\n", i);
+ }
+
+- rsnd_mod_init(priv, &ssi->mod, ops, i);
++ rsnd_mod_init(priv, &ssi->mod, ops, RSND_MOD_SSI, i);
+
+ rsnd_ssi_parent_clk_setup(priv, ssi);
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0056-ASoC-rsnd-get-ssi-scu-from-rsnd_dai_stream.patch b/patches.renesas/0056-ASoC-rsnd-get-ssi-scu-from-rsnd_dai_stream.patch
new file mode 100644
index 00000000000000..ca626a0d0f2ee3
--- /dev/null
+++ b/patches.renesas/0056-ASoC-rsnd-get-ssi-scu-from-rsnd_dai_stream.patch
@@ -0,0 +1,120 @@
+From 56e4fb14ea973ccfdc676c9e1be148813caf3339 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:03 -0800
+Subject: ASoC: rsnd: get ssi/scu from rsnd_dai_stream
+
+Current driver is assuming that SSI id = SCU id.
+But, now, it can get correct SSI/SCU from
+rsnd_dai_stream. use it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 374e5426377604a94d672650ef22dd2b4285de17)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 4 +++-
+ sound/soc/sh/rcar/scu.c | 20 +++++++++++---------
+ sound/soc/sh/rcar/ssi.c | 2 +-
+ 3 files changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 7767a8f1994a..cbc38a2be81c 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -192,6 +192,8 @@ struct rsnd_dai_stream {
+ int byte_per_period;
+ int next_period_byte;
+ };
++#define rsnd_io_to_mod_ssi(io) ((io)->mod[RSND_MOD_SSI])
++#define rsnd_io_to_mod_scu(io) ((io)->mod[RSND_MOD_SCU])
+
+ struct rsnd_dai {
+ char name[RSND_DAI_NAME_SIZE];
+@@ -311,7 +313,7 @@ void rsnd_scu_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+- struct rsnd_mod *ssi_mod,
++ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime);
+
+ #define rsnd_scu_nr(priv) ((priv)->scu_nr)
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 81264ecd82ac..1073d35486e3 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -121,7 +121,8 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- int id = rsnd_mod_id(mod);
++ struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
++ int ssi_id = rsnd_mod_id(ssi_mod);
+ u32 convert_rate = rsnd_scu_convert_rate(scu);
+
+ if (convert_rate && !rsnd_dai_is_clk_master(rdai)) {
+@@ -134,15 +135,15 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ /*
+ * SSI_MODE0
+ */
+- rsnd_mod_bset(mod, SSI_MODE0, (1 << id),
+- rsnd_scu_hpbif_is_enable(scu) ? 0 : (1 << id));
++ rsnd_mod_bset(mod, SSI_MODE0, (1 << ssi_id),
++ rsnd_scu_hpbif_is_enable(scu) ? 0 : (1 << ssi_id));
+
+ /*
+ * SSI_MODE1
+ */
+- if (rsnd_ssi_is_pin_sharing(rsnd_ssi_mod_get(priv, id))) {
++ if (rsnd_ssi_is_pin_sharing(ssi_mod)) {
+ int shift = -1;
+- switch (id) {
++ switch (ssi_id) {
+ case 1:
+ shift = 0;
+ break;
+@@ -165,14 +166,13 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ }
+
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+- struct rsnd_mod *ssi_mod,
++ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime)
+ {
+ struct rsnd_scu *scu;
+ unsigned int rate;
+
+- /* this function is assuming SSI id = SCU id here */
+- scu = rsnd_mod_to_scu(rsnd_scu_mod_get(priv, rsnd_mod_id(ssi_mod)));
++ scu = rsnd_mod_to_scu(rsnd_io_to_mod_scu(io));
+
+ /*
+ * return convert rate if SRC is used,
+@@ -583,8 +583,10 @@ static int rsnd_scu_start_non_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
++ struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
++
+ /* enable PIO interrupt */
+- rsnd_mod_write(mod, INT_ENABLE, 0x0f000000);
++ rsnd_mod_write(ssi_mod, INT_ENABLE, 0x0f000000);
+
+ return 0;
+ }
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 480dde5076b7..25a7d441f8fc 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -121,7 +121,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
+ 1, 2, 4, 8, 16, 6, 12,
+ };
+ unsigned int main_rate;
+- unsigned int rate = rsnd_scu_get_ssi_rate(priv, &ssi->mod, runtime);
++ unsigned int rate = rsnd_scu_get_ssi_rate(priv, io, runtime);
+
+ /*
+ * Find best clock, and try to start ADG
+--
+2.1.2
+
diff --git a/patches.renesas/0057-ASoC-rsnd-use-devm_clk_get-instead-of-clk_get.patch b/patches.renesas/0057-ASoC-rsnd-use-devm_clk_get-instead-of-clk_get.patch
new file mode 100644
index 00000000000000..642bc6fad1cfb9
--- /dev/null
+++ b/patches.renesas/0057-ASoC-rsnd-use-devm_clk_get-instead-of-clk_get.patch
@@ -0,0 +1,63 @@
+From 4f8c2378fd4e9692ef3ad8a1a9c09d162b9c72d1 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:11 -0800
+Subject: ASoC: rsnd: use devm_clk_get() instead of clk_get()
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 468be93eb4e28c5710ed8acc1b938937707e537c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 24 +++++++++---------------
+ 1 file changed, 9 insertions(+), 15 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 69d9394f3697..a05ad8159824 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -405,11 +405,11 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ return -ENOMEM;
+ }
+
+- clk_orig = clk_get(dev, NULL);
+- adg->clk[CLKA] = clk_get(dev, "clk_a");
+- adg->clk[CLKB] = clk_get(dev, "clk_b");
+- adg->clk[CLKC] = clk_get(dev, "clk_c");
+- adg->clk[CLKI] = clk_get(dev, "clk_i");
++ clk_orig = devm_clk_get(dev, NULL);
++ adg->clk[CLKA] = devm_clk_get(dev, "clk_a");
++ adg->clk[CLKB] = devm_clk_get(dev, "clk_b");
++ adg->clk[CLKC] = devm_clk_get(dev, "clk_c");
++ adg->clk[CLKI] = devm_clk_get(dev, "clk_i");
+
+ /*
+ * It request device dependent audio clock.
+@@ -432,10 +432,10 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ * but will be removed soon
+ */
+ if (use_old_style) {
+- adg->clk[CLKA] = clk_get(NULL, "audio_clk_a");
+- adg->clk[CLKB] = clk_get(NULL, "audio_clk_b");
+- adg->clk[CLKC] = clk_get(NULL, "audio_clk_c");
+- adg->clk[CLKI] = clk_get(NULL, "audio_clk_internal");
++ adg->clk[CLKA] = devm_clk_get(NULL, "audio_clk_a");
++ adg->clk[CLKB] = devm_clk_get(NULL, "audio_clk_b");
++ adg->clk[CLKC] = devm_clk_get(NULL, "audio_clk_c");
++ adg->clk[CLKI] = devm_clk_get(NULL, "audio_clk_internal");
+ }
+
+ for_each_rsnd_clk(clk, adg, i) {
+@@ -457,10 +457,4 @@ int rsnd_adg_probe(struct platform_device *pdev,
+ void rsnd_adg_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+- struct rsnd_adg *adg = priv->adg;
+- struct clk *clk;
+- int i;
+-
+- for_each_rsnd_clk(clk, adg, i)
+- clk_put(clk);
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0058-ASoC-rsnd-use-function-pointer-for-each-probe.patch b/patches.renesas/0058-ASoC-rsnd-use-function-pointer-for-each-probe.patch
new file mode 100644
index 00000000000000..7a48ec9969c515
--- /dev/null
+++ b/patches.renesas/0058-ASoC-rsnd-use-function-pointer-for-each-probe.patch
@@ -0,0 +1,72 @@
+From 75f5aa4638c8a5b59058162e7a5f7e96ea5e08b1 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:18 -0800
+Subject: ASoC: rsnd: use function pointer for each probe
+
+R-Car sound consists of many devices.
+It will have more device support in the future.
+Thus, for each probe become now function pointer array.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit d1ac970f5de94bef9e094b46f016899d04e8178b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 34 ++++++++++++++--------------------
+ 1 file changed, 14 insertions(+), 20 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 416b0782503a..ea747614fbf8 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -814,7 +814,15 @@ static int rsnd_probe(struct platform_device *pdev)
+ struct rcar_snd_info *info;
+ struct rsnd_priv *priv;
+ struct device *dev = &pdev->dev;
+- int ret;
++ int (*probe_func[])(struct platform_device *pdev,
++ struct rsnd_priv *priv) = {
++ rsnd_gen_probe,
++ rsnd_ssi_probe,
++ rsnd_scu_probe,
++ rsnd_adg_probe,
++ rsnd_dai_probe,
++ };
++ int ret, i;
+
+ info = pdev->dev.platform_data;
+ if (!info) {
+@@ -838,25 +846,11 @@ static int rsnd_probe(struct platform_device *pdev)
+ /*
+ * init each module
+ */
+- ret = rsnd_gen_probe(pdev, priv);
+- if (ret)
+- return ret;
+-
+- ret = rsnd_ssi_probe(pdev, priv);
+- if (ret)
+- return ret;
+-
+- ret = rsnd_scu_probe(pdev, priv);
+- if (ret)
+- return ret;
+-
+- ret = rsnd_adg_probe(pdev, priv);
+- if (ret)
+- return ret;
+-
+- ret = rsnd_dai_probe(pdev, priv);
+- if (ret)
+- return ret;
++ for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
++ ret = probe_func[i](pdev, priv);
++ if (ret)
++ return ret;
++ }
+
+ /*
+ * asoc register
+--
+2.1.2
+
diff --git a/patches.renesas/0059-ASoC-rsnd-remove-unused-SSI_CONTROL.patch b/patches.renesas/0059-ASoC-rsnd-remove-unused-SSI_CONTROL.patch
new file mode 100644
index 00000000000000..06007fbcafc1e6
--- /dev/null
+++ b/patches.renesas/0059-ASoC-rsnd-remove-unused-SSI_CONTROL.patch
@@ -0,0 +1,41 @@
+From c35caa925fb5328f2c318dfb2d6944b849cfd6e9 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:26 -0800
+Subject: ASoC: rsnd: remove unused SSI_CONTROL
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 685fb3eb31445bd872ab30ae301404b2cac7cd75)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/gen.c | 1 -
+ sound/soc/sh/rcar/rsnd.h | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 4f2c1d0c6970..92d1bc9acef0 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -173,7 +173,6 @@ static int rsnd_gen2_regmap_init(struct rsnd_priv *priv, struct rsnd_gen *gen)
+ RSND_GEN2_S_REG(gen, SSIU, SSI_MODE0, 0x800),
+ RSND_GEN2_S_REG(gen, SSIU, SSI_MODE1, 0x804),
+ /* FIXME: it needs SSI_MODE2/3 in the future */
+- RSND_GEN2_S_REG(gen, SSIU, SSI_CONTROL, 0x810),
+ RSND_GEN2_M_REG(gen, SSIU, SSI_BUSIF_MODE, 0x0, 0x80),
+ RSND_GEN2_M_REG(gen, SSIU, SSI_BUSIF_ADINR,0x4, 0x80),
+ RSND_GEN2_M_REG(gen, SSIU, SSI_CTRL, 0x10, 0x80),
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index cbc38a2be81c..e16acd2037a0 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -39,7 +39,6 @@ enum rsnd_reg {
+ RSND_REG_SRC_ROUTE_CTRL, /* for Gen1 */
+ RSND_REG_SRC_CTRL, /* for Gen2 */
+ RSND_REG_SSI_CTRL, /* for Gen2 */
+- RSND_REG_SSI_CONTROL,
+ RSND_REG_SSI_BUSIF_MODE, /* for Gen2 */
+ RSND_REG_SSI_BUSIF_ADINR, /* for Gen2 */
+ RSND_REG_SSI_MODE0,
+--
+2.1.2
+
diff --git a/patches.renesas/0060-ASoC-rsnd-modify-rsnd_adg_ssi_ws_timing_gen2-paramet.patch b/patches.renesas/0060-ASoC-rsnd-modify-rsnd_adg_ssi_ws_timing_gen2-paramet.patch
new file mode 100644
index 00000000000000..59efff1c531ddd
--- /dev/null
+++ b/patches.renesas/0060-ASoC-rsnd-modify-rsnd_adg_ssi_ws_timing_gen2-paramet.patch
@@ -0,0 +1,54 @@
+From 963979a0770e4d621ff352969f42df987d2bb6d0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:33 -0800
+Subject: ASoC: rsnd: modify rsnd_adg_ssi_ws_timing_gen2() parameter
+
+rsnd_adg_ssi_ws_timing_gen2() returns SSI WS timing,
+and it used "mod" as parameter.
+but, this "mod" is sometimes not ssi mod.
+Get SSI mod from rsnd_dai_stream
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 8467dedc9dae3630a2ede49a43120af3ed54ba19)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index a05ad8159824..8df00ac3b120 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -32,8 +32,9 @@ struct rsnd_adg {
+ #define rsnd_priv_to_adg(priv) ((struct rsnd_adg *)(priv)->adg)
+
+
+-static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_mod *mod)
++static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io)
+ {
++ struct rsnd_mod *mod = rsnd_io_to_mod_ssi(io);
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ int id = rsnd_mod_id(mod);
+ int ws = id;
+@@ -67,7 +68,7 @@ static int rsnd_adg_set_src_timsel_gen2(struct rsnd_dai *rdai,
+ u32 mask, ws;
+ u32 in, out;
+
+- ws = rsnd_adg_ssi_ws_timing_gen2(mod);
++ ws = rsnd_adg_ssi_ws_timing_gen2(io);
+
+ in = (is_play) ? timsel : ws;
+ out = (is_play) ? ws : timsel;
+@@ -174,7 +175,7 @@ int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- u32 val = rsnd_adg_ssi_ws_timing_gen2(mod);
++ u32 val = rsnd_adg_ssi_ws_timing_gen2(io);
+
+ return rsnd_adg_set_src_timsel_gen2(rdai, mod, io, val);
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0061-ASoC-rsnd-share-reg_field-and-reduce-memory.patch b/patches.renesas/0061-ASoC-rsnd-share-reg_field-and-reduce-memory.patch
new file mode 100644
index 00000000000000..044d087924a965
--- /dev/null
+++ b/patches.renesas/0061-ASoC-rsnd-share-reg_field-and-reduce-memory.patch
@@ -0,0 +1,138 @@
+From 7487540b5911007d07f79c8cb4f715116c994b0f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 23:43:40 -0800
+Subject: ASoC: rsnd: share reg_field and reduce memory
+
+Gen1/Gen2 code never be used in same time.
+Thus, driver can share Gen1 only register and Gen2 only register.
+It can reduce memory too.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c82e1c8874e5abaf52f9ed886386cbe08ec98a5b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 81 +++++++++++++++++++++++++++++++-----------------
+ 1 file changed, 53 insertions(+), 28 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index e16acd2037a0..d5afdee6b6f2 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -32,18 +32,8 @@
+ */
+ enum rsnd_reg {
+ /* SRU/SCU/SSIU */
+- RSND_REG_SRC_ROUTE_SEL, /* for Gen1 */
+- RSND_REG_SRC_TMG_SEL0, /* for Gen1 */
+- RSND_REG_SRC_TMG_SEL1, /* for Gen1 */
+- RSND_REG_SRC_TMG_SEL2, /* for Gen1 */
+- RSND_REG_SRC_ROUTE_CTRL, /* for Gen1 */
+- RSND_REG_SRC_CTRL, /* for Gen2 */
+- RSND_REG_SSI_CTRL, /* for Gen2 */
+- RSND_REG_SSI_BUSIF_MODE, /* for Gen2 */
+- RSND_REG_SSI_BUSIF_ADINR, /* for Gen2 */
+ RSND_REG_SSI_MODE0,
+ RSND_REG_SSI_MODE1,
+- RSND_REG_INT_ENABLE, /* for Gen2 */
+ RSND_REG_SRC_BUSIF_MODE,
+ RSND_REG_SRC_ROUTE_MODE0,
+ RSND_REG_SRC_SWRSR,
+@@ -52,9 +42,6 @@ enum rsnd_reg {
+ RSND_REG_SRC_IFSCR,
+ RSND_REG_SRC_IFSVR,
+ RSND_REG_SRC_SRCCR,
+- RSND_REG_SRC_MNFSR, /* for Gen1 */
+- RSND_REG_SRC_BSDSR, /* for Gen2 */
+- RSND_REG_SRC_BSISR, /* for Gen2 */
+
+ /* ADG */
+ RSND_REG_BRRA,
+@@ -62,21 +49,6 @@ enum rsnd_reg {
+ RSND_REG_SSICKR,
+ RSND_REG_AUDIO_CLK_SEL0,
+ RSND_REG_AUDIO_CLK_SEL1,
+- RSND_REG_AUDIO_CLK_SEL2,
+- RSND_REG_AUDIO_CLK_SEL3, /* for Gen1 */
+- RSND_REG_AUDIO_CLK_SEL4, /* for Gen1 */
+- RSND_REG_AUDIO_CLK_SEL5, /* for Gen1 */
+- RSND_REG_DIV_EN, /* for Gen2 */
+- RSND_REG_SRCIN_TIMSEL0, /* for Gen2 */
+- RSND_REG_SRCIN_TIMSEL1, /* for Gen2 */
+- RSND_REG_SRCIN_TIMSEL2, /* for Gen2 */
+- RSND_REG_SRCIN_TIMSEL3, /* for Gen2 */
+- RSND_REG_SRCIN_TIMSEL4, /* for Gen2 */
+- RSND_REG_SRCOUT_TIMSEL0, /* for Gen2 */
+- RSND_REG_SRCOUT_TIMSEL1, /* for Gen2 */
+- RSND_REG_SRCOUT_TIMSEL2, /* for Gen2 */
+- RSND_REG_SRCOUT_TIMSEL3, /* for Gen2 */
+- RSND_REG_SRCOUT_TIMSEL4, /* for Gen2 */
+
+ /* SSI */
+ RSND_REG_SSICR,
+@@ -85,9 +57,62 @@ enum rsnd_reg {
+ RSND_REG_SSIRDR,
+ RSND_REG_SSIWSR,
+
++ /* SHARE see below */
++ RSND_REG_SHARE01,
++ RSND_REG_SHARE02,
++ RSND_REG_SHARE03,
++ RSND_REG_SHARE04,
++ RSND_REG_SHARE05,
++ RSND_REG_SHARE06,
++ RSND_REG_SHARE07,
++ RSND_REG_SHARE08,
++ RSND_REG_SHARE09,
++ RSND_REG_SHARE10,
++ RSND_REG_SHARE11,
++ RSND_REG_SHARE12,
++ RSND_REG_SHARE13,
++ RSND_REG_SHARE14,
++ RSND_REG_SHARE15,
++ RSND_REG_SHARE16,
++ RSND_REG_SHARE17,
++ RSND_REG_SHARE18,
++ RSND_REG_SHARE19,
++
+ RSND_REG_MAX,
+ };
+
++/* Gen1 only */
++#define RSND_REG_SRC_ROUTE_SEL RSND_REG_SHARE01
++#define RSND_REG_SRC_TMG_SEL0 RSND_REG_SHARE02
++#define RSND_REG_SRC_TMG_SEL1 RSND_REG_SHARE03
++#define RSND_REG_SRC_TMG_SEL2 RSND_REG_SHARE04
++#define RSND_REG_SRC_ROUTE_CTRL RSND_REG_SHARE05
++#define RSND_REG_SRC_MNFSR RSND_REG_SHARE06
++#define RSND_REG_AUDIO_CLK_SEL3 RSND_REG_SHARE07
++#define RSND_REG_AUDIO_CLK_SEL4 RSND_REG_SHARE08
++#define RSND_REG_AUDIO_CLK_SEL5 RSND_REG_SHARE09
++
++/* Gen2 only */
++#define RSND_REG_SRC_CTRL RSND_REG_SHARE01
++#define RSND_REG_SSI_CTRL RSND_REG_SHARE02
++#define RSND_REG_SSI_BUSIF_MODE RSND_REG_SHARE03
++#define RSND_REG_SSI_BUSIF_ADINR RSND_REG_SHARE04
++#define RSND_REG_INT_ENABLE RSND_REG_SHARE05
++#define RSND_REG_SRC_BSDSR RSND_REG_SHARE06
++#define RSND_REG_SRC_BSISR RSND_REG_SHARE07
++#define RSND_REG_DIV_EN RSND_REG_SHARE08
++#define RSND_REG_SRCIN_TIMSEL0 RSND_REG_SHARE09
++#define RSND_REG_SRCIN_TIMSEL1 RSND_REG_SHARE10
++#define RSND_REG_SRCIN_TIMSEL2 RSND_REG_SHARE11
++#define RSND_REG_SRCIN_TIMSEL3 RSND_REG_SHARE12
++#define RSND_REG_SRCIN_TIMSEL4 RSND_REG_SHARE13
++#define RSND_REG_SRCOUT_TIMSEL0 RSND_REG_SHARE14
++#define RSND_REG_SRCOUT_TIMSEL1 RSND_REG_SHARE15
++#define RSND_REG_SRCOUT_TIMSEL2 RSND_REG_SHARE16
++#define RSND_REG_SRCOUT_TIMSEL3 RSND_REG_SHARE17
++#define RSND_REG_SRCOUT_TIMSEL4 RSND_REG_SHARE18
++#define RSND_REG_AUDIO_CLK_SEL2 RSND_REG_SHARE19
++
+ struct rsnd_priv;
+ struct rsnd_mod;
+ struct rsnd_dai;
+--
+2.1.2
+
diff --git a/patches.renesas/0062-ASoC-rsnd-add-struct-rsnd_dai_platform_info.patch b/patches.renesas/0062-ASoC-rsnd-add-struct-rsnd_dai_platform_info.patch
new file mode 100644
index 00000000000000..d7ba8a1a517957
--- /dev/null
+++ b/patches.renesas/0062-ASoC-rsnd-add-struct-rsnd_dai_platform_info.patch
@@ -0,0 +1,161 @@
+From 901d902786cac94723492d214a6ed6a6a4b6efd9 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:49:50 -0800
+Subject: ASoC: rsnd: add struct rsnd_dai_platform_info
+
+R-Car sound DAI consists from SSI/SCU/SSIU/SRU...
+Current R-Car sound DAI is decided from these settings,
+but it is intuitively unclear, and is not good design for DT support.
+This patch adds new rsnd_dai_platform_info to solve this issue.
+
+But now, many platform is using this driver without
+rsnd_dai_platform_info.
+So, this patch still supports DAI settings via SSI to keep compatible.
+It will be removed in next Linux version.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 78f13d0c5a2888564b2bed7f8433c8ec889997ff)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 17 ++++++++++++++++-
+ sound/soc/sh/rcar/core.c | 23 ++++++++++++++++-------
+ sound/soc/sh/rcar/ssi.c | 14 ++++++++++++++
+ 3 files changed, 46 insertions(+), 8 deletions(-)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index e3d585c67685..698f7b5fc76d 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -36,13 +36,15 @@
+ #define RSND_SSI_CLK_PIN_SHARE (1 << 31)
+ #define RSND_SSI_PLAY (1 << 24)
+
++#define RSND_SSI(_dma_id, _pio_irq, _flags) \
++{ .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
+ #define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
+ { .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
+ #define RSND_SSI_UNUSED \
+ { .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 }
+
+ struct rsnd_ssi_platform_info {
+- int dai_id;
++ int dai_id; /* will be removed */
+ int dma_id;
+ int pio_irq;
+ u32 flags;
+@@ -53,6 +55,8 @@ struct rsnd_ssi_platform_info {
+ */
+ #define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
+
++#define RSND_SCU(rate, _dma_id) \
++{ .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
+ #define RSND_SCU_SET(rate, _dma_id) \
+ { .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
+ #define RSND_SCU_UNUSED \
+@@ -64,6 +68,15 @@ struct rsnd_scu_platform_info {
+ int dma_id; /* for Gen2 SCU */
+ };
+
++struct rsnd_dai_path_info {
++ struct rsnd_ssi_platform_info *ssi;
++};
++
++struct rsnd_dai_platform_info {
++ struct rsnd_dai_path_info playback;
++ struct rsnd_dai_path_info capture;
++};
++
+ /*
+ * flags
+ *
+@@ -81,6 +94,8 @@ struct rcar_snd_info {
+ int ssi_info_nr;
+ struct rsnd_scu_platform_info *scu_info;
+ int scu_info_nr;
++ struct rsnd_dai_platform_info *dai_info;
++ int dai_info_nr;
+ int (*start)(int id);
+ int (*stop)(int id);
+ };
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index ea747614fbf8..450472633eb1 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -639,19 +639,26 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+ struct snd_soc_dai_driver *drv;
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ struct rsnd_dai *rdai;
+ struct rsnd_mod *pmod, *cmod;
+ struct device *dev = rsnd_priv_to_dev(priv);
+- int dai_nr;
++ int dai_nr = info->dai_info_nr;
+ int i;
+
+- /* get max dai nr */
+- for (dai_nr = 0; dai_nr < 32; dai_nr++) {
+- pmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 1);
+- cmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 0);
++ /*
++ * dai_nr should be set via dai_info_nr,
++ * but allow it to keeping compatible
++ */
++ if (!dai_nr) {
++ /* get max dai nr */
++ for (dai_nr = 0; dai_nr < 32; dai_nr++) {
++ pmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 1);
++ cmod = rsnd_ssi_mod_get_frm_dai(priv, dai_nr, 0);
+
+- if (!pmod && !cmod)
+- break;
++ if (!pmod && !cmod)
++ break;
++ }
+ }
+
+ if (!dai_nr) {
+@@ -671,6 +678,8 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ priv->rdai = rdai;
+
+ for (i = 0; i < dai_nr; i++) {
++ if (info->dai_info)
++ rdai[i].info = &info->dai_info[i];
+
+ pmod = rsnd_ssi_mod_get_frm_dai(priv, i, 1);
+ cmod = rsnd_ssi_mod_get_frm_dai(priv, i, 0);
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 25a7d441f8fc..34234813f742 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -451,12 +451,26 @@ static struct rsnd_mod_ops rsnd_ssi_non_ops = {
+ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+ int dai_id, int is_play)
+ {
++ struct rsnd_dai_platform_info *dai_info = NULL;
++ struct rsnd_dai_path_info *path_info = NULL;
++ struct rsnd_ssi_platform_info *target_info = NULL;
+ struct rsnd_ssi *ssi;
+ int i, has_play;
+
++ if (priv->rdai)
++ dai_info = priv->rdai[dai_id].info;
++ if (dai_info)
++ path_info = (is_play) ? &dai_info->playback : &dai_info->capture;
++ if (path_info)
++ target_info = path_info->ssi;
++
+ is_play = !!is_play;
+
+ for_each_rsnd_ssi(ssi, priv, i) {
++ if (target_info == ssi->info)
++ return &ssi->mod;
++
++ /* for compatible */
+ if (rsnd_ssi_dai_id(ssi) != dai_id)
+ continue;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0063-ASoC-rsnd-Get-correct-SCU-ID.patch b/patches.renesas/0063-ASoC-rsnd-Get-correct-SCU-ID.patch
new file mode 100644
index 00000000000000..e0eaad88444969
--- /dev/null
+++ b/patches.renesas/0063-ASoC-rsnd-Get-correct-SCU-ID.patch
@@ -0,0 +1,230 @@
+From 32f2350521c74d71d16b2c8e1f4701903fa6c6cf Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:00 -0800
+Subject: ASoC: rsnd: Get correct SCU ID
+
+Current rsnd driver is assuming that SCU/SRU ID is
+same as SSIU/SSI ID, because Gen1 can't select it.
+But, Gen2 can select it.
+The SCU/SRU/SSIU/SSI pair depends on the platform.
+This patch get correct SCU ID from platform info.
+To keep compatible, it still assuming SCU ID = SSI ID
+if platform doesn't have info
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 389933d9f6e55a1ef3a71549c36f6283b9f8c145)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 1 +
+ sound/soc/sh/rcar/core.c | 47 +++++++++++++++++++++++++++++++++--------------
+ sound/soc/sh/rcar/rsnd.h | 14 ++++++++++++++
+ sound/soc/sh/rcar/scu.c | 21 ++++++++++++++++-----
+ sound/soc/sh/rcar/ssi.c | 9 ++++++++-
+ 5 files changed, 72 insertions(+), 20 deletions(-)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index 698f7b5fc76d..1d8c68323f49 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -70,6 +70,7 @@ struct rsnd_scu_platform_info {
+
+ struct rsnd_dai_path_info {
+ struct rsnd_ssi_platform_info *ssi;
++ struct rsnd_scu_platform_info *scu;
+ };
+
+ struct rsnd_dai_platform_info {
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 450472633eb1..7316d10e4649 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -107,6 +107,11 @@
+ (!(priv->info->func) ? 0 : \
+ priv->info->func(param))
+
++#define rsnd_is_enable_path(io, name) \
++ ((io)->info ? (io)->info->name : NULL)
++#define rsnd_info_id(priv, io, name) \
++ ((io)->info->name - priv->info->name##_info)
++
+ /*
+ * rsnd_mod functions
+ */
+@@ -572,8 +577,10 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_mod *mod;
++ struct rsnd_dai_platform_info *dai_info = rdai->info;
+ int ret;
+- int id;
++ int ssi_id = -1;
++ int scu_id = -1;
+
+ /*
+ * Gen1 is created by SRU/SSI, and this SRU is base module of
+@@ -584,29 +591,35 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ *
+ * Gen2 SCU path is very flexible, but, Gen1 SRU (SCU parts) is
+ * using fixed path.
+- *
+- * Then, SSI id = SCU id here
+ */
+- /* get SSI's ID */
+- mod = rsnd_ssi_mod_get_frm_dai(priv,
+- rsnd_dai_id(priv, rdai),
+- rsnd_dai_is_play(rdai, io));
+- if (!mod)
+- return 0;
+- id = rsnd_mod_id(mod);
++ if (dai_info) {
++ if (rsnd_is_enable_path(io, ssi))
++ ssi_id = rsnd_info_id(priv, io, ssi);
++ if (rsnd_is_enable_path(io, scu))
++ scu_id = rsnd_info_id(priv, io, scu);
++ } else {
++ /* get SSI's ID */
++ mod = rsnd_ssi_mod_get_frm_dai(priv,
++ rsnd_dai_id(priv, rdai),
++ rsnd_dai_is_play(rdai, io));
++ if (!mod)
++ return 0;
++ ssi_id = scu_id = rsnd_mod_id(mod);
++ }
++
+ ret = 0;
+
+ /* SCU */
+- mod = rsnd_scu_mod_get(priv, id);
+- if (mod) {
++ if (scu_id >= 0) {
++ mod = rsnd_scu_mod_get(priv, scu_id);
+ ret = rsnd_dai_connect(mod, io);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* SSI */
+- mod = rsnd_ssi_mod_get(priv, id);
+- if (mod) {
++ if (ssi_id >= 0) {
++ mod = rsnd_ssi_mod_get(priv, ssi_id);
+ ret = rsnd_dai_connect(mod, io);
+ if (ret < 0)
+ return ret;
+@@ -699,6 +712,9 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ drv[i].playback.formats = RSND_FMTS;
+ drv[i].playback.channels_min = 2;
+ drv[i].playback.channels_max = 2;
++
++ if (info->dai_info)
++ rdai[i].playback.info = &info->dai_info[i].playback;
+ rsnd_path_init(priv, &rdai[i], &rdai[i].playback);
+ }
+ if (cmod) {
+@@ -706,6 +722,9 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ drv[i].capture.formats = RSND_FMTS;
+ drv[i].capture.channels_min = 2;
+ drv[i].capture.channels_max = 2;
++
++ if (info->dai_info)
++ rdai[i].capture.info = &info->dai_info[i].capture;
+ rsnd_path_init(priv, &rdai[i], &rdai[i].capture);
+ }
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index d5afdee6b6f2..3472631c7b35 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -211,6 +211,7 @@ char *rsnd_mod_name(struct rsnd_mod *mod);
+ struct rsnd_dai_stream {
+ struct snd_pcm_substream *substream;
+ struct rsnd_mod *mod[RSND_MOD_MAX];
++ struct rsnd_dai_path_info *info; /* rcar_snd.h */
+ int byte_pos;
+ int period_pos;
+ int byte_per_period;
+@@ -328,6 +329,19 @@ struct rsnd_priv {
+ #define rsnd_lock(priv, flags) spin_lock_irqsave(&priv->lock, flags)
+ #define rsnd_unlock(priv, flags) spin_unlock_irqrestore(&priv->lock, flags)
+
++#define rsnd_info_is_playback(priv, type) \
++({ \
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv); \
++ int i, is_play = 0; \
++ for (i = 0; i < info->dai_info_nr; i++) { \
++ if (info->dai_info[i].playback.type == (type)->info) { \
++ is_play = 1; \
++ break; \
++ } \
++ } \
++ is_play; \
++})
++
+ /*
+ * R-Car SCU
+ */
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 1073d35486e3..b517300f32ce 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -620,6 +620,9 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ * init SCU
+ */
+ nr = info->scu_info_nr;
++ if (!nr)
++ return 0;
++
+ scu = devm_kzalloc(dev, sizeof(*scu) * nr, GFP_KERNEL);
+ if (!scu) {
+ dev_err(dev, "SCU allocate failed\n");
+@@ -644,11 +647,19 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ if (rsnd_is_gen1(priv))
+ ops = &rsnd_scu_gen1_ops;
+ if (rsnd_is_gen2(priv)) {
+- struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, i);
+- int ret = rsnd_dma_init(priv,
+- rsnd_mod_to_dma(&scu->mod),
+- rsnd_ssi_is_play(ssi),
+- scu->info->dma_id);
++ int ret;
++ int is_play;
++
++ if (info->dai_info) {
++ is_play = rsnd_info_is_playback(priv, scu);
++ } else {
++ struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, i);
++ is_play = rsnd_ssi_is_play(ssi);
++ }
++ ret = rsnd_dma_init(priv,
++ rsnd_mod_to_dma(&scu->mod),
++ is_play,
++ scu->info->dma_id);
+ if (ret < 0)
+ return ret;
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 34234813f742..9162c2bb6cc5 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -567,9 +567,16 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ * SSI DMA case
+ */
+ if (pinfo->dma_id > 0) {
++ int is_play;
++
++ if (info->dai_info)
++ is_play = rsnd_info_is_playback(priv, ssi);
++ else
++ is_play = rsnd_ssi_is_play(&ssi->mod);
++
+ ret = rsnd_dma_init(
+ priv, rsnd_mod_to_dma(&ssi->mod),
+- rsnd_ssi_is_play(&ssi->mod),
++ is_play,
+ pinfo->dma_id);
+ if (ret < 0)
+ dev_info(dev, "SSI DMA failed. try PIO transter\n");
+--
+2.1.2
+
diff --git a/patches.renesas/0064-ASoC-rsnd-add-rsnd_scu_enable_ssi_irq.patch b/patches.renesas/0064-ASoC-rsnd-add-rsnd_scu_enable_ssi_irq.patch
new file mode 100644
index 00000000000000..9b418a3e2f360e
--- /dev/null
+++ b/patches.renesas/0064-ASoC-rsnd-add-rsnd_scu_enable_ssi_irq.patch
@@ -0,0 +1,101 @@
+From f23b14813256fd6fabdfe545bb3770bec2bd43ba Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:08 -0800
+Subject: ASoC: rsnd: add rsnd_scu_enable_ssi_irq()
+
+Current R-Car sound driver is assuming that
+SCU mod is used even though it is not needed.
+Because scu.c is controlling SSIU too.
+(it is Gen1 compatibility)
+But, SCU mod will be really not used if new platform dai
+feature was used.
+Thus, SSIU irq setting is called from SSI
+directory by this patch.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit b8cc41e9e8cc5beec9dcbe044cfc44aa0325d9e6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 3 +++
+ sound/soc/sh/rcar/scu.c | 26 +++++++++++++-------------
+ sound/soc/sh/rcar/ssi.c | 2 ++
+ 3 files changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 3472631c7b35..3b71b77c4fd8 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -353,6 +353,9 @@ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime);
++int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io);
+
+ #define rsnd_scu_nr(priv) ((priv)->scu_nr)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index b517300f32ce..8ce79e855cf0 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -165,6 +165,19 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ return 0;
+ }
+
++int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
++
++ /* enable PIO interrupt if Gen2 */
++ if (rsnd_is_gen2(priv))
++ rsnd_mod_write(ssi_mod, INT_ENABLE, 0x0f000000);
++
++ return 0;
++}
++
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime)
+@@ -579,22 +592,9 @@ static struct rsnd_mod_ops rsnd_scu_gen2_ops = {
+ .stop = rsnd_scu_stop_gen2,
+ };
+
+-static int rsnd_scu_start_non_gen2(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
+-
+- /* enable PIO interrupt */
+- rsnd_mod_write(ssi_mod, INT_ENABLE, 0x0f000000);
+-
+- return 0;
+-}
+-
+ static struct rsnd_mod_ops rsnd_scu_non_gen2_ops = {
+ .name = "non-scu (gen2)",
+ .init = rsnd_scu_ssi_mode_init,
+- .start = rsnd_scu_start_non_gen2,
+ };
+
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 9162c2bb6cc5..a74c7a789b2b 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -365,6 +365,8 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+ /* enable PIO IRQ */
+ ssi->cr_etc = UIEN | OIEN | DIEN;
+
++ rsnd_scu_enable_ssi_irq(mod, rdai, io);
++
+ rsnd_ssi_hw_start(ssi, rdai, io);
+
+ return 0;
+--
+2.1.2
+
diff --git a/patches.renesas/0065-ASoC-rsnd-call-rsnd_scu_ssi_mode_init-from-SSI.patch b/patches.renesas/0065-ASoC-rsnd-call-rsnd_scu_ssi_mode_init-from-SSI.patch
new file mode 100644
index 00000000000000..aa3b148e3b0440
--- /dev/null
+++ b/patches.renesas/0065-ASoC-rsnd-call-rsnd_scu_ssi_mode_init-from-SSI.patch
@@ -0,0 +1,163 @@
+From e752d94624b82b5926740ed3dcf0b65aad83d521 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:24 -0800
+Subject: ASoC: rsnd: call rsnd_scu_ssi_mode_init() from SSI
+
+Current R-Car sound driver is assuming that
+SCU mod is used even though it is not needed.
+Because scu.c is controlling SSIU too.
+(it is Gen1 compatibility)
+But, SCU mod will be really not used if new platform dai
+feature was added.
+Thus, rsnd_scu_ssi_mode_init() is called from SSI
+directory by this patch.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 221bf523e31306c1095b28932e079950108e3887)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/rsnd.h | 3 +++
+ sound/soc/sh/rcar/scu.c | 54 +++++++++++++++---------------------------------
+ sound/soc/sh/rcar/ssi.c | 2 ++
+ 3 files changed, 22 insertions(+), 37 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 3b71b77c4fd8..9205f96da2f4 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -353,6 +353,9 @@ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime);
++int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io);
+ int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io);
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 8ce79e855cf0..63e6aeb8c42d 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -115,28 +115,28 @@ struct rsnd_scu {
+ /*
+ * Gen1/Gen2 common functions
+ */
+-static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
++int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
++ struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
++ struct rsnd_mod *scu_mod = rsnd_io_to_mod_scu(io);
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ int ssi_id = rsnd_mod_id(ssi_mod);
+- u32 convert_rate = rsnd_scu_convert_rate(scu);
+-
+- if (convert_rate && !rsnd_dai_is_clk_master(rdai)) {
+- struct device *dev = rsnd_priv_to_dev(priv);
+-
+- dev_err(dev, "rsnd should be clk master when you rate convert\n");
+- return -EINVAL;
+- }
++ int has_scu = 0;
+
+ /*
+ * SSI_MODE0
+ */
+- rsnd_mod_bset(mod, SSI_MODE0, (1 << ssi_id),
+- rsnd_scu_hpbif_is_enable(scu) ? 0 : (1 << ssi_id));
++ if (info->dai_info) {
++ has_scu = !!scu_mod;
++ } else {
++ struct rsnd_scu *scu = rsnd_mod_to_scu(scu_mod);
++ has_scu = rsnd_scu_hpbif_is_enable(scu);
++ }
++
++ rsnd_mod_bset(ssi_mod, SSI_MODE0, (1 << ssi_id),
++ has_scu ? 0 : (1 << ssi_id));
+
+ /*
+ * SSI_MODE1
+@@ -156,7 +156,7 @@ static int rsnd_scu_ssi_mode_init(struct rsnd_mod *mod,
+ }
+
+ if (shift >= 0)
+- rsnd_mod_bset(mod, SSI_MODE1,
++ rsnd_mod_bset(ssi_mod, SSI_MODE1,
+ 0x3 << shift,
+ rsnd_dai_is_clk_master(rdai) ?
+ 0x2 << shift : 0x1 << shift);
+@@ -253,14 +253,9 @@ static int rsnd_scu_init(struct rsnd_mod *mod,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- int ret;
+
+ clk_enable(scu->clk);
+
+- ret = rsnd_scu_ssi_mode_init(mod, rdai, io);
+- if (ret < 0)
+- return ret;
+-
+ return 0;
+ }
+
+@@ -487,11 +482,6 @@ static struct rsnd_mod_ops rsnd_scu_gen1_ops = {
+ .stop = rsnd_scu_stop_gen1,
+ };
+
+-static struct rsnd_mod_ops rsnd_scu_non_gen1_ops = {
+- .name = "non-sru (gen1)",
+- .init = rsnd_scu_ssi_mode_init,
+-};
+-
+ /*
+ * Gen2 functions
+ */
+@@ -592,11 +582,6 @@ static struct rsnd_mod_ops rsnd_scu_gen2_ops = {
+ .stop = rsnd_scu_stop_gen2,
+ };
+
+-static struct rsnd_mod_ops rsnd_scu_non_gen2_ops = {
+- .name = "non-scu (gen2)",
+- .init = rsnd_scu_ssi_mode_init,
+-};
+-
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
+ {
+ if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
+@@ -665,11 +650,6 @@ int rsnd_scu_probe(struct platform_device *pdev,
+
+ ops = &rsnd_scu_gen2_ops;
+ }
+- } else {
+- if (rsnd_is_gen1(priv))
+- ops = &rsnd_scu_non_gen1_ops;
+- if (rsnd_is_gen2(priv))
+- ops = &rsnd_scu_non_gen2_ops;
+ }
+
+ rsnd_mod_init(priv, &scu->mod, ops, RSND_MOD_SCU, i);
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index a74c7a789b2b..a7df216a46da 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -287,6 +287,8 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ ssi->cr_own = cr;
+ ssi->err = -1; /* ignore 1st error */
+
++ rsnd_scu_ssi_mode_init(mod, rdai, io);
++
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0066-ASoC-rsnd-add-probe-remove-callback-on-rsnd_mod_ops.patch b/patches.renesas/0066-ASoC-rsnd-add-probe-remove-callback-on-rsnd_mod_ops.patch
new file mode 100644
index 00000000000000..531534d8590c7f
--- /dev/null
+++ b/patches.renesas/0066-ASoC-rsnd-add-probe-remove-callback-on-rsnd_mod_ops.patch
@@ -0,0 +1,90 @@
+From 10259368bab3428b333562bdbe43fc8549992367 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:33 -0800
+Subject: ASoC: rsnd: add probe/remove callback on rsnd_mod_ops
+
+Each rsnd mod needs specific probe method,
+and its best timing is DAI probe timing.
+But current code runs it mod probe timing.
+This patch adds new probe/remove callback to solve it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 7681f6ac6b6338932621f842d68e54f6267b785f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 23 +++++++++++++++++++++++
+ sound/soc/sh/rcar/rsnd.h | 6 ++++++
+ 2 files changed, 29 insertions(+)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 7316d10e4649..e8e585de7251 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -842,6 +842,7 @@ static int rsnd_probe(struct platform_device *pdev)
+ struct rcar_snd_info *info;
+ struct rsnd_priv *priv;
+ struct device *dev = &pdev->dev;
++ struct rsnd_dai *rdai;
+ int (*probe_func[])(struct platform_device *pdev,
+ struct rsnd_priv *priv) = {
+ rsnd_gen_probe,
+@@ -880,6 +881,16 @@ static int rsnd_probe(struct platform_device *pdev)
+ return ret;
+ }
+
++ for_each_rsnd_dai(rdai, priv, i) {
++ ret = rsnd_dai_call(rdai, &rdai->playback, probe);
++ if (ret)
++ return ret;
++
++ ret = rsnd_dai_call(rdai, &rdai->capture, probe);
++ if (ret)
++ return ret;
++ }
++
+ /*
+ * asoc register
+ */
+@@ -912,9 +923,21 @@ exit_snd_soc:
+ static int rsnd_remove(struct platform_device *pdev)
+ {
+ struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
++ struct rsnd_dai *rdai;
++ int ret, i;
+
+ pm_runtime_disable(&pdev->dev);
+
++ for_each_rsnd_dai(rdai, priv, i) {
++ ret = rsnd_dai_call(rdai, &rdai->playback, remove);
++ if (ret)
++ return ret;
++
++ ret = rsnd_dai_call(rdai, &rdai->capture, remove);
++ if (ret)
++ return ret;
++ }
++
+ /*
+ * remove each module
+ */
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 9205f96da2f4..db20b3721953 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -167,6 +167,12 @@ enum rsnd_mod_type {
+
+ struct rsnd_mod_ops {
+ char *name;
++ int (*probe)(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io);
++ int (*remove)(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io);
+ int (*init)(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io);
+--
+2.1.2
+
diff --git a/patches.renesas/0067-ASoC-rsnd-use-mod-probe-method-on-SCU.patch b/patches.renesas/0067-ASoC-rsnd-use-mod-probe-method-on-SCU.patch
new file mode 100644
index 00000000000000..73356bd78ee39b
--- /dev/null
+++ b/patches.renesas/0067-ASoC-rsnd-use-mod-probe-method-on-SCU.patch
@@ -0,0 +1,113 @@
+From 488036d1719f640f437ee19850688a695d3702d8 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:41 -0800
+Subject: ASoC: rsnd: use mod probe method on SCU
+
+Now, it can use .probe
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 76c6fb5c49790da44d553f655182b426ade2c599)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/scu.c | 64 ++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 39 insertions(+), 25 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 63e6aeb8c42d..40250acf608d 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -525,6 +525,42 @@ static int rsnd_scu_set_convert_timing_gen2(struct rsnd_mod *mod,
+ return ret;
+ }
+
++static int rsnd_scu_probe_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
++ struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, rsnd_mod_id(mod));
++ struct device *dev = rsnd_priv_to_dev(priv);
++ int ret;
++ int is_play;
++
++ if (info->dai_info)
++ is_play = rsnd_info_is_playback(priv, scu);
++ else
++ is_play = rsnd_ssi_is_play(ssi);
++
++ ret = rsnd_dma_init(priv,
++ rsnd_mod_to_dma(mod),
++ is_play,
++ scu->info->dma_id);
++ if (ret < 0)
++ dev_err(dev, "SCU DMA failed\n");
++
++ return ret;
++}
++
++static int rsnd_scu_remove_gen2(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod));
++
++ return 0;
++}
++
+ static int rsnd_scu_init_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -576,6 +612,8 @@ static int rsnd_scu_stop_gen2(struct rsnd_mod *mod,
+
+ static struct rsnd_mod_ops rsnd_scu_gen2_ops = {
+ .name = "scu (gen2)",
++ .probe = rsnd_scu_probe_gen2,
++ .remove = rsnd_scu_remove_gen2,
+ .init = rsnd_scu_init_gen2,
+ .quit = rsnd_scu_quit,
+ .start = rsnd_scu_start_gen2,
+@@ -631,25 +669,8 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ if (rsnd_scu_hpbif_is_enable(scu)) {
+ if (rsnd_is_gen1(priv))
+ ops = &rsnd_scu_gen1_ops;
+- if (rsnd_is_gen2(priv)) {
+- int ret;
+- int is_play;
+-
+- if (info->dai_info) {
+- is_play = rsnd_info_is_playback(priv, scu);
+- } else {
+- struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, i);
+- is_play = rsnd_ssi_is_play(ssi);
+- }
+- ret = rsnd_dma_init(priv,
+- rsnd_mod_to_dma(&scu->mod),
+- is_play,
+- scu->info->dma_id);
+- if (ret < 0)
+- return ret;
+-
++ if (rsnd_is_gen2(priv))
+ ops = &rsnd_scu_gen2_ops;
+- }
+ }
+
+ rsnd_mod_init(priv, &scu->mod, ops, RSND_MOD_SCU, i);
+@@ -663,11 +684,4 @@ int rsnd_scu_probe(struct platform_device *pdev,
+ void rsnd_scu_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+- struct rsnd_scu *scu;
+- int i;
+-
+- for_each_rsnd_scu(scu, priv, i) {
+- if (rsnd_scu_dma_available(scu))
+- rsnd_dma_quit(priv, rsnd_mod_to_dma(&scu->mod));
+- }
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0068-ASoC-rsnd-use-mod-probe-method-on-SSI.patch b/patches.renesas/0068-ASoC-rsnd-use-mod-probe-method-on-SSI.patch
new file mode 100644
index 00000000000000..50a4b75896b238
--- /dev/null
+++ b/patches.renesas/0068-ASoC-rsnd-use-mod-probe-method-on-SSI.patch
@@ -0,0 +1,184 @@
+From 24141ff81310489083f92a04483b67a49390165b Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:50:49 -0800
+Subject: ASoC: rsnd: use mod probe method on SSI
+
+Now, it can use .probe
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ff8f30e688477beead6d1e648fb11f321220a4d7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/ssi.c | 116 +++++++++++++++++++++++++++---------------------
+ 1 file changed, 65 insertions(+), 51 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index a7df216a46da..0f3eeac56155 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -358,6 +358,26 @@ static irqreturn_t rsnd_ssi_pio_interrupt(int irq, void *data)
+ return ret;
+ }
+
++static int rsnd_ssi_pio_probe(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct device *dev = rsnd_priv_to_dev(priv);
++ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
++ int irq = ssi->info->pio_irq;
++ int ret;
++
++ ret = devm_request_irq(dev, irq,
++ rsnd_ssi_pio_interrupt,
++ IRQF_SHARED,
++ dev_name(dev), ssi);
++ if (ret)
++ dev_err(dev, "SSI request interrupt failed\n");
++
++ return ret;
++}
++
+ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -389,12 +409,50 @@ static int rsnd_ssi_pio_stop(struct rsnd_mod *mod,
+
+ static struct rsnd_mod_ops rsnd_ssi_pio_ops = {
+ .name = "ssi (pio)",
++ .probe = rsnd_ssi_pio_probe,
+ .init = rsnd_ssi_init,
+ .quit = rsnd_ssi_quit,
+ .start = rsnd_ssi_pio_start,
+ .stop = rsnd_ssi_pio_stop,
+ };
+
++static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
++ struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
++ struct device *dev = rsnd_priv_to_dev(priv);
++ int dma_id = ssi->info->dma_id;
++ int is_play;
++ int ret;
++
++ if (info->dai_info)
++ is_play = rsnd_info_is_playback(priv, ssi);
++ else
++ is_play = rsnd_ssi_is_play(&ssi->mod);
++
++ ret = rsnd_dma_init(
++ priv, rsnd_mod_to_dma(mod),
++ is_play,
++ dma_id);
++
++ if (ret < 0)
++ dev_err(dev, "SSI DMA failed\n");
++
++ return ret;
++}
++
++static int rsnd_ssi_dma_remove(struct rsnd_mod *mod,
++ struct rsnd_dai *rdai,
++ struct rsnd_dai_stream *io)
++{
++ rsnd_dma_quit(rsnd_mod_to_priv(mod), rsnd_mod_to_dma(mod));
++
++ return 0;
++}
++
+ static int rsnd_ssi_dma_start(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+@@ -436,6 +494,8 @@ static int rsnd_ssi_dma_stop(struct rsnd_mod *mod,
+
+ static struct rsnd_mod_ops rsnd_ssi_dma_ops = {
+ .name = "ssi (dma)",
++ .probe = rsnd_ssi_dma_probe,
++ .remove = rsnd_ssi_dma_remove,
+ .init = rsnd_ssi_init,
+ .quit = rsnd_ssi_quit,
+ .start = rsnd_ssi_dma_start,
+@@ -538,7 +598,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ struct clk *clk;
+ struct rsnd_ssi *ssi;
+ char name[RSND_SSI_NAME_SIZE];
+- int i, nr, ret;
++ int i, nr;
+
+ /*
+ * init SSI
+@@ -566,48 +626,10 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ ssi->clk = clk;
+
+ ops = &rsnd_ssi_non_ops;
+-
+- /*
+- * SSI DMA case
+- */
+- if (pinfo->dma_id > 0) {
+- int is_play;
+-
+- if (info->dai_info)
+- is_play = rsnd_info_is_playback(priv, ssi);
+- else
+- is_play = rsnd_ssi_is_play(&ssi->mod);
+-
+- ret = rsnd_dma_init(
+- priv, rsnd_mod_to_dma(&ssi->mod),
+- is_play,
+- pinfo->dma_id);
+- if (ret < 0)
+- dev_info(dev, "SSI DMA failed. try PIO transter\n");
+- else
+- ops = &rsnd_ssi_dma_ops;
+-
+- dev_dbg(dev, "SSI%d use DMA transfer\n", i);
+- }
+-
+- /*
+- * SSI PIO case
+- */
+- if (!rsnd_ssi_dma_available(ssi) &&
+- rsnd_ssi_pio_available(ssi)) {
+- ret = devm_request_irq(dev, pinfo->pio_irq,
+- &rsnd_ssi_pio_interrupt,
+- IRQF_SHARED,
+- dev_name(dev), ssi);
+- if (ret) {
+- dev_err(dev, "SSI request interrupt failed\n");
+- return ret;
+- }
+-
+- ops = &rsnd_ssi_pio_ops;
+-
+- dev_dbg(dev, "SSI%d use PIO transfer\n", i);
+- }
++ if (pinfo->dma_id > 0)
++ ops = &rsnd_ssi_dma_ops;
++ else if (rsnd_ssi_pio_available(ssi))
++ ops = &rsnd_ssi_pio_ops;
+
+ rsnd_mod_init(priv, &ssi->mod, ops, RSND_MOD_SSI, i);
+
+@@ -620,12 +642,4 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ void rsnd_ssi_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+- struct rsnd_ssi *ssi;
+- int i;
+-
+- for_each_rsnd_ssi(ssi, priv, i) {
+- if (rsnd_ssi_dma_available(ssi))
+- rsnd_dma_quit(priv, rsnd_mod_to_dma(&ssi->mod));
+- }
+-
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0069-ASoC-rsnd-nothing-to-do-on-rsnd_dai_remove.patch b/patches.renesas/0069-ASoC-rsnd-nothing-to-do-on-rsnd_dai_remove.patch
new file mode 100644
index 00000000000000..4aa44d2c9e1545
--- /dev/null
+++ b/patches.renesas/0069-ASoC-rsnd-nothing-to-do-on-rsnd_dai_remove.patch
@@ -0,0 +1,82 @@
+From 35359c1b34f1f23251dd59f1d760fe3a35c73e99 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:51:03 -0800
+Subject: ASoC: rsnd: nothing to do on rsnd_dai_remove()
+
+rsnd_dai_remove() called rsnd_path_exit(),
+but these memory will be cleaned automatically.
+Because it is created by devm_kzalloc().
+nothing to do on rsnd_dai_remove()
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 4076220767416b8b65009dd57eeb317c38d41baa)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 36 ------------------------------------
+ 1 file changed, 36 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index e8e585de7251..92e155b7b6a7 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -348,14 +348,6 @@ static int rsnd_dai_connect(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_dai_disconnect(struct rsnd_mod *mod, struct rsnd_dai_stream *io)
+-{
+- io->mod[mod->type] = NULL;
+- mod->io = NULL;
+-
+- return 0;
+-}
+-
+ int rsnd_dai_id(struct rsnd_priv *priv, struct rsnd_dai *rdai)
+ {
+ int id = rdai - priv->rdai;
+@@ -628,26 +620,6 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ return ret;
+ }
+
+-static int rsnd_path_exit(struct rsnd_priv *priv,
+- struct rsnd_dai *rdai,
+- struct rsnd_dai_stream *io)
+-{
+- struct rsnd_mod *mod;
+- int ret = 0, i;
+-
+- /*
+- * remove all mod from rdai
+- */
+- for (i = 0; i < RSND_MOD_MAX; i++) {
+- mod = io->mod[i];
+- if (!mod)
+- continue;
+- ret |= rsnd_dai_disconnect(mod, io);
+- }
+-
+- return ret;
+-}
+-
+ static int rsnd_dai_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+@@ -739,14 +711,6 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ static void rsnd_dai_remove(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+- struct rsnd_dai *rdai;
+- int i;
+-
+- for (i = 0; i < rsnd_rdai_nr(priv); i++) {
+- rdai = rsnd_dai_get(priv, i);
+- rsnd_path_exit(priv, rdai, &rdai->playback);
+- rsnd_path_exit(priv, rdai, &rdai->capture);
+- }
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0070-ASoC-rsnd-remove-all-rsnd_xxx_remove.patch b/patches.renesas/0070-ASoC-rsnd-remove-all-rsnd_xxx_remove.patch
new file mode 100644
index 00000000000000..e188cc42fc080e
--- /dev/null
+++ b/patches.renesas/0070-ASoC-rsnd-remove-all-rsnd_xxx_remove.patch
@@ -0,0 +1,148 @@
+From ecdd264f4c8a0887884cf96f36158742b01d3fb3 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:51:11 -0800
+Subject: ASoC: rsnd: remove all rsnd_xxx_remove()
+
+Now, rsnd_xxx_remove() do nothing.
+remove these
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9524be0e761edd9f3c020344677d914ed249d010)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/adg.c | 5 -----
+ sound/soc/sh/rcar/core.c | 14 --------------
+ sound/soc/sh/rcar/gen.c | 5 -----
+ sound/soc/sh/rcar/rsnd.h | 8 --------
+ sound/soc/sh/rcar/scu.c | 5 -----
+ sound/soc/sh/rcar/ssi.c | 5 -----
+ 6 files changed, 42 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 8df00ac3b120..953f1cce982d 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -454,8 +454,3 @@ int rsnd_adg_probe(struct platform_device *pdev,
+
+ return 0;
+ }
+-
+-void rsnd_adg_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv)
+-{
+-}
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 92e155b7b6a7..ceb4e8bd4970 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -708,11 +708,6 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ return 0;
+ }
+
+-static void rsnd_dai_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv)
+-{
+-}
+-
+ /*
+ * pcm ops
+ */
+@@ -902,15 +897,6 @@ static int rsnd_remove(struct platform_device *pdev)
+ return ret;
+ }
+
+- /*
+- * remove each module
+- */
+- rsnd_ssi_remove(pdev, priv);
+- rsnd_adg_remove(pdev, priv);
+- rsnd_scu_remove(pdev, priv);
+- rsnd_dai_remove(pdev, priv);
+- rsnd_gen_remove(pdev, priv);
+-
+ return 0;
+ }
+
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 92d1bc9acef0..9094970dbdfb 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -385,8 +385,3 @@ int rsnd_gen_probe(struct platform_device *pdev,
+
+ return ret;
+ }
+-
+-void rsnd_gen_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv)
+-{
+-}
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index db20b3721953..878dc6e20ff2 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -261,8 +261,6 @@ int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
+ */
+ int rsnd_gen_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-void rsnd_gen_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv);
+ void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ enum rsnd_reg reg);
+@@ -276,8 +274,6 @@ int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod);
+ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate);
+ int rsnd_adg_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-void rsnd_adg_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv);
+ int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+ unsigned int src_rate,
+@@ -353,8 +349,6 @@ struct rsnd_priv {
+ */
+ int rsnd_scu_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-void rsnd_scu_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+ unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+@@ -373,8 +367,6 @@ int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ */
+ int rsnd_ssi_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-void rsnd_ssi_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
+ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+ int dai_id, int is_play);
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/scu.c
+index 40250acf608d..3526a5c2f608 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/scu.c
+@@ -680,8 +680,3 @@ int rsnd_scu_probe(struct platform_device *pdev,
+
+ return 0;
+ }
+-
+-void rsnd_scu_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv)
+-{
+-}
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 0f3eeac56155..45f828ded935 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -638,8 +638,3 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+
+ return 0;
+ }
+-
+-void rsnd_ssi_remove(struct platform_device *pdev,
+- struct rsnd_priv *priv)
+-{
+-}
+--
+2.1.2
+
diff --git a/patches.renesas/0071-ASoC-rsnd-rename-scu-to-src.patch b/patches.renesas/0071-ASoC-rsnd-rename-scu-to-src.patch
new file mode 100644
index 00000000000000..63c6cd99612c6e
--- /dev/null
+++ b/patches.renesas/0071-ASoC-rsnd-rename-scu-to-src.patch
@@ -0,0 +1,907 @@
+From ef5ed63c953f1799ff6bff09ee39454eca3d3012 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 3 Mar 2014 20:51:21 -0800
+Subject: ASoC: rsnd: rename scu to src
+
+R-Car sound has SCU unit which has SRC/CTU/MIX/DVC,
+and current rsnd driver has scu.c and scu module.
+Current scu.c has SRC support only.
+My first concept was control these feature on scu.c
+but, it become difficult and un-understandable now.
+This patch rename scu to src
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ba9c949f797aa3af56303445812a452144c61c35)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/rcar_snd.h | 18 ++-
+ sound/soc/sh/rcar/Makefile | 2 +-
+ sound/soc/sh/rcar/core.c | 26 ++--
+ sound/soc/sh/rcar/rsnd.h | 24 ++--
+ sound/soc/sh/rcar/{scu.c => src.c} | 265 +++++++++++++++++++------------------
+ sound/soc/sh/rcar/ssi.c | 6 +-
+ 6 files changed, 175 insertions(+), 166 deletions(-)
+ rename sound/soc/sh/rcar/{scu.c => src.c} (63%)
+
+diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
+index 1d8c68323f49..34a3c02a4576 100644
+--- a/include/sound/rcar_snd.h
++++ b/include/sound/rcar_snd.h
+@@ -55,14 +55,18 @@ struct rsnd_ssi_platform_info {
+ */
+ #define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
+
+-#define RSND_SCU(rate, _dma_id) \
++#define RSND_SRC(rate, _dma_id) \
+ { .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
+-#define RSND_SCU_SET(rate, _dma_id) \
++#define RSND_SRC_SET(rate, _dma_id) \
+ { .flags = RSND_SCU_USE_HPBIF, .convert_rate = rate, .dma_id = _dma_id, }
+-#define RSND_SCU_UNUSED \
++#define RSND_SRC_UNUSED \
+ { .flags = 0, .convert_rate = 0, .dma_id = 0, }
+
+-struct rsnd_scu_platform_info {
++#define rsnd_scu_platform_info rsnd_src_platform_info
++#define src_info scu_info
++#define src_info_nr scu_info_nr
++
++struct rsnd_src_platform_info {
+ u32 flags;
+ u32 convert_rate; /* sampling rate convert */
+ int dma_id; /* for Gen2 SCU */
+@@ -70,7 +74,7 @@ struct rsnd_scu_platform_info {
+
+ struct rsnd_dai_path_info {
+ struct rsnd_ssi_platform_info *ssi;
+- struct rsnd_scu_platform_info *scu;
++ struct rsnd_src_platform_info *src;
+ };
+
+ struct rsnd_dai_platform_info {
+@@ -93,8 +97,8 @@ struct rcar_snd_info {
+ u32 flags;
+ struct rsnd_ssi_platform_info *ssi_info;
+ int ssi_info_nr;
+- struct rsnd_scu_platform_info *scu_info;
+- int scu_info_nr;
++ struct rsnd_src_platform_info *src_info;
++ int src_info_nr;
+ struct rsnd_dai_platform_info *dai_info;
+ int dai_info_nr;
+ int (*start)(int id);
+diff --git a/sound/soc/sh/rcar/Makefile b/sound/soc/sh/rcar/Makefile
+index 0ff492df7929..7d0051ced838 100644
+--- a/sound/soc/sh/rcar/Makefile
++++ b/sound/soc/sh/rcar/Makefile
+@@ -1,2 +1,2 @@
+-snd-soc-rcar-objs := core.o gen.o scu.o adg.o ssi.o
++snd-soc-rcar-objs := core.o gen.o src.o adg.o ssi.o
+ obj-$(CONFIG_SND_SOC_RCAR) += snd-soc-rcar.o
+\ No newline at end of file
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index ceb4e8bd4970..6a1b45df8101 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -73,13 +73,13 @@
+ * | +- ssi[2]
+ * | ...
+ * |
+- * | ** these control scu
++ * | ** these control src
+ * |
+- * +- scu
++ * +- src
+ * |
+- * +- scu[0]
+- * +- scu[1]
+- * +- scu[2]
++ * +- src[0]
++ * +- src[1]
++ * +- src[2]
+ * ...
+ *
+ *
+@@ -572,7 +572,7 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ struct rsnd_dai_platform_info *dai_info = rdai->info;
+ int ret;
+ int ssi_id = -1;
+- int scu_id = -1;
++ int src_id = -1;
+
+ /*
+ * Gen1 is created by SRU/SSI, and this SRU is base module of
+@@ -587,8 +587,8 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ if (dai_info) {
+ if (rsnd_is_enable_path(io, ssi))
+ ssi_id = rsnd_info_id(priv, io, ssi);
+- if (rsnd_is_enable_path(io, scu))
+- scu_id = rsnd_info_id(priv, io, scu);
++ if (rsnd_is_enable_path(io, src))
++ src_id = rsnd_info_id(priv, io, src);
+ } else {
+ /* get SSI's ID */
+ mod = rsnd_ssi_mod_get_frm_dai(priv,
+@@ -596,14 +596,14 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ rsnd_dai_is_play(rdai, io));
+ if (!mod)
+ return 0;
+- ssi_id = scu_id = rsnd_mod_id(mod);
++ ssi_id = src_id = rsnd_mod_id(mod);
+ }
+
+ ret = 0;
+
+- /* SCU */
+- if (scu_id >= 0) {
+- mod = rsnd_scu_mod_get(priv, scu_id);
++ /* SRC */
++ if (src_id >= 0) {
++ mod = rsnd_src_mod_get(priv, src_id);
+ ret = rsnd_dai_connect(mod, io);
+ if (ret < 0)
+ return ret;
+@@ -806,7 +806,7 @@ static int rsnd_probe(struct platform_device *pdev)
+ struct rsnd_priv *priv) = {
+ rsnd_gen_probe,
+ rsnd_ssi_probe,
+- rsnd_scu_probe,
++ rsnd_src_probe,
+ rsnd_adg_probe,
+ rsnd_dai_probe,
+ };
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index 878dc6e20ff2..c46e0afa54ae 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -160,7 +160,7 @@ void rsnd_dma_quit(struct rsnd_priv *priv,
+ * R-Car sound mod
+ */
+ enum rsnd_mod_type {
+- RSND_MOD_SCU = 0,
++ RSND_MOD_SRC = 0,
+ RSND_MOD_SSI,
+ RSND_MOD_MAX,
+ };
+@@ -224,7 +224,7 @@ struct rsnd_dai_stream {
+ int next_period_byte;
+ };
+ #define rsnd_io_to_mod_ssi(io) ((io)->mod[RSND_MOD_SSI])
+-#define rsnd_io_to_mod_scu(io) ((io)->mod[RSND_MOD_SCU])
++#define rsnd_io_to_mod_src(io) ((io)->mod[RSND_MOD_SRC])
+
+ struct rsnd_dai {
+ char name[RSND_DAI_NAME_SIZE];
+@@ -302,10 +302,10 @@ struct rsnd_priv {
+ void *gen;
+
+ /*
+- * below value will be filled on rsnd_scu_probe()
++ * below value will be filled on rsnd_src_probe()
+ */
+- void *scu;
+- int scu_nr;
++ void *src;
++ int src_nr;
+
+ /*
+ * below value will be filled on rsnd_adg_probe()
+@@ -345,22 +345,22 @@ struct rsnd_priv {
+ })
+
+ /*
+- * R-Car SCU
++ * R-Car SRC
+ */
+-int rsnd_scu_probe(struct platform_device *pdev,
++int rsnd_src_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv);
+-struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id);
+-unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
++struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id);
++unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime);
+-int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
++int rsnd_src_ssi_mode_init(struct rsnd_mod *ssi_mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io);
+-int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
++int rsnd_src_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io);
+
+-#define rsnd_scu_nr(priv) ((priv)->scu_nr)
++#define rsnd_src_nr(priv) ((priv)->src_nr)
+
+ /*
+ * R-Car SSI
+diff --git a/sound/soc/sh/rcar/scu.c b/sound/soc/sh/rcar/src.c
+similarity index 63%
+rename from sound/soc/sh/rcar/scu.c
+rename to sound/soc/sh/rcar/src.c
+index 3526a5c2f608..ea6a214985d0 100644
+--- a/sound/soc/sh/rcar/scu.c
++++ b/sound/soc/sh/rcar/src.c
+@@ -1,5 +1,5 @@
+ /*
+- * Renesas R-Car SCU support
++ * Renesas R-Car SRC support
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+@@ -10,13 +10,13 @@
+ */
+ #include "rsnd.h"
+
+-struct rsnd_scu {
+- struct rsnd_scu_platform_info *info; /* rcar_snd.h */
++struct rsnd_src {
++ struct rsnd_src_platform_info *info; /* rcar_snd.h */
+ struct rsnd_mod mod;
+ struct clk *clk;
+ };
+
+-#define RSND_SCU_NAME_SIZE 16
++#define RSND_SRC_NAME_SIZE 16
+
+ /*
+ * ADINR
+@@ -27,19 +27,19 @@ struct rsnd_scu {
+ #define OTBL_18 (6 << 16)
+ #define OTBL_16 (8 << 16)
+
+-#define rsnd_scu_mode_flags(p) ((p)->info->flags)
+-#define rsnd_scu_convert_rate(p) ((p)->info->convert_rate)
+-#define rsnd_mod_to_scu(_mod) \
+- container_of((_mod), struct rsnd_scu, mod)
+-#define rsnd_scu_hpbif_is_enable(scu) \
+- (rsnd_scu_mode_flags(scu) & RSND_SCU_USE_HPBIF)
+-#define rsnd_scu_dma_available(scu) \
+- rsnd_dma_available(rsnd_mod_to_dma(&(scu)->mod))
++#define rsnd_src_mode_flags(p) ((p)->info->flags)
++#define rsnd_src_convert_rate(p) ((p)->info->convert_rate)
++#define rsnd_mod_to_src(_mod) \
++ container_of((_mod), struct rsnd_src, mod)
++#define rsnd_src_hpbif_is_enable(src) \
++ (rsnd_src_mode_flags(src) & RSND_SCU_USE_HPBIF)
++#define rsnd_src_dma_available(src) \
++ rsnd_dma_available(rsnd_mod_to_dma(&(src)->mod))
+
+-#define for_each_rsnd_scu(pos, priv, i) \
++#define for_each_rsnd_src(pos, priv, i) \
+ for ((i) = 0; \
+- ((i) < rsnd_scu_nr(priv)) && \
+- ((pos) = (struct rsnd_scu *)(priv)->scu + i); \
++ ((i) < rsnd_src_nr(priv)) && \
++ ((pos) = (struct rsnd_src *)(priv)->src + i); \
+ i++)
+
+
+@@ -54,7 +54,7 @@ struct rsnd_scu {
+ */
+
+ /*
+- * scu.c is caring...
++ * src.c is caring...
+ *
+ * Gen1
+ *
+@@ -63,7 +63,7 @@ struct rsnd_scu {
+ *
+ * Gen2
+ *
+- * [mem] -> [SCU] -> [SSIU] -> [SSI]
++ * [mem] -> [SRC] -> [SSIU] -> [SSI]
+ * |-----------------|
+ */
+
+@@ -79,34 +79,34 @@ struct rsnd_scu {
+ * but SRC bypass mode needs SSI_MODE0 only.
+ *
+ * This driver request
+- * struct rsnd_scu_platform_info {
++ * struct rsnd_src_platform_info {
+ * u32 flags;
+ * u32 convert_rate;
+ * }
+ *
+- * rsnd_scu_hpbif_is_enable() will be true
+- * if flags had RSND_SCU_USE_HPBIF,
++ * rsnd_src_hpbif_is_enable() will be true
++ * if flags had RSND_SRC_USE_HPBIF,
+ * and it controls whether SSIU is used or not.
+ *
+- * rsnd_scu_convert_rate() indicates
++ * rsnd_src_convert_rate() indicates
+ * above convert_rate, and it controls
+ * whether SRC is used or not.
+ *
+ * ex) doesn't use SRC
+- * struct rsnd_scu_platform_info info = {
++ * struct rsnd_src_platform_info info = {
+ * .flags = 0,
+ * .convert_rate = 0,
+ * };
+ *
+ * ex) uses SRC
+- * struct rsnd_scu_platform_info info = {
+- * .flags = RSND_SCU_USE_HPBIF,
++ * struct rsnd_src_platform_info info = {
++ * .flags = RSND_SRC_USE_HPBIF,
+ * .convert_rate = 48000,
+ * };
+ *
+ * ex) uses SRC bypass mode
+- * struct rsnd_scu_platform_info info = {
+- * .flags = RSND_SCU_USE_HPBIF,
++ * struct rsnd_src_platform_info info = {
++ * .flags = RSND_SRC_USE_HPBIF,
+ * .convert_rate = 0,
+ * };
+ *
+@@ -115,28 +115,28 @@ struct rsnd_scu {
+ /*
+ * Gen1/Gen2 common functions
+ */
+-int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
++int rsnd_src_ssi_mode_init(struct rsnd_mod *ssi_mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(ssi_mod);
+- struct rsnd_mod *scu_mod = rsnd_io_to_mod_scu(io);
++ struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
+ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ int ssi_id = rsnd_mod_id(ssi_mod);
+- int has_scu = 0;
++ int has_src = 0;
+
+ /*
+ * SSI_MODE0
+ */
+ if (info->dai_info) {
+- has_scu = !!scu_mod;
++ has_src = !!src_mod;
+ } else {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(scu_mod);
+- has_scu = rsnd_scu_hpbif_is_enable(scu);
++ struct rsnd_src *src = rsnd_mod_to_src(src_mod);
++ has_src = rsnd_src_hpbif_is_enable(src);
+ }
+
+ rsnd_mod_bset(ssi_mod, SSI_MODE0, (1 << ssi_id),
+- has_scu ? 0 : (1 << ssi_id));
++ has_src ? 0 : (1 << ssi_id));
+
+ /*
+ * SSI_MODE1
+@@ -165,7 +165,7 @@ int rsnd_scu_ssi_mode_init(struct rsnd_mod *ssi_mod,
+ return 0;
+ }
+
+-int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
++int rsnd_src_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+@@ -178,33 +178,33 @@ int rsnd_scu_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ return 0;
+ }
+
+-unsigned int rsnd_scu_get_ssi_rate(struct rsnd_priv *priv,
++unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime)
+ {
+- struct rsnd_scu *scu;
++ struct rsnd_src *src;
+ unsigned int rate;
+
+- scu = rsnd_mod_to_scu(rsnd_io_to_mod_scu(io));
++ src = rsnd_mod_to_src(rsnd_io_to_mod_src(io));
+
+ /*
+ * return convert rate if SRC is used,
+ * otherwise, return runtime->rate as usual
+ */
+- rate = rsnd_scu_convert_rate(scu);
++ rate = rsnd_src_convert_rate(src);
+ if (!rate)
+ rate = runtime->rate;
+
+ return rate;
+ }
+
+-static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
++static int rsnd_src_set_convert_rate(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- u32 convert_rate = rsnd_scu_convert_rate(scu);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
++ u32 convert_rate = rsnd_src_convert_rate(src);
+ u32 adinr = runtime->channels;
+ u32 fsrate = 0;
+
+@@ -217,7 +217,7 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+
+ /*
+ * Initialize the operation of the SRC internal circuits
+- * see rsnd_scu_start()
++ * see rsnd_src_start()
+ */
+ rsnd_mod_write(mod, SRC_SRCIR, 1);
+
+@@ -248,61 +248,61 @@ static int rsnd_scu_set_convert_rate(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_init(struct rsnd_mod *mod,
++static int rsnd_src_init(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- clk_enable(scu->clk);
++ clk_enable(src->clk);
+
+ return 0;
+ }
+
+-static int rsnd_scu_quit(struct rsnd_mod *mod,
++static int rsnd_src_quit(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- clk_disable(scu->clk);
++ clk_disable(src->clk);
+
+ return 0;
+ }
+
+-static int rsnd_scu_start(struct rsnd_mod *mod,
++static int rsnd_src_start(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+ /*
+ * Cancel the initialization and operate the SRC function
+- * see rsnd_scu_set_convert_rate()
++ * see rsnd_src_set_convert_rate()
+ */
+ rsnd_mod_write(mod, SRC_SRCIR, 0);
+
+- if (rsnd_scu_convert_rate(scu))
++ if (rsnd_src_convert_rate(src))
+ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 1);
+
+ return 0;
+ }
+
+
+-static int rsnd_scu_stop(struct rsnd_mod *mod,
++static int rsnd_src_stop(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- if (rsnd_scu_convert_rate(scu))
++ if (rsnd_src_convert_rate(src))
+ rsnd_mod_write(mod, SRC_ROUTE_MODE0, 0);
+
+ return 0;
+ }
+
+-static struct rsnd_mod_ops rsnd_scu_non_ops = {
+- .name = "scu (non)",
++static struct rsnd_mod_ops rsnd_src_non_ops = {
++ .name = "src (non)",
+ };
+
+ /*
+@@ -312,7 +312,7 @@ static int rsnd_src_set_route_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct scu_route_config {
++ struct src_route_config {
+ u32 mask;
+ int shift;
+ } routes[] = {
+@@ -346,14 +346,14 @@ static int rsnd_src_set_route_gen1(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_set_convert_timing_gen1(struct rsnd_mod *mod,
++static int rsnd_src_set_convert_timing_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+- u32 convert_rate = rsnd_scu_convert_rate(scu);
++ u32 convert_rate = rsnd_src_convert_rate(src);
+ u32 mask;
+ u32 val;
+ int shift;
+@@ -405,13 +405,13 @@ static int rsnd_scu_set_convert_timing_gen1(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_set_convert_rate_gen1(struct rsnd_mod *mod,
++static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ int ret;
+
+- ret = rsnd_scu_set_convert_rate(mod, rdai, io);
++ ret = rsnd_src_set_convert_rate(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+@@ -427,13 +427,13 @@ static int rsnd_scu_set_convert_rate_gen1(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_init_gen1(struct rsnd_mod *mod,
++static int rsnd_src_init_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ int ret;
+
+- ret = rsnd_scu_init(mod, rdai, io);
++ ret = rsnd_src_init(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+@@ -441,18 +441,18 @@ static int rsnd_scu_init_gen1(struct rsnd_mod *mod,
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_set_convert_rate_gen1(mod, rdai, io);
++ ret = rsnd_src_set_convert_rate_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_set_convert_timing_gen1(mod, rdai, io);
++ ret = rsnd_src_set_convert_timing_gen1(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+
+-static int rsnd_scu_start_gen1(struct rsnd_mod *mod,
++static int rsnd_src_start_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+@@ -460,10 +460,10 @@ static int rsnd_scu_start_gen1(struct rsnd_mod *mod,
+
+ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), (1 << id));
+
+- return rsnd_scu_start(mod, rdai, io);
++ return rsnd_src_start(mod, rdai, io);
+ }
+
+-static int rsnd_scu_stop_gen1(struct rsnd_mod *mod,
++static int rsnd_src_stop_gen1(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+@@ -471,27 +471,27 @@ static int rsnd_scu_stop_gen1(struct rsnd_mod *mod,
+
+ rsnd_mod_bset(mod, SRC_ROUTE_CTRL, (1 << id), 0);
+
+- return rsnd_scu_stop(mod, rdai, io);
++ return rsnd_src_stop(mod, rdai, io);
+ }
+
+-static struct rsnd_mod_ops rsnd_scu_gen1_ops = {
++static struct rsnd_mod_ops rsnd_src_gen1_ops = {
+ .name = "sru (gen1)",
+- .init = rsnd_scu_init_gen1,
+- .quit = rsnd_scu_quit,
+- .start = rsnd_scu_start_gen1,
+- .stop = rsnd_scu_stop_gen1,
++ .init = rsnd_src_init_gen1,
++ .quit = rsnd_src_quit,
++ .start = rsnd_src_start_gen1,
++ .stop = rsnd_src_stop_gen1,
+ };
+
+ /*
+ * Gen2 functions
+ */
+-static int rsnd_scu_set_convert_rate_gen2(struct rsnd_mod *mod,
++static int rsnd_src_set_convert_rate_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ int ret;
+
+- ret = rsnd_scu_set_convert_rate(mod, rdai, io);
++ ret = rsnd_src_set_convert_rate(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+@@ -506,13 +506,13 @@ static int rsnd_scu_set_convert_rate_gen2(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_set_convert_timing_gen2(struct rsnd_mod *mod,
++static int rsnd_src_set_convert_timing_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
+- u32 convert_rate = rsnd_scu_convert_rate(scu);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
++ u32 convert_rate = rsnd_src_convert_rate(src);
+ int ret;
+
+ if (convert_rate)
+@@ -525,34 +525,34 @@ static int rsnd_scu_set_convert_timing_gen2(struct rsnd_mod *mod,
+ return ret;
+ }
+
+-static int rsnd_scu_probe_gen2(struct rsnd_mod *mod,
++static int rsnd_src_probe_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+ struct rsnd_mod *ssi = rsnd_ssi_mod_get(priv, rsnd_mod_id(mod));
+ struct device *dev = rsnd_priv_to_dev(priv);
+ int ret;
+ int is_play;
+
+ if (info->dai_info)
+- is_play = rsnd_info_is_playback(priv, scu);
++ is_play = rsnd_info_is_playback(priv, src);
+ else
+ is_play = rsnd_ssi_is_play(ssi);
+
+ ret = rsnd_dma_init(priv,
+ rsnd_mod_to_dma(mod),
+ is_play,
+- scu->info->dma_id);
++ src->info->dma_id);
+ if (ret < 0)
+- dev_err(dev, "SCU DMA failed\n");
++ dev_err(dev, "SRC DMA failed\n");
+
+ return ret;
+ }
+
+-static int rsnd_scu_remove_gen2(struct rsnd_mod *mod,
++static int rsnd_src_remove_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+@@ -561,121 +561,126 @@ static int rsnd_scu_remove_gen2(struct rsnd_mod *mod,
+ return 0;
+ }
+
+-static int rsnd_scu_init_gen2(struct rsnd_mod *mod,
++static int rsnd_src_init_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+ int ret;
+
+- ret = rsnd_scu_init(mod, rdai, io);
++ ret = rsnd_src_init(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_set_convert_rate_gen2(mod, rdai, io);
++ ret = rsnd_src_set_convert_rate_gen2(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+- ret = rsnd_scu_set_convert_timing_gen2(mod, rdai, io);
++ ret = rsnd_src_set_convert_timing_gen2(mod, rdai, io);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+ }
+
+-static int rsnd_scu_start_gen2(struct rsnd_mod *mod,
++static int rsnd_src_start_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- rsnd_dma_start(rsnd_mod_to_dma(&scu->mod));
++ rsnd_dma_start(rsnd_mod_to_dma(&src->mod));
+
+ rsnd_mod_write(mod, SSI_CTRL, 0x1);
+ rsnd_mod_write(mod, SRC_CTRL, 0x11);
+
+- return rsnd_scu_start(mod, rdai, io);
++ return rsnd_src_start(mod, rdai, io);
+ }
+
+-static int rsnd_scu_stop_gen2(struct rsnd_mod *mod,
++static int rsnd_src_stop_gen2(struct rsnd_mod *mod,
+ struct rsnd_dai *rdai,
+ struct rsnd_dai_stream *io)
+ {
+- struct rsnd_scu *scu = rsnd_mod_to_scu(mod);
++ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+ rsnd_mod_write(mod, SSI_CTRL, 0);
+ rsnd_mod_write(mod, SRC_CTRL, 0);
+
+- rsnd_dma_stop(rsnd_mod_to_dma(&scu->mod));
++ rsnd_dma_stop(rsnd_mod_to_dma(&src->mod));
+
+- return rsnd_scu_stop(mod, rdai, io);
++ return rsnd_src_stop(mod, rdai, io);
+ }
+
+-static struct rsnd_mod_ops rsnd_scu_gen2_ops = {
+- .name = "scu (gen2)",
+- .probe = rsnd_scu_probe_gen2,
+- .remove = rsnd_scu_remove_gen2,
+- .init = rsnd_scu_init_gen2,
+- .quit = rsnd_scu_quit,
+- .start = rsnd_scu_start_gen2,
+- .stop = rsnd_scu_stop_gen2,
++static struct rsnd_mod_ops rsnd_src_gen2_ops = {
++ .name = "src (gen2)",
++ .probe = rsnd_src_probe_gen2,
++ .remove = rsnd_src_remove_gen2,
++ .init = rsnd_src_init_gen2,
++ .quit = rsnd_src_quit,
++ .start = rsnd_src_start_gen2,
++ .stop = rsnd_src_stop_gen2,
+ };
+
+-struct rsnd_mod *rsnd_scu_mod_get(struct rsnd_priv *priv, int id)
++struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id)
+ {
+- if (WARN_ON(id < 0 || id >= rsnd_scu_nr(priv)))
++ if (WARN_ON(id < 0 || id >= rsnd_src_nr(priv)))
+ id = 0;
+
+- return &((struct rsnd_scu *)(priv->scu) + id)->mod;
++ return &((struct rsnd_src *)(priv->src) + id)->mod;
+ }
+
+-int rsnd_scu_probe(struct platform_device *pdev,
++int rsnd_src_probe(struct platform_device *pdev,
+ struct rsnd_priv *priv)
+ {
+ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+ struct device *dev = rsnd_priv_to_dev(priv);
+- struct rsnd_scu *scu;
++ struct rsnd_src *src;
+ struct rsnd_mod_ops *ops;
+ struct clk *clk;
+- char name[RSND_SCU_NAME_SIZE];
++ char name[RSND_SRC_NAME_SIZE];
+ int i, nr;
+
+ /*
+- * init SCU
++ * init SRC
+ */
+- nr = info->scu_info_nr;
++ nr = info->src_info_nr;
+ if (!nr)
+ return 0;
+
+- scu = devm_kzalloc(dev, sizeof(*scu) * nr, GFP_KERNEL);
+- if (!scu) {
+- dev_err(dev, "SCU allocate failed\n");
++ src = devm_kzalloc(dev, sizeof(*src) * nr, GFP_KERNEL);
++ if (!src) {
++ dev_err(dev, "SRC allocate failed\n");
+ return -ENOMEM;
+ }
+
+- priv->scu_nr = nr;
+- priv->scu = scu;
++ priv->src_nr = nr;
++ priv->src = src;
+
+- for_each_rsnd_scu(scu, priv, i) {
+- snprintf(name, RSND_SCU_NAME_SIZE, "scu.%d", i);
++ for_each_rsnd_src(src, priv, i) {
++ snprintf(name, RSND_SRC_NAME_SIZE, "src.%d", i);
+
+ clk = devm_clk_get(dev, name);
++ if (IS_ERR(clk)) {
++ snprintf(name, RSND_SRC_NAME_SIZE, "scu.%d", i);
++ clk = devm_clk_get(dev, name);
++ }
++
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
+
+- scu->info = &info->scu_info[i];
+- scu->clk = clk;
++ src->info = &info->src_info[i];
++ src->clk = clk;
+
+- ops = &rsnd_scu_non_ops;
+- if (rsnd_scu_hpbif_is_enable(scu)) {
++ ops = &rsnd_src_non_ops;
++ if (rsnd_src_hpbif_is_enable(src)) {
+ if (rsnd_is_gen1(priv))
+- ops = &rsnd_scu_gen1_ops;
++ ops = &rsnd_src_gen1_ops;
+ if (rsnd_is_gen2(priv))
+- ops = &rsnd_scu_gen2_ops;
++ ops = &rsnd_src_gen2_ops;
+ }
+
+- rsnd_mod_init(priv, &scu->mod, ops, RSND_MOD_SCU, i);
++ rsnd_mod_init(priv, &src->mod, ops, RSND_MOD_SRC, i);
+
+- dev_dbg(dev, "SCU%d probed\n", i);
++ dev_dbg(dev, "SRC%d probed\n", i);
+ }
+
+ return 0;
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 45f828ded935..633b23d209b9 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -121,7 +121,7 @@ static int rsnd_ssi_master_clk_start(struct rsnd_ssi *ssi,
+ 1, 2, 4, 8, 16, 6, 12,
+ };
+ unsigned int main_rate;
+- unsigned int rate = rsnd_scu_get_ssi_rate(priv, io, runtime);
++ unsigned int rate = rsnd_src_get_ssi_rate(priv, io, runtime);
+
+ /*
+ * Find best clock, and try to start ADG
+@@ -287,7 +287,7 @@ static int rsnd_ssi_init(struct rsnd_mod *mod,
+ ssi->cr_own = cr;
+ ssi->err = -1; /* ignore 1st error */
+
+- rsnd_scu_ssi_mode_init(mod, rdai, io);
++ rsnd_src_ssi_mode_init(mod, rdai, io);
+
+ return 0;
+ }
+@@ -387,7 +387,7 @@ static int rsnd_ssi_pio_start(struct rsnd_mod *mod,
+ /* enable PIO IRQ */
+ ssi->cr_etc = UIEN | OIEN | DIEN;
+
+- rsnd_scu_enable_ssi_irq(mod, rdai, io);
++ rsnd_src_enable_ssi_irq(mod, rdai, io);
+
+ rsnd_ssi_hw_start(ssi, rdai, io);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0072-ASoC-rcar-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch b/patches.renesas/0072-ASoC-rcar-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
new file mode 100644
index 00000000000000..3163474419b34e
--- /dev/null
+++ b/patches.renesas/0072-ASoC-rcar-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
@@ -0,0 +1,36 @@
+From 903bcf506d04ce9bd5fc8ccffb2357f5cff39536 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 13 Mar 2014 17:56:43 -0700
+Subject: ASoC: rcar: fixup SND_SOC_DAIFMT_CBx_CFx flags
+
+SND_SOC_DAIFMT_CBx_CFx means "codec" side master/slave mode.
+Then, rcar will be master mode if it was SND_SOC_DAIFMT_CBS_CFS.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit e1508289404ab6ca28e0dc931612600f0441c417)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 6a1b45df8101..d836e8a9fdce 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -510,10 +510,10 @@ static int rsnd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+- rdai->clk_master = 1;
++ rdai->clk_master = 0;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+- rdai->clk_master = 0;
++ rdai->clk_master = 1; /* codec is slave, cpu is master */
+ break;
+ default:
+ return -EINVAL;
+--
+2.1.2
+
diff --git a/patches.renesas/0073-ASoC-rsnd-add-DeviceTree-support.patch b/patches.renesas/0073-ASoC-rsnd-add-DeviceTree-support.patch
new file mode 100644
index 00000000000000..7dc337dccdbd01
--- /dev/null
+++ b/patches.renesas/0073-ASoC-rsnd-add-DeviceTree-support.patch
@@ -0,0 +1,549 @@
+From 545e6a07d1d413829dc7a25c217eb657edefe2ea Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 17 Mar 2014 19:29:55 -0700
+Subject: ASoC: rsnd: add DeviceTree support
+
+Support for loading the Renesas R-Car sound driver via DeviceTree.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 90e8e50fce3585d6f9902701de08389b027dadc6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/sound/renesas,rsnd.txt | 96 ++++++++++++++++
+ sound/soc/sh/rcar/adg.c | 1 +
+ sound/soc/sh/rcar/core.c | 122 ++++++++++++++++++++-
+ sound/soc/sh/rcar/gen.c | 15 +++
+ sound/soc/sh/rcar/rsnd.h | 11 ++
+ sound/soc/sh/rcar/src.c | 36 ++++++
+ sound/soc/sh/rcar/ssi.c | 56 ++++++++++
+ 7 files changed, 334 insertions(+), 3 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+
+diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+new file mode 100644
+index 000000000000..7c6d33f29796
+--- /dev/null
++++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+@@ -0,0 +1,96 @@
++Renesas R-Car sound
++
++Required properties:
++- compatible : "renesas,rcar_sound-gen1" if generation1
++ "renesas,rcar_sound-gen2" if generation2
++- reg : Should contain the register physical address.
++ required register is
++ SRU/ADG/SSI if generation1
++ SRU/ADG/SSIU/SSI if generation2
++- rcar_sound,ssi : SSI subnode
++- rcar_sound,scu : SCU subnode
++- rcar_sound,dai : DAI subnode
++
++SSI subnode properties:
++- interrupts : Should contain SSI interrupt for PIO transfer
++- shared-pin : if shared clock pin
++
++DAI subnode properties:
++- playback : list of playback modules
++- capture : list of capture modules
++
++Example:
++
++rcar_sound: rcar_sound@0xffd90000 {
++ #sound-dai-cells = <1>;
++ compatible = "renesas,rcar_sound-gen2";
++ reg = <0 0xec500000 0 0x1000>, /* SCU */
++ <0 0xec5a0000 0 0x100>, /* ADG */
++ <0 0xec540000 0 0x1000>, /* SSIU */
++ <0 0xec541000 0 0x1280>; /* SSI */
++
++ rcar_sound,src {
++ src0: src@0 { };
++ src1: src@1 { };
++ src2: src@2 { };
++ src3: src@3 { };
++ src4: src@4 { };
++ src5: src@5 { };
++ src6: src@6 { };
++ src7: src@7 { };
++ src8: src@8 { };
++ src9: src@9 { };
++ };
++
++ rcar_sound,ssi {
++ ssi0: ssi@0 {
++ interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi1: ssi@1 {
++ interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi2: ssi@2 {
++ interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi3: ssi@3 {
++ interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi4: ssi@4 {
++ interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi5: ssi@5 {
++ interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi6: ssi@6 {
++ interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi7: ssi@7 {
++ interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi8: ssi@8 {
++ interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ ssi9: ssi@9 {
++ interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>;
++ };
++ };
++
++ rcar_sound,dai {
++ dai0 {
++ playback = <&ssi5 &src5>;
++ capture = <&ssi6>;
++ };
++ dai1 {
++ playback = <&ssi3>;
++ };
++ dai2 {
++ capture = <&ssi4>;
++ };
++ dai3 {
++ playback = <&ssi7>;
++ };
++ dai4 {
++ capture = <&ssi8>;
++ };
++ };
++};
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
+index 953f1cce982d..69c44269ebdb 100644
+--- a/sound/soc/sh/rcar/adg.c
++++ b/sound/soc/sh/rcar/adg.c
+@@ -392,6 +392,7 @@ static void rsnd_adg_ssi_clk_init(struct rsnd_priv *priv, struct rsnd_adg *adg)
+ }
+
+ int rsnd_adg_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv)
+ {
+ struct rsnd_adg *adg;
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index d836e8a9fdce..215b668166be 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -100,6 +100,21 @@
+ #define RSND_RATES SNDRV_PCM_RATE_8000_96000
+ #define RSND_FMTS (SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
+
++static struct rsnd_of_data rsnd_of_data_gen1 = {
++ .flags = RSND_GEN1,
++};
++
++static struct rsnd_of_data rsnd_of_data_gen2 = {
++ .flags = RSND_GEN2,
++};
++
++static struct of_device_id rsnd_of_match[] = {
++ { .compatible = "renesas,rcar_sound-gen1", .data = &rsnd_of_data_gen1 },
++ { .compatible = "renesas,rcar_sound-gen2", .data = &rsnd_of_data_gen2 },
++ {},
++};
++MODULE_DEVICE_TABLE(of, rsnd_of_match);
++
+ /*
+ * rsnd_platform functions
+ */
+@@ -620,7 +635,92 @@ static int rsnd_path_init(struct rsnd_priv *priv,
+ return ret;
+ }
+
++static void rsnd_of_parse_dai(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
++ struct rsnd_priv *priv)
++{
++ struct device_node *dai_node, *dai_np;
++ struct device_node *ssi_node, *ssi_np;
++ struct device_node *src_node, *src_np;
++ struct device_node *playback, *capture;
++ struct rsnd_dai_platform_info *dai_info;
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
++ struct device *dev = &pdev->dev;
++ int nr, i;
++ int dai_i, ssi_i, src_i;
++
++ if (!of_data)
++ return;
++
++ dai_node = of_get_child_by_name(dev->of_node, "rcar_sound,dai");
++ if (!dai_node)
++ return;
++
++ nr = of_get_child_count(dai_node);
++ if (!nr)
++ return;
++
++ dai_info = devm_kzalloc(dev,
++ sizeof(struct rsnd_dai_platform_info) * nr,
++ GFP_KERNEL);
++ if (!dai_info) {
++ dev_err(dev, "dai info allocation error\n");
++ return;
++ }
++
++ info->dai_info_nr = nr;
++ info->dai_info = dai_info;
++
++ ssi_node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi");
++ src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src");
++
++#define mod_parse(name) \
++if (name##_node) { \
++ struct rsnd_##name##_platform_info *name##_info; \
++ \
++ name##_i = 0; \
++ for_each_child_of_node(name##_node, name##_np) { \
++ name##_info = info->name##_info + name##_i; \
++ \
++ if (name##_np == playback) \
++ dai_info->playback.name = name##_info; \
++ if (name##_np == capture) \
++ dai_info->capture.name = name##_info; \
++ \
++ name##_i++; \
++ } \
++}
++
++ /*
++ * parse all dai
++ */
++ dai_i = 0;
++ for_each_child_of_node(dai_node, dai_np) {
++ dai_info = info->dai_info + dai_i;
++
++ for (i = 0;; i++) {
++
++ playback = of_parse_phandle(dai_np, "playback", i);
++ capture = of_parse_phandle(dai_np, "capture", i);
++
++ if (!playback && !capture)
++ break;
++
++ mod_parse(ssi);
++ mod_parse(src);
++
++ if (playback)
++ of_node_put(playback);
++ if (capture)
++ of_node_put(capture);
++ }
++
++ dai_i++;
++ }
++}
++
+ static int rsnd_dai_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv)
+ {
+ struct snd_soc_dai_driver *drv;
+@@ -628,13 +728,16 @@ static int rsnd_dai_probe(struct platform_device *pdev,
+ struct rsnd_dai *rdai;
+ struct rsnd_mod *pmod, *cmod;
+ struct device *dev = rsnd_priv_to_dev(priv);
+- int dai_nr = info->dai_info_nr;
++ int dai_nr;
+ int i;
+
++ rsnd_of_parse_dai(pdev, of_data, priv);
++
+ /*
+ * dai_nr should be set via dai_info_nr,
+ * but allow it to keeping compatible
+ */
++ dai_nr = info->dai_info_nr;
+ if (!dai_nr) {
+ /* get max dai nr */
+ for (dai_nr = 0; dai_nr < 32; dai_nr++) {
+@@ -802,7 +905,10 @@ static int rsnd_probe(struct platform_device *pdev)
+ struct rsnd_priv *priv;
+ struct device *dev = &pdev->dev;
+ struct rsnd_dai *rdai;
++ const struct of_device_id *of_id = of_match_device(rsnd_of_match, dev);
++ const struct rsnd_of_data *of_data;
+ int (*probe_func[])(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv) = {
+ rsnd_gen_probe,
+ rsnd_ssi_probe,
+@@ -812,7 +918,16 @@ static int rsnd_probe(struct platform_device *pdev)
+ };
+ int ret, i;
+
+- info = pdev->dev.platform_data;
++ info = NULL;
++ of_data = NULL;
++ if (of_id) {
++ info = devm_kzalloc(&pdev->dev,
++ sizeof(struct rcar_snd_info), GFP_KERNEL);
++ of_data = of_id->data;
++ } else {
++ info = pdev->dev.platform_data;
++ }
++
+ if (!info) {
+ dev_err(dev, "driver needs R-Car sound information\n");
+ return -ENODEV;
+@@ -835,7 +950,7 @@ static int rsnd_probe(struct platform_device *pdev)
+ * init each module
+ */
+ for (i = 0; i < ARRAY_SIZE(probe_func); i++) {
+- ret = probe_func[i](pdev, priv);
++ ret = probe_func[i](pdev, of_data, priv);
+ if (ret)
+ return ret;
+ }
+@@ -903,6 +1018,7 @@ static int rsnd_remove(struct platform_device *pdev)
+ static struct platform_driver rsnd_driver = {
+ .driver = {
+ .name = "rcar_sound",
++ .of_match_table = rsnd_of_match,
+ },
+ .probe = rsnd_probe,
+ .remove = rsnd_remove,
+diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
+index 9094970dbdfb..50a1ef3eb1c6 100644
+--- a/sound/soc/sh/rcar/gen.c
++++ b/sound/soc/sh/rcar/gen.c
+@@ -359,13 +359,28 @@ static int rsnd_gen1_probe(struct platform_device *pdev,
+ /*
+ * Gen
+ */
++static void rsnd_of_parse_gen(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
++ struct rsnd_priv *priv)
++{
++ struct rcar_snd_info *info = priv->info;
++
++ if (!of_data)
++ return;
++
++ info->flags = of_data->flags;
++}
++
+ int rsnd_gen_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv)
+ {
+ struct device *dev = rsnd_priv_to_dev(priv);
+ struct rsnd_gen *gen;
+ int ret;
+
++ rsnd_of_parse_gen(pdev, of_data, priv);
++
+ gen = devm_kzalloc(dev, sizeof(*gen), GFP_KERNEL);
+ if (!gen) {
+ dev_err(dev, "GEN allocate failed\n");
+diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
+index c46e0afa54ae..619d198c7d2e 100644
+--- a/sound/soc/sh/rcar/rsnd.h
++++ b/sound/soc/sh/rcar/rsnd.h
+@@ -17,6 +17,8 @@
+ #include <linux/io.h>
+ #include <linux/list.h>
+ #include <linux/module.h>
++#include <linux/of_device.h>
++#include <linux/of_irq.h>
+ #include <linux/sh_dma.h>
+ #include <linux/workqueue.h>
+ #include <sound/rcar_snd.h>
+@@ -113,6 +115,7 @@ enum rsnd_reg {
+ #define RSND_REG_SRCOUT_TIMSEL4 RSND_REG_SHARE18
+ #define RSND_REG_AUDIO_CLK_SEL2 RSND_REG_SHARE19
+
++struct rsnd_of_data;
+ struct rsnd_priv;
+ struct rsnd_mod;
+ struct rsnd_dai;
+@@ -260,6 +263,7 @@ int rsnd_dai_pointer_offset(struct rsnd_dai_stream *io, int additional);
+ * R-Car Gen1/Gen2
+ */
+ int rsnd_gen_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv);
+ void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+@@ -273,6 +277,7 @@ void __iomem *rsnd_gen_reg_get(struct rsnd_priv *priv,
+ int rsnd_adg_ssi_clk_stop(struct rsnd_mod *mod);
+ int rsnd_adg_ssi_clk_try_start(struct rsnd_mod *mod, unsigned int rate);
+ int rsnd_adg_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv);
+ int rsnd_adg_set_convert_clk_gen1(struct rsnd_priv *priv,
+ struct rsnd_mod *mod,
+@@ -290,6 +295,10 @@ int rsnd_adg_set_convert_timing_gen2(struct rsnd_mod *mod,
+ /*
+ * R-Car sound priv
+ */
++struct rsnd_of_data {
++ u32 flags;
++};
++
+ struct rsnd_priv {
+
+ struct device *dev;
+@@ -348,6 +357,7 @@ struct rsnd_priv {
+ * R-Car SRC
+ */
+ int rsnd_src_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id);
+ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
+@@ -366,6 +376,7 @@ int rsnd_src_enable_ssi_irq(struct rsnd_mod *ssi_mod,
+ * R-Car SSI
+ */
+ int rsnd_ssi_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv);
+ struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
+ struct rsnd_mod *rsnd_ssi_mod_get_frm_dai(struct rsnd_priv *priv,
+diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
+index ea6a214985d0..eee75ebf961c 100644
+--- a/sound/soc/sh/rcar/src.c
++++ b/sound/soc/sh/rcar/src.c
+@@ -628,7 +628,41 @@ struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id)
+ return &((struct rsnd_src *)(priv->src) + id)->mod;
+ }
+
++static void rsnd_of_parse_src(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
++ struct rsnd_priv *priv)
++{
++ struct device_node *src_node;
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
++ struct rsnd_src_platform_info *src_info;
++ struct device *dev = &pdev->dev;
++ int nr;
++
++ if (!of_data)
++ return;
++
++ src_node = of_get_child_by_name(dev->of_node, "rcar_sound,src");
++ if (!src_node)
++ return;
++
++ nr = of_get_child_count(src_node);
++ if (!nr)
++ return;
++
++ src_info = devm_kzalloc(dev,
++ sizeof(struct rsnd_src_platform_info) * nr,
++ GFP_KERNEL);
++ if (!src_info) {
++ dev_err(dev, "src info allocation error\n");
++ return;
++ }
++
++ info->src_info = src_info;
++ info->src_info_nr = nr;
++}
++
+ int rsnd_src_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv)
+ {
+ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+@@ -639,6 +673,8 @@ int rsnd_src_probe(struct platform_device *pdev,
+ char name[RSND_SRC_NAME_SIZE];
+ int i, nr;
+
++ rsnd_of_parse_src(pdev, of_data, priv);
++
+ /*
+ * init SRC
+ */
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 633b23d209b9..4b7e20603dd7 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -588,7 +588,61 @@ static void rsnd_ssi_parent_clk_setup(struct rsnd_priv *priv, struct rsnd_ssi *s
+ }
+ }
+
++
++static void rsnd_of_parse_ssi(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
++ struct rsnd_priv *priv)
++{
++ struct device_node *node;
++ struct device_node *np;
++ struct rsnd_ssi_platform_info *ssi_info;
++ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
++ struct device *dev = &pdev->dev;
++ int nr, i;
++
++ if (!of_data)
++ return;
++
++ node = of_get_child_by_name(dev->of_node, "rcar_sound,ssi");
++ if (!node)
++ return;
++
++ nr = of_get_child_count(node);
++ if (!nr)
++ return;
++
++ ssi_info = devm_kzalloc(dev,
++ sizeof(struct rsnd_ssi_platform_info) * nr,
++ GFP_KERNEL);
++ if (!ssi_info) {
++ dev_err(dev, "ssi info allocation error\n");
++ return;
++ }
++
++ info->ssi_info = ssi_info;
++ info->ssi_info_nr = nr;
++
++ i = -1;
++ for_each_child_of_node(node, np) {
++ i++;
++
++ ssi_info = info->ssi_info + i;
++
++ /*
++ * pin settings
++ */
++ if (of_get_property(np, "shared-pin", NULL))
++ ssi_info->flags |= RSND_SSI_CLK_PIN_SHARE;
++
++ /*
++ * irq
++ */
++ ssi_info->pio_irq = irq_of_parse_and_map(np, 0);
++ }
++}
++
+ int rsnd_ssi_probe(struct platform_device *pdev,
++ const struct rsnd_of_data *of_data,
+ struct rsnd_priv *priv)
+ {
+ struct rcar_snd_info *info = rsnd_priv_to_info(priv);
+@@ -600,6 +654,8 @@ int rsnd_ssi_probe(struct platform_device *pdev,
+ char name[RSND_SSI_NAME_SIZE];
+ int i, nr;
+
++ rsnd_of_parse_ssi(pdev, of_data, priv);
++
+ /*
+ * init SSI
+ */
+--
+2.1.2
+
diff --git a/patches.renesas/0074-ASoC-rcar-bugfix-it-cares-about-the-non-src-case.patch b/patches.renesas/0074-ASoC-rcar-bugfix-it-cares-about-the-non-src-case.patch
new file mode 100644
index 00000000000000..a60d241e71aa82
--- /dev/null
+++ b/patches.renesas/0074-ASoC-rcar-bugfix-it-cares-about-the-non-src-case.patch
@@ -0,0 +1,51 @@
+From 40bd3f26cc31b914c28192aa4c698fc501c2d2f4 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 23 Mar 2014 21:23:42 -0700
+Subject: ASoC: rcar: bugfix: it cares about the non-src case
+
+src might not exist.
+kernel will be hung-up without this patch in such case.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit b1eac430b6a4bee6821273d9b41dd3593eb7830b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/src.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
+index eee75ebf961c..6232b7d307aa 100644
+--- a/sound/soc/sh/rcar/src.c
++++ b/sound/soc/sh/rcar/src.c
+@@ -182,16 +182,20 @@ unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
+ struct rsnd_dai_stream *io,
+ struct snd_pcm_runtime *runtime)
+ {
++ struct rsnd_mod *src_mod = rsnd_io_to_mod_src(io);
+ struct rsnd_src *src;
+- unsigned int rate;
++ unsigned int rate = 0;
+
+- src = rsnd_mod_to_src(rsnd_io_to_mod_src(io));
++ if (src_mod) {
++ src = rsnd_mod_to_src(src_mod);
++
++ /*
++ * return convert rate if SRC is used,
++ * otherwise, return runtime->rate as usual
++ */
++ rate = rsnd_src_convert_rate(src);
++ }
+
+- /*
+- * return convert rate if SRC is used,
+- * otherwise, return runtime->rate as usual
+- */
+- rate = rsnd_src_convert_rate(src);
+ if (!rate)
+ rate = runtime->rate;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0075-ASoC-rsnd-fix-clock-prepare-unprepare.patch b/patches.renesas/0075-ASoC-rsnd-fix-clock-prepare-unprepare.patch
new file mode 100644
index 00000000000000..4f7be9fb01d381
--- /dev/null
+++ b/patches.renesas/0075-ASoC-rsnd-fix-clock-prepare-unprepare.patch
@@ -0,0 +1,68 @@
+From cc6b7c7bd649ee3b12d08615d0bfe303fb544687 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Thu, 10 Apr 2014 18:16:33 -0700
+Subject: ASoC: rsnd: fix clock prepare/unprepare
+
+As with the previous commit, before a clock can be used it must be prepared
+for use. Change from clk_enable() and clk_disable() to the versions of the
+calls which also prepare and un-prepare the clocks.
+
+Will fix warnings from the clock code when this is used.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 79861bbb759053a9b91026becc0915d0f1f8d37d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/src.c | 4 ++--
+ sound/soc/sh/rcar/ssi.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
+index 6232b7d307aa..4d0720ed5a90 100644
+--- a/sound/soc/sh/rcar/src.c
++++ b/sound/soc/sh/rcar/src.c
+@@ -258,7 +258,7 @@ static int rsnd_src_init(struct rsnd_mod *mod,
+ {
+ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- clk_enable(src->clk);
++ clk_prepare_enable(src->clk);
+
+ return 0;
+ }
+@@ -269,7 +269,7 @@ static int rsnd_src_quit(struct rsnd_mod *mod,
+ {
+ struct rsnd_src *src = rsnd_mod_to_src(mod);
+
+- clk_disable(src->clk);
++ clk_disable_unprepare(src->clk);
+
+ return 0;
+ }
+diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
+index 4b7e20603dd7..1d8387c25bd8 100644
+--- a/sound/soc/sh/rcar/ssi.c
++++ b/sound/soc/sh/rcar/ssi.c
+@@ -171,7 +171,7 @@ static void rsnd_ssi_hw_start(struct rsnd_ssi *ssi,
+ u32 cr;
+
+ if (0 == ssi->usrcnt) {
+- clk_enable(ssi->clk);
++ clk_prepare_enable(ssi->clk);
+
+ if (rsnd_dai_is_clk_master(rdai)) {
+ if (rsnd_ssi_clk_from_parent(ssi))
+@@ -230,7 +230,7 @@ static void rsnd_ssi_hw_stop(struct rsnd_ssi *ssi,
+ rsnd_ssi_master_clk_stop(ssi);
+ }
+
+- clk_disable(ssi->clk);
++ clk_disable_unprepare(ssi->clk);
+ }
+
+ dev_dbg(dev, "ssi%d hw stopped\n", rsnd_mod_id(&ssi->mod));
+--
+2.1.2
+
diff --git a/patches.renesas/0076-ASoC-rsnd-call-rsnd_dai_pointer_update-from-outside-.patch b/patches.renesas/0076-ASoC-rsnd-call-rsnd_dai_pointer_update-from-outside-.patch
new file mode 100644
index 00000000000000..555b0be5544c6f
--- /dev/null
+++ b/patches.renesas/0076-ASoC-rsnd-call-rsnd_dai_pointer_update-from-outside-.patch
@@ -0,0 +1,44 @@
+From 70d213c60d5e9d3ecadafbaf209b5155fdbed820 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 23 Apr 2014 14:59:12 +0900
+Subject: ASoC: rsnd: call rsnd_dai_pointer_update() from outside of lock
+
+rsnd_soc_dai_trigger() will be called
+after rsnd_dai_pointer_update() function
+which is using rsnd_lock().
+Thus, it should be called from outside of rsnd_lock().
+Kernel will be hangup without this patch.
+Special thanks to Kataoka-san
+
+Reported-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 836b31fe1a9791d84ed95783ed42ebd5719f7918)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/sh/rcar/core.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
+index 215b668166be..89424470a1f3 100644
+--- a/sound/soc/sh/rcar/core.c
++++ b/sound/soc/sh/rcar/core.c
+@@ -197,13 +197,12 @@ static void rsnd_dma_complete(void *data)
+ * rsnd_dai_pointer_update() will be called twice,
+ * ant it will breaks io->byte_pos
+ */
+-
+- rsnd_dai_pointer_update(io, io->byte_per_period);
+-
+ if (dma->submit_loop)
+ rsnd_dma_continue(dma);
+
+ rsnd_unlock(priv, flags);
++
++ rsnd_dai_pointer_update(io, io->byte_per_period);
+ }
+
+ static void __rsnd_dma_start(struct rsnd_dma *dma)
+--
+2.1.2
+
diff --git a/patches.renesas/0077-thermal-rcar-thermal-fix-same-mask-applied-twice.patch b/patches.renesas/0077-thermal-rcar-thermal-fix-same-mask-applied-twice.patch
new file mode 100644
index 00000000000000..6825e3d276e11d
--- /dev/null
+++ b/patches.renesas/0077-thermal-rcar-thermal-fix-same-mask-applied-twice.patch
@@ -0,0 +1,33 @@
+From 11b04631bc946f5ea31ae923061802bab10bdb30 Mon Sep 17 00:00:00 2001
+From: Patrick Titiano <ptitiano@baylibre.com>
+Date: Fri, 28 Feb 2014 14:10:03 +0100
+Subject: thermal: rcar-thermal: fix same mask applied twice
+
+Mask is already applied preceding the if statement.
+Remove the second mask.
+
+Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
+Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Zhang Rui <rui.zhang@intel.com>
+(cherry picked from commit 206c0cba095acbb91d552d220207d690c9b29594)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/thermal/rcar_thermal.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
+index 79a09d02bbca..88cfeec6a28f 100644
+--- a/drivers/thermal/rcar_thermal.c
++++ b/drivers/thermal/rcar_thermal.c
+@@ -313,7 +313,7 @@ static u32 rcar_thermal_had_changed(struct rcar_thermal_priv *priv, u32 status)
+
+ status = (status >> rcar_id_to_shift(priv)) & 0x3;
+
+- if (status & 0x3) {
++ if (status) {
+ dev_dbg(dev, "thermal%d %s%s\n",
+ priv->id,
+ (status & 0x2) ? "Rising " : "",
+--
+2.1.2
+
diff --git a/patches.renesas/0078-thermal-rcar-thermal-update-thermal-zone-only-when-t.patch b/patches.renesas/0078-thermal-rcar-thermal-update-thermal-zone-only-when-t.patch
new file mode 100644
index 00000000000000..9410b31d702d88
--- /dev/null
+++ b/patches.renesas/0078-thermal-rcar-thermal-update-thermal-zone-only-when-t.patch
@@ -0,0 +1,75 @@
+From 4dd74e8a65014b9bf3d19a5b94728bc4fbb37045 Mon Sep 17 00:00:00 2001
+From: Patrick Titiano <ptitiano@baylibre.com>
+Date: Fri, 28 Feb 2014 14:10:04 +0100
+Subject: thermal: rcar-thermal: update thermal zone only when temperature
+ changes
+
+Avoid updating the thermal zone in case an IRQ was triggered but the
+temperature didn't effectively change.
+Note this is not a driver issue.
+Below is a captured debug trace illustrating the purpose of this patch:
+out of 8 thermal zone updates, only 2 are actually necessary.
+
+[ 41.120000] rcar_thermal_work(): cctemp=25000
+[ 41.120000] rcar_thermal_work(): nctemp=30000
+[ 41.120000] rcar_thermal_work(): temp is now 30000C, update thermal zone
+[ 58.990000] rcar_thermal_work(): cctemp=30000
+[ 58.990000] rcar_thermal_work(): nctemp=30000
+[ 58.990000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 59.290000] rcar_thermal_work(): cctemp=30000
+[ 59.290000] rcar_thermal_work(): nctemp=30000
+[ 59.290000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 59.590000] rcar_thermal_work(): cctemp=30000
+[ 59.590000] rcar_thermal_work(): nctemp=30000
+[ 59.590000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 59.890000] rcar_thermal_work(): cctemp=30000
+[ 59.890000] rcar_thermal_work(): nctemp=30000
+[ 59.890000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 60.190000] rcar_thermal_work(): cctemp=30000
+[ 60.190000] rcar_thermal_work(): nctemp=30000
+[ 60.190000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 60.490000] rcar_thermal_work(): cctemp=30000
+[ 60.490000] rcar_thermal_work(): nctemp=30000
+[ 60.490000] rcar_thermal_work(): same temp, do not update thermal zone
+[ 60.790000] rcar_thermal_work(): cctemp=30000
+[ 60.790000] rcar_thermal_work(): nctemp=35000
+[ 60.790000] rcar_thermal_work(): temp is now 35000C, update thermal zone
+
+I suspect this may be due to sensor sampling accuracy / fluctuation,
+but no formal proof.
+
+Signed-off-by: Patrick Titiano <ptitiano@baylibre.com>
+Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Zhang Rui <rui.zhang@intel.com>
+(cherry picked from commit 9477165ec525d47abb1cb6523698e0cd89d65ddb)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/thermal/rcar_thermal.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
+index 88cfeec6a28f..5a37940b02c9 100644
+--- a/drivers/thermal/rcar_thermal.c
++++ b/drivers/thermal/rcar_thermal.c
+@@ -299,12 +299,17 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable)
+ static void rcar_thermal_work(struct work_struct *work)
+ {
+ struct rcar_thermal_priv *priv;
++ unsigned long cctemp, nctemp;
+
+ priv = container_of(work, struct rcar_thermal_priv, work.work);
+
++ rcar_thermal_get_temp(priv->zone, &cctemp);
+ rcar_thermal_update_temp(priv);
+ rcar_thermal_irq_enable(priv);
+- thermal_zone_device_update(priv->zone);
++
++ rcar_thermal_get_temp(priv->zone, &nctemp);
++ if (nctemp != cctemp)
++ thermal_zone_device_update(priv->zone);
+ }
+
+ static u32 rcar_thermal_had_changed(struct rcar_thermal_priv *priv, u32 status)
+--
+2.1.2
+
diff --git a/patches.renesas/0079-spi-rspi-Remove-unused-mesg-parameter-from-send-rece.patch b/patches.renesas/0079-spi-rspi-Remove-unused-mesg-parameter-from-send-rece.patch
new file mode 100644
index 00000000000000..90fc74560c461c
--- /dev/null
+++ b/patches.renesas/0079-spi-rspi-Remove-unused-mesg-parameter-from-send-rece.patch
@@ -0,0 +1,110 @@
+From f218b6575eabf6556e4b0cbd64661235407e4b8a Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:51 +0100
+Subject: spi: rspi: Remove unused mesg parameter from {send,receive}_pio()
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 91949a2d4a96195ccd37322fafe8d16c68dda86e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 27 ++++++++++-----------------
+ 1 file changed, 10 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 28987d9fcfe5..ccd5cf201d04 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -228,11 +228,8 @@ static u16 rspi_read16(const struct rspi_data *rspi, u16 offset)
+ struct spi_ops {
+ int (*set_config_register)(const struct rspi_data *rspi,
+ int access_size);
+- int (*send_pio)(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t);
+- int (*receive_pio)(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t);
+-
++ int (*send_pio)(struct rspi_data *rspi, struct spi_transfer *t);
++ int (*receive_pio)(struct rspi_data *rspi, struct spi_transfer *t);
+ };
+
+ /*
+@@ -358,8 +355,7 @@ static void rspi_negate_ssl(const struct rspi_data *rspi)
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
+ }
+
+-static int rspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t)
++static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len;
+ const u8 *data = t->tx_buf;
+@@ -384,8 +380,7 @@ static int rspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
+ return 0;
+ }
+
+-static int qspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t)
++static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len;
+ const u8 *data = t->tx_buf;
+@@ -418,7 +413,7 @@ static int qspi_send_pio(struct rspi_data *rspi, struct spi_message *mesg,
+ return 0;
+ }
+
+-#define send_pio(spi, mesg, t) spi->ops->send_pio(spi, mesg, t)
++#define send_pio(spi, t) spi->ops->send_pio(spi, t)
+
+ static void rspi_dma_complete(void *arg)
+ {
+@@ -551,8 +546,7 @@ static void rspi_receive_init(const struct rspi_data *rspi)
+ RSPI_SPSR);
+ }
+
+-static int rspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t)
++static int rspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len;
+ u8 *data;
+@@ -598,8 +592,7 @@ static void qspi_receive_init(const struct rspi_data *rspi)
+ rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+ }
+
+-static int qspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
+- struct spi_transfer *t)
++static int qspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len;
+ u8 *data;
+@@ -630,7 +623,7 @@ static int qspi_receive_pio(struct rspi_data *rspi, struct spi_message *mesg,
+ return 0;
+ }
+
+-#define receive_pio(spi, mesg, t) spi->ops->receive_pio(spi, mesg, t)
++#define receive_pio(spi, t) spi->ops->receive_pio(spi, t)
+
+ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+@@ -771,7 +764,7 @@ static void rspi_work(struct work_struct *work)
+ if (rspi_is_dma(rspi, t))
+ ret = rspi_send_dma(rspi, t);
+ else
+- ret = send_pio(rspi, mesg, t);
++ ret = send_pio(rspi, t);
+ if (ret < 0)
+ goto error;
+ }
+@@ -779,7 +772,7 @@ static void rspi_work(struct work_struct *work)
+ if (rspi_is_dma(rspi, t))
+ ret = rspi_receive_dma(rspi, t);
+ else
+- ret = receive_pio(rspi, mesg, t);
++ ret = receive_pio(rspi, t);
+ if (ret < 0)
+ goto error;
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0080-spi-rspi-Use-core-message-handling.patch b/patches.renesas/0080-spi-rspi-Use-core-message-handling.patch
new file mode 100644
index 00000000000000..2052026fbf94cf
--- /dev/null
+++ b/patches.renesas/0080-spi-rspi-Use-core-message-handling.patch
@@ -0,0 +1,200 @@
+From 31aaf58336d11e6eaf7f3ff71be687d8080c1a34 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:52 +0100
+Subject: spi: rspi: Use core message handling
+
+Let the generic SPI core handle SPI messages, calling into our
+rspi_transfer_one() method.
+
+rspi_assert_ssl() and rspi_negate_ssl() are absorbed into
+rspi_prepare_message() and rspi_unprepare_message(), as they actually
+enable/disable the whole SPI function, instead of just (de)asserting the
+chip select line.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 79d2349542f38663c3096f389115b1f131d6e564)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 111 +++++++++++++++----------------------------------
+ 1 file changed, 34 insertions(+), 77 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index ccd5cf201d04..0e4d169c90d7 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -25,8 +25,6 @@
+ #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>
+@@ -181,10 +179,7 @@ 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;
+ u8 spsr;
+ u16 spcmd;
+@@ -345,16 +340,6 @@ static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask,
+ return 0;
+ }
+
+-static void rspi_assert_ssl(const struct rspi_data *rspi)
+-{
+- rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR);
+-}
+-
+-static void rspi_negate_ssl(const struct rspi_data *rspi)
+-{
+- rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
+-}
+-
+ static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len;
+@@ -739,56 +724,27 @@ static int rspi_is_dma(const struct rspi_data *rspi, struct spi_transfer *t)
+ return 0;
+ }
+
+-static void rspi_work(struct work_struct *work)
++static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
++ struct spi_transfer *xfer)
+ {
+- struct rspi_data *rspi = container_of(work, struct rspi_data, ws);
+- struct spi_message *mesg;
+- struct spi_transfer *t;
+- unsigned long flags;
+- int ret;
+-
+- while (1) {
+- spin_lock_irqsave(&rspi->lock, flags);
+- if (list_empty(&rspi->queue)) {
+- spin_unlock_irqrestore(&rspi->lock, flags);
+- break;
+- }
+- 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) {
+- if (rspi_is_dma(rspi, t))
+- ret = rspi_send_dma(rspi, t);
+- else
+- ret = send_pio(rspi, t);
+- if (ret < 0)
+- goto error;
+- }
+- if (t->rx_buf) {
+- if (rspi_is_dma(rspi, t))
+- ret = rspi_receive_dma(rspi, t);
+- else
+- ret = receive_pio(rspi, t);
+- if (ret < 0)
+- goto error;
+- }
+- mesg->actual_length += t->len;
+- }
+- rspi_negate_ssl(rspi);
++ struct rspi_data *rspi = spi_master_get_devdata(master);
++ int ret = 0;
+
+- mesg->status = 0;
+- mesg->complete(mesg->context);
++ if (xfer->tx_buf) {
++ if (rspi_is_dma(rspi, xfer))
++ ret = rspi_send_dma(rspi, xfer);
++ else
++ ret = send_pio(rspi, xfer);
++ if (ret < 0)
++ return ret;
+ }
+-
+- return;
+-
+-error:
+- mesg->status = ret;
+- mesg->complete(mesg->context);
++ if (xfer->rx_buf) {
++ if (rspi_is_dma(rspi, xfer))
++ ret = rspi_receive_dma(rspi, xfer);
++ else
++ ret = receive_pio(rspi, xfer);
++ }
++ return ret;
+ }
+
+ static int rspi_setup(struct spi_device *spi)
+@@ -808,24 +764,26 @@ static int rspi_setup(struct spi_device *spi)
+ return 0;
+ }
+
+-static int rspi_transfer(struct spi_device *spi, struct spi_message *mesg)
++static void rspi_cleanup(struct spi_device *spi)
+ {
+- 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);
++static int rspi_prepare_message(struct spi_master *master,
++ struct spi_message *message)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(master);
+
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR);
+ return 0;
+ }
+
+-static void rspi_cleanup(struct spi_device *spi)
++static int rspi_unprepare_message(struct spi_master *master,
++ struct spi_message *message)
+ {
++ struct rspi_data *rspi = spi_master_get_devdata(master);
++
++ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
++ return 0;
+ }
+
+ static irqreturn_t rspi_irq(int irq, void *_sr)
+@@ -972,9 +930,6 @@ static int rspi_probe(struct platform_device *pdev)
+ }
+ 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);
+
+ if (rspi_pd && rspi_pd->num_chipselect)
+@@ -984,8 +939,10 @@ static int rspi_probe(struct platform_device *pdev)
+
+ master->bus_num = pdev->id;
+ master->setup = rspi_setup;
+- master->transfer = rspi_transfer;
++ master->transfer_one = rspi_transfer_one;
+ master->cleanup = rspi_cleanup;
++ master->prepare_message = rspi_prepare_message;
++ master->unprepare_message = rspi_unprepare_message;
+ master->mode_bits = SPI_CPHA | SPI_CPOL;
+
+ ret = devm_request_irq(&pdev->dev, irq, rspi_irq, 0,
+--
+2.1.2
+
diff --git a/patches.renesas/0081-spi-rspi-Abstract-8-16-bit-Data-Register-access.patch b/patches.renesas/0081-spi-rspi-Abstract-8-16-bit-Data-Register-access.patch
new file mode 100644
index 00000000000000..08f22a1f29f1e3
--- /dev/null
+++ b/patches.renesas/0081-spi-rspi-Abstract-8-16-bit-Data-Register-access.patch
@@ -0,0 +1,183 @@
+From db334576de1aeb19d140dacfe3e443b2c849c080 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:53 +0100
+Subject: spi: rspi: Abstract 8/16-bit Data Register access
+
+Add rspi_{write,read}_data(), to abstract 8-bit (QSPI, and RSPI on RZ/A1H)
+versus 16-bit (RSPI) Data Register access.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 74da76865d57161cadf8f324281f23ed3eb5db9c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 56 +++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 35 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 0e4d169c90d7..a0bb3c28ae91 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -192,6 +192,7 @@ struct rspi_data {
+
+ unsigned dma_width_16bit:1;
+ unsigned dma_callbacked:1;
++ unsigned byte_access:1;
+ };
+
+ static void rspi_write8(const struct rspi_data *rspi, u8 data, u16 offset)
+@@ -219,10 +220,25 @@ static u16 rspi_read16(const struct rspi_data *rspi, u16 offset)
+ return ioread16(rspi->addr + offset);
+ }
+
++static void rspi_write_data(const struct rspi_data *rspi, u16 data)
++{
++ if (rspi->byte_access)
++ rspi_write8(rspi, data, RSPI_SPDR);
++ else /* 16 bit */
++ rspi_write16(rspi, data, RSPI_SPDR);
++}
++
++static u16 rspi_read_data(const struct rspi_data *rspi)
++{
++ if (rspi->byte_access)
++ return rspi_read8(rspi, RSPI_SPDR);
++ else /* 16 bit */
++ return rspi_read16(rspi, RSPI_SPDR);
++}
++
+ /* optional functions */
+ struct spi_ops {
+- int (*set_config_register)(const struct rspi_data *rspi,
+- int access_size);
++ int (*set_config_register)(struct rspi_data *rspi, int access_size);
+ int (*send_pio)(struct rspi_data *rspi, struct spi_transfer *t);
+ int (*receive_pio)(struct rspi_data *rspi, struct spi_transfer *t);
+ };
+@@ -230,8 +246,7 @@ struct spi_ops {
+ /*
+ * functions for RSPI
+ */
+-static int rspi_set_config_register(const struct rspi_data *rspi,
+- int access_size)
++static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+ int spbr;
+
+@@ -242,8 +257,9 @@ static int rspi_set_config_register(const struct rspi_data *rspi,
+ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
+ rspi_write8(rspi, clamp(spbr, 0, 255), RSPI_SPBR);
+
+- /* Sets number of frames to be used: 1 frame */
+- rspi_write8(rspi, 0x00, RSPI_SPDCR);
++ /* Disable dummy transmission, set 16-bit word access, 1 frame */
++ rspi_write8(rspi, 0, RSPI_SPDCR);
++ rspi->byte_access = 0;
+
+ /* Sets RSPCK, SSL, next-access delay value */
+ rspi_write8(rspi, 0x00, RSPI_SPCKD);
+@@ -266,8 +282,7 @@ static int rspi_set_config_register(const struct rspi_data *rspi,
+ /*
+ * functions for QSPI
+ */
+-static int qspi_set_config_register(const struct rspi_data *rspi,
+- int access_size)
++static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+ u16 spcmd;
+ int spbr;
+@@ -279,8 +294,9 @@ static int qspi_set_config_register(const struct rspi_data *rspi,
+ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz);
+ rspi_write8(rspi, clamp(spbr, 0, 255), RSPI_SPBR);
+
+- /* Sets number of frames to be used: 1 frame */
+- rspi_write8(rspi, 0x00, RSPI_SPDCR);
++ /* Disable dummy transmission, set byte access */
++ rspi_write8(rspi, 0, RSPI_SPDCR);
++ rspi->byte_access = 1;
+
+ /* Sets RSPCK, SSL, next-access delay value */
+ rspi_write8(rspi, 0x00, RSPI_SPCKD);
+@@ -354,7 +370,7 @@ static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ return -ETIMEDOUT;
+ }
+
+- rspi_write16(rspi, *data, RSPI_SPDR);
++ rspi_write_data(rspi, *data);
+ data++;
+ remain--;
+ }
+@@ -380,14 +396,14 @@ static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ "%s: tx empty timeout\n", __func__);
+ return -ETIMEDOUT;
+ }
+- rspi_write8(rspi, *data++, RSPI_SPDR);
++ rspi_write_data(rspi, *data++);
+
+ if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
+ dev_err(&rspi->master->dev,
+ "%s: receive timeout\n", __func__);
+ return -ETIMEDOUT;
+ }
+- rspi_read8(rspi, RSPI_SPDR);
++ rspi_read_data(rspi);
+
+ remain--;
+ }
+@@ -525,7 +541,7 @@ static void rspi_receive_init(const struct rspi_data *rspi)
+
+ spsr = rspi_read8(rspi, RSPI_SPSR);
+ if (spsr & SPSR_SPRF)
+- rspi_read16(rspi, RSPI_SPDR); /* dummy read */
++ rspi_read_data(rspi); /* dummy read */
+ if (spsr & SPSR_OVRF)
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPSR) & ~SPSR_OVRF,
+ RSPI_SPSR);
+@@ -549,15 +565,14 @@ static int rspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ return -ETIMEDOUT;
+ }
+ /* dummy write for generate clock */
+- rspi_write16(rspi, DUMMY_DATA, RSPI_SPDR);
++ rspi_write_data(rspi, DUMMY_DATA);
+
+ 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 = rspi_read_data(rspi);
+
+ data++;
+ remain--;
+@@ -572,7 +587,7 @@ static void qspi_receive_init(const struct rspi_data *rspi)
+
+ spsr = rspi_read8(rspi, RSPI_SPSR);
+ if (spsr & SPSR_SPRF)
+- rspi_read8(rspi, RSPI_SPDR); /* dummy read */
++ rspi_read_data(rspi); /* dummy read */
+ rspi_write8(rspi, SPBFCR_TXRST | SPBFCR_RXRST, QSPI_SPBFCR);
+ rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+ }
+@@ -593,15 +608,14 @@ static int qspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ return -ETIMEDOUT;
+ }
+ /* dummy write for generate clock */
+- rspi_write8(rspi, DUMMY_DATA, RSPI_SPDR);
++ rspi_write_data(rspi, DUMMY_DATA);
+
+ 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 8, 16 or 32-bit access */
+- *data++ = rspi_read8(rspi, RSPI_SPDR);
++ *data++ = rspi_read_data(rspi);
+ remain--;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0082-spi-rspi-Add-rspi_data_-out-in-out_in-helpers.patch b/patches.renesas/0082-spi-rspi-Add-rspi_data_-out-in-out_in-helpers.patch
new file mode 100644
index 00000000000000..66d4ac834c71da
--- /dev/null
+++ b/patches.renesas/0082-spi-rspi-Add-rspi_data_-out-in-out_in-helpers.patch
@@ -0,0 +1,194 @@
+From 9524fd040ff8b610c7e956928bd7fced8aa359b5 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:54 +0100
+Subject: spi: rspi: Add rspi_data_{out,in,out_in}() helpers
+
+Add helpers rspi_data_{out,in,out_in}() to write, read, or write and
+read data to/from the Data Register, taking care of waiting until data
+or space is available in the buffers.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 35301c996046243ca6e41d490dea2823f045614c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 117 +++++++++++++++++++++++--------------------------
+ 1 file changed, 56 insertions(+), 61 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index a0bb3c28ae91..4b27513e7204 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -356,22 +356,51 @@ static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask,
+ return 0;
+ }
+
++static int rspi_data_out(struct rspi_data *rspi, u8 data)
++{
++ if (rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE) < 0) {
++ dev_err(&rspi->master->dev, "transmit timeout\n");
++ return -ETIMEDOUT;
++ }
++ rspi_write_data(rspi, data);
++ return 0;
++}
++
++static int rspi_data_in(struct rspi_data *rspi)
++{
++ u8 data;
++
++ if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
++ dev_err(&rspi->master->dev, "receive timeout\n");
++ return -ETIMEDOUT;
++ }
++ data = rspi_read_data(rspi);
++ return data;
++}
++
++static int rspi_data_out_in(struct rspi_data *rspi, u8 data)
++{
++ int ret;
++
++ ret = rspi_data_out(rspi, data);
++ if (ret < 0)
++ return ret;
++
++ return rspi_data_in(rspi);
++}
++
+ static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+- int remain = t->len;
++ int remain = t->len, ret;
+ const u8 *data = 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_write_data(rspi, *data);
+- data++;
++ ret = rspi_data_out(rspi, *data++);
++ if (ret < 0)
++ return ret;
+ remain--;
+ }
+
+@@ -383,28 +412,17 @@ static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+
+ static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+- int remain = t->len;
++ int remain = t->len, ret;
+ const u8 *data = t->tx_buf;
+
+ rspi_write8(rspi, SPBFCR_TXRST, QSPI_SPBFCR);
+ rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+
+ while (remain > 0) {
+-
+- 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_write_data(rspi, *data++);
+-
+- if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
+- dev_err(&rspi->master->dev,
+- "%s: receive timeout\n", __func__);
+- return -ETIMEDOUT;
+- }
+- rspi_read_data(rspi);
+-
++ /* dummy read */
++ ret = rspi_data_out_in(rspi, *data++);
++ if (ret < 0)
++ return ret;
+ remain--;
+ }
+
+@@ -549,32 +567,20 @@ static void rspi_receive_init(const struct rspi_data *rspi)
+
+ static int rspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+- int remain = t->len;
+- u8 *data;
++ int remain = t->len, ret;
++ u8 *data = t->rx_buf;
+
+ rspi_receive_init(rspi);
+
+- data = 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_write_data(rspi, DUMMY_DATA);
+-
+- if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
+- dev_err(&rspi->master->dev,
+- "%s: receive timeout\n", __func__);
+- return -ETIMEDOUT;
+- }
+- *data = rspi_read_data(rspi);
+-
+- data++;
++ /* dummy write data for generate clock */
++ ret = rspi_data_out_in(rspi, DUMMY_DATA);
++ if (ret < 0)
++ return ret;
++ *data++ = ret;
+ remain--;
+ }
+
+@@ -594,28 +600,17 @@ static void qspi_receive_init(const struct rspi_data *rspi)
+
+ static int qspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+- int remain = t->len;
+- u8 *data;
++ int remain = t->len, ret;
++ u8 *data = t->rx_buf;
+
+ qspi_receive_init(rspi);
+
+- data = t->rx_buf;
+ while (remain > 0) {
+-
+- 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_write_data(rspi, DUMMY_DATA);
+-
+- if (rspi_wait_for_interrupt(rspi, SPSR_SPRF, SPCR_SPRIE) < 0) {
+- dev_err(&rspi->master->dev,
+- "%s: receive timeout\n", __func__);
+- return -ETIMEDOUT;
+- }
+- *data++ = rspi_read_data(rspi);
++ ret = rspi_data_out_in(rspi, DUMMY_DATA);
++ if (ret < 0)
++ return ret;
++ *data++ = ret;
+ remain--;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0083-spi-rspi-Abstract-transfer_one-for-RSPI-and-QSPI.patch b/patches.renesas/0083-spi-rspi-Abstract-transfer_one-for-RSPI-and-QSPI.patch
new file mode 100644
index 00000000000000..c07f93089119d1
--- /dev/null
+++ b/patches.renesas/0083-spi-rspi-Abstract-transfer_one-for-RSPI-and-QSPI.patch
@@ -0,0 +1,115 @@
+From bdfe1b8e1d178bd8a5b2ede2ebbaf9383e550ae0 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:55 +0100
+Subject: spi: rspi: Abstract transfer_one() for RSPI and QSPI
+
+Split off qspi_transfer_one() (which doesn't support DMA yet) from
+rspi_transfer_one().
+Replace the abstraction of send_pio()/receive_pio() by the abstracrion of
+transfer_one().
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit eb557f75269e82dd26a79be536eca223ddc3eaf7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 36 +++++++++++++++++++++++-------------
+ 1 file changed, 23 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 4b27513e7204..d837c5029308 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -239,8 +239,8 @@ static u16 rspi_read_data(const struct rspi_data *rspi)
+ /* optional functions */
+ struct spi_ops {
+ int (*set_config_register)(struct rspi_data *rspi, int access_size);
+- int (*send_pio)(struct rspi_data *rspi, struct spi_transfer *t);
+- int (*receive_pio)(struct rspi_data *rspi, struct spi_transfer *t);
++ int (*transfer_one)(struct spi_master *master, struct spi_device *spi,
++ struct spi_transfer *xfer);
+ };
+
+ /*
+@@ -432,8 +432,6 @@ static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ return 0;
+ }
+
+-#define send_pio(spi, t) spi->ops->send_pio(spi, t)
+-
+ static void rspi_dma_complete(void *arg)
+ {
+ struct rspi_data *rspi = arg;
+@@ -617,8 +615,6 @@ static int qspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ return 0;
+ }
+
+-#define receive_pio(spi, t) spi->ops->receive_pio(spi, t)
+-
+ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ struct scatterlist sg, sg_dummy;
+@@ -743,7 +739,7 @@ static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ if (rspi_is_dma(rspi, xfer))
+ ret = rspi_send_dma(rspi, xfer);
+ else
+- ret = send_pio(rspi, xfer);
++ ret = rspi_send_pio(rspi, xfer);
+ if (ret < 0)
+ return ret;
+ }
+@@ -751,8 +747,24 @@ static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ if (rspi_is_dma(rspi, xfer))
+ ret = rspi_receive_dma(rspi, xfer);
+ else
+- ret = receive_pio(rspi, xfer);
++ ret = rspi_receive_pio(rspi, xfer);
++ }
++ return ret;
++}
++
++static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
++ struct spi_transfer *xfer)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(master);
++ int ret = 0;
++
++ if (xfer->tx_buf) {
++ ret = qspi_send_pio(rspi, xfer);
++ if (ret < 0)
++ return ret;
+ }
++ if (xfer->rx_buf)
++ ret = qspi_receive_pio(rspi, xfer);
+ return ret;
+ }
+
+@@ -948,7 +960,7 @@ static int rspi_probe(struct platform_device *pdev)
+
+ master->bus_num = pdev->id;
+ master->setup = rspi_setup;
+- master->transfer_one = rspi_transfer_one;
++ master->transfer_one = ops->transfer_one;
+ master->cleanup = rspi_cleanup;
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+@@ -990,14 +1002,12 @@ error1:
+
+ static struct spi_ops rspi_ops = {
+ .set_config_register = rspi_set_config_register,
+- .send_pio = rspi_send_pio,
+- .receive_pio = rspi_receive_pio,
++ .transfer_one = rspi_transfer_one,
+ };
+
+ static struct spi_ops qspi_ops = {
+ .set_config_register = qspi_set_config_register,
+- .send_pio = qspi_send_pio,
+- .receive_pio = qspi_receive_pio,
++ .transfer_one = qspi_transfer_one,
+ };
+
+ static struct platform_device_id spi_driver_ids[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0084-spi-rspi-Merge-rspi_send_pio-and-rspi_receive_pio.patch b/patches.renesas/0084-spi-rspi-Merge-rspi_send_pio-and-rspi_receive_pio.patch
new file mode 100644
index 00000000000000..ffe8a62138f2ba
--- /dev/null
+++ b/patches.renesas/0084-spi-rspi-Merge-rspi_send_pio-and-rspi_receive_pio.patch
@@ -0,0 +1,158 @@
+From 4340c4fed6c73e090ca698235a6352a46ff448a9 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:56 +0100
+Subject: spi: rspi: Merge rspi_send_pio() and rspi_receive_pio()
+
+rspi_send_pio() and rspi_receive_pio() are very similar:
+ - the former only sends data, using TX Only Mode,
+ - the latter sends and receives full duplex data to/from the hardware,
+ but uses dummy transmit data.
+Merge them into rspi_transfer_out_in(), now supporting full duplex if
+needed.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 8449fd76deb9ac67a15a6fb8ead7bb4595d019d2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 101 ++++++++++++++++++++++---------------------------
+ 1 file changed, 46 insertions(+), 55 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index d837c5029308..cc90136d02c8 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -389,27 +389,6 @@ static int rspi_data_out_in(struct rspi_data *rspi, u8 data)
+ return rspi_data_in(rspi);
+ }
+
+-static int rspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+-{
+- int remain = t->len, ret;
+- const u8 *data = t->tx_buf;
+-
+- while (remain > 0) {
+- rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_TXMD,
+- RSPI_SPCR);
+-
+- ret = rspi_data_out(rspi, *data++);
+- if (ret < 0)
+- return ret;
+- remain--;
+- }
+-
+- /* Waiting for the last transmission */
+- rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
+-
+- return 0;
+-}
+-
+ static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+ {
+ int remain = t->len, ret;
+@@ -563,28 +542,6 @@ static void rspi_receive_init(const struct rspi_data *rspi)
+ RSPI_SPSR);
+ }
+
+-static int rspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+-{
+- int remain = t->len, ret;
+- u8 *data = t->rx_buf;
+-
+- rspi_receive_init(rspi);
+-
+- while (remain > 0) {
+- rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_TXMD,
+- RSPI_SPCR);
+-
+- /* dummy write data for generate clock */
+- ret = rspi_data_out_in(rspi, DUMMY_DATA);
+- if (ret < 0)
+- return ret;
+- *data++ = ret;
+- remain--;
+- }
+-
+- return 0;
+-}
+-
+ static void qspi_receive_init(const struct rspi_data *rspi)
+ {
+ u8 spsr;
+@@ -729,27 +686,61 @@ static int rspi_is_dma(const struct rspi_data *rspi, struct spi_transfer *t)
+ return 0;
+ }
+
++static int rspi_transfer_out_in(struct rspi_data *rspi,
++ struct spi_transfer *xfer)
++{
++ int remain = xfer->len, ret;
++ const u8 *tx_buf = xfer->tx_buf;
++ u8 *rx_buf = xfer->rx_buf;
++ u8 spcr, data;
++
++ rspi_receive_init(rspi);
++
++ spcr = rspi_read8(rspi, RSPI_SPCR);
++ if (rx_buf)
++ spcr &= ~SPCR_TXMD;
++ else
++ spcr |= SPCR_TXMD;
++ rspi_write8(rspi, spcr, RSPI_SPCR);
++
++ while (remain > 0) {
++ data = tx_buf ? *tx_buf++ : DUMMY_DATA;
++ ret = rspi_data_out(rspi, data);
++ if (ret < 0)
++ return ret;
++ if (rx_buf) {
++ ret = rspi_data_in(rspi);
++ if (ret < 0)
++ return ret;
++ *rx_buf++ = ret;
++ }
++ remain--;
++ }
++
++ /* Wait for the last transmission */
++ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
++
++ return 0;
++}
++
+ static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ struct spi_transfer *xfer)
+ {
+ struct rspi_data *rspi = spi_master_get_devdata(master);
+- int ret = 0;
++ int ret;
++
++ if (!rspi_is_dma(rspi, xfer))
++ return rspi_transfer_out_in(rspi, xfer);
+
+ if (xfer->tx_buf) {
+- if (rspi_is_dma(rspi, xfer))
+- ret = rspi_send_dma(rspi, xfer);
+- else
+- ret = rspi_send_pio(rspi, xfer);
++ ret = rspi_send_dma(rspi, xfer);
+ if (ret < 0)
+ return ret;
+ }
+- if (xfer->rx_buf) {
+- if (rspi_is_dma(rspi, xfer))
+- ret = rspi_receive_dma(rspi, xfer);
+- else
+- ret = rspi_receive_pio(rspi, xfer);
+- }
+- return ret;
++ if (xfer->rx_buf)
++ return rspi_receive_dma(rspi, xfer);
++
++ return 0;
+ }
+
+ static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+--
+2.1.2
+
diff --git a/patches.renesas/0085-spi-rspi-Merge-qspi_send_pio-and-qspi_receive_pio.patch b/patches.renesas/0085-spi-rspi-Merge-qspi_send_pio-and-qspi_receive_pio.patch
new file mode 100644
index 00000000000000..f36401ed2e2131
--- /dev/null
+++ b/patches.renesas/0085-spi-rspi-Merge-qspi_send_pio-and-qspi_receive_pio.patch
@@ -0,0 +1,130 @@
+From 61875440aa378226c6a0aeaa0f77b893be031a35 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:57 +0100
+Subject: spi: rspi: Merge qspi_send_pio() and qspi_receive_pio()
+
+qspi_send_pio() and qspi_receive_pio() are very similar: they both send
+and receive full duplex data to/from the hardware, but ignore the data
+stream in the unused direction.
+Merge them into qspi_transfer_out_in(), now supporting real full duplex.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 340a15e6f0d6cd436c55693f7328a1de02fcdb96)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 79 ++++++++++++++++++--------------------------------
+ 1 file changed, 28 insertions(+), 51 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index cc90136d02c8..5d39cd3eba62 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -389,28 +389,6 @@ static int rspi_data_out_in(struct rspi_data *rspi, u8 data)
+ return rspi_data_in(rspi);
+ }
+
+-static int qspi_send_pio(struct rspi_data *rspi, struct spi_transfer *t)
+-{
+- int remain = t->len, ret;
+- const u8 *data = t->tx_buf;
+-
+- rspi_write8(rspi, SPBFCR_TXRST, QSPI_SPBFCR);
+- rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+-
+- while (remain > 0) {
+- /* dummy read */
+- ret = rspi_data_out_in(rspi, *data++);
+- if (ret < 0)
+- return ret;
+- remain--;
+- }
+-
+- /* Waiting for the last transmission */
+- rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
+-
+- return 0;
+-}
+-
+ static void rspi_dma_complete(void *arg)
+ {
+ struct rspi_data *rspi = arg;
+@@ -550,26 +528,7 @@ static void qspi_receive_init(const struct rspi_data *rspi)
+ if (spsr & SPSR_SPRF)
+ rspi_read_data(rspi); /* dummy read */
+ rspi_write8(rspi, SPBFCR_TXRST | SPBFCR_RXRST, QSPI_SPBFCR);
+- rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+-}
+-
+-static int qspi_receive_pio(struct rspi_data *rspi, struct spi_transfer *t)
+-{
+- int remain = t->len, ret;
+- u8 *data = t->rx_buf;
+-
+- qspi_receive_init(rspi);
+-
+- while (remain > 0) {
+- /* dummy write for generate clock */
+- ret = rspi_data_out_in(rspi, DUMMY_DATA);
+- if (ret < 0)
+- return ret;
+- *data++ = ret;
+- remain--;
+- }
+-
+- return 0;
++ rspi_write8(rspi, 0, QSPI_SPBFCR);
+ }
+
+ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+@@ -743,20 +702,38 @@ static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ return 0;
+ }
+
+-static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+- struct spi_transfer *xfer)
++static int qspi_transfer_out_in(struct rspi_data *rspi,
++ struct spi_transfer *xfer)
+ {
+- struct rspi_data *rspi = spi_master_get_devdata(master);
+- int ret = 0;
++ int remain = xfer->len, ret;
++ const u8 *tx_buf = xfer->tx_buf;
++ u8 *rx_buf = xfer->rx_buf;
++ u8 data;
+
+- if (xfer->tx_buf) {
+- ret = qspi_send_pio(rspi, xfer);
++ qspi_receive_init(rspi);
++
++ while (remain > 0) {
++ data = tx_buf ? *tx_buf++ : DUMMY_DATA;
++ ret = rspi_data_out_in(rspi, data);
+ if (ret < 0)
+ return ret;
++ if (rx_buf)
++ *rx_buf++ = ret;
++ remain--;
+ }
+- if (xfer->rx_buf)
+- ret = qspi_receive_pio(rspi, xfer);
+- return ret;
++
++ /* Wait for the last transmission */
++ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
++
++ return 0;
++}
++
++static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
++ struct spi_transfer *xfer)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(master);
++
++ return qspi_transfer_out_in(rspi, xfer);
+ }
+
+ static int rspi_setup(struct spi_device *spi)
+--
+2.1.2
+
diff --git a/patches.renesas/0086-spi-rspi-Add-support-for-more-than-one-interrupt.patch b/patches.renesas/0086-spi-rspi-Add-support-for-more-than-one-interrupt.patch
new file mode 100644
index 00000000000000..1fb66555c0c7c9
--- /dev/null
+++ b/patches.renesas/0086-spi-rspi-Add-support-for-more-than-one-interrupt.patch
@@ -0,0 +1,242 @@
+From e0a4fc5efae26d20bbfd2237bf103b9fe0395c04 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:58 +0100
+Subject: spi: rspi: Add support for more than one interrupt
+
+Add support for multiple interrupts, based on the SDK reference code.
+This is needed for RZ/A1H, which supports 3 interrupts.
+
+When using multiple interrupts, they must be called "rx" (SPRI) and "tx"
+(SPTI). The error interrupt (SPEI) is not used, as it matters for slave
+mode only.
+
+When using a single interrupt, it may be called "mux". If it cannot be
+found, the first interrupt in the device's resources will be used.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9372220678cd4c62992f7637b2ee36b47fa58d37)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 106 ++++++++++++++++++++++++++++++++++++++++---------
+ 1 file changed, 87 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 5d39cd3eba62..d2ade5e09f58 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -1,7 +1,7 @@
+ /*
+ * SH RSPI driver
+ *
+- * Copyright (C) 2012 Renesas Solutions Corp.
++ * Copyright (C) 2012, 2013 Renesas Solutions Corp.
+ *
+ * Based on spi-sh.c:
+ * Copyright (C) 2011 Renesas Solutions Corp.
+@@ -183,12 +183,12 @@ struct rspi_data {
+ struct clk *clk;
+ u8 spsr;
+ u16 spcmd;
++ int rx_irq, tx_irq;
+ const struct spi_ops *ops;
+
+ /* for dmaengine */
+ struct dma_chan *chan_tx;
+ struct dma_chan *chan_rx;
+- int irq;
+
+ unsigned dma_width_16bit:1;
+ unsigned dma_callbacked:1;
+@@ -440,7 +440,7 @@ static int rspi_send_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ struct scatterlist sg;
+ const void *buf = NULL;
+ struct dma_async_tx_descriptor *desc;
+- unsigned len;
++ unsigned int len;
+ int ret = 0;
+
+ if (rspi->dma_width_16bit) {
+@@ -478,7 +478,7 @@ static int rspi_send_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ * DMAC needs SPTIE, but if SPTIE is set, this IRQ routine will be
+ * called. So, this driver disables the IRQ while DMA transfer.
+ */
+- disable_irq(rspi->irq);
++ disable_irq(rspi->tx_irq);
+
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_TXMD, RSPI_SPCR);
+ rspi_enable_irq(rspi, SPCR_SPTIE);
+@@ -497,7 +497,7 @@ static int rspi_send_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ ret = -ETIMEDOUT;
+ rspi_disable_irq(rspi, SPCR_SPTIE);
+
+- enable_irq(rspi->irq);
++ enable_irq(rspi->tx_irq);
+
+ end:
+ rspi_dma_unmap_sg(&sg, rspi->chan_tx, DMA_TO_DEVICE);
+@@ -536,7 +536,7 @@ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ struct scatterlist sg, sg_dummy;
+ void *dummy = NULL, *rx_buf = NULL;
+ struct dma_async_tx_descriptor *desc, *desc_dummy;
+- unsigned len;
++ unsigned int len;
+ int ret = 0;
+
+ if (rspi->dma_width_16bit) {
+@@ -594,7 +594,9 @@ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ * DMAC needs SPTIE, but if SPTIE is set, this IRQ routine will be
+ * called. So, this driver disables the IRQ while DMA transfer.
+ */
+- disable_irq(rspi->irq);
++ disable_irq(rspi->tx_irq);
++ if (rspi->rx_irq != rspi->tx_irq)
++ disable_irq(rspi->rx_irq);
+
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_TXMD, RSPI_SPCR);
+ rspi_enable_irq(rspi, SPCR_SPTIE | SPCR_SPRIE);
+@@ -617,7 +619,9 @@ static int rspi_receive_dma(struct rspi_data *rspi, struct spi_transfer *t)
+ ret = -ETIMEDOUT;
+ rspi_disable_irq(rspi, SPCR_SPTIE | SPCR_SPRIE);
+
+- enable_irq(rspi->irq);
++ enable_irq(rspi->tx_irq);
++ if (rspi->rx_irq != rspi->tx_irq)
++ enable_irq(rspi->rx_irq);
+
+ end:
+ rspi_dma_unmap_sg(&sg, rspi->chan_rx, DMA_FROM_DEVICE);
+@@ -775,7 +779,7 @@ static int rspi_unprepare_message(struct spi_master *master,
+ return 0;
+ }
+
+-static irqreturn_t rspi_irq(int irq, void *_sr)
++static irqreturn_t rspi_irq_mux(int irq, void *_sr)
+ {
+ struct rspi_data *rspi = _sr;
+ u8 spsr;
+@@ -797,6 +801,36 @@ static irqreturn_t rspi_irq(int irq, void *_sr)
+ return ret;
+ }
+
++static irqreturn_t rspi_irq_rx(int irq, void *_sr)
++{
++ struct rspi_data *rspi = _sr;
++ u8 spsr;
++
++ rspi->spsr = spsr = rspi_read8(rspi, RSPI_SPSR);
++ if (spsr & SPSR_SPRF) {
++ rspi_disable_irq(rspi, SPCR_SPRIE);
++ wake_up(&rspi->wait);
++ return IRQ_HANDLED;
++ }
++
++ return 0;
++}
++
++static irqreturn_t rspi_irq_tx(int irq, void *_sr)
++{
++ struct rspi_data *rspi = _sr;
++ u8 spsr;
++
++ rspi->spsr = spsr = rspi_read8(rspi, RSPI_SPSR);
++ if (spsr & SPSR_SPTEF) {
++ rspi_disable_irq(rspi, SPCR_SPTIE);
++ wake_up(&rspi->wait);
++ return IRQ_HANDLED;
++ }
++
++ return 0;
++}
++
+ static int rspi_request_dma(struct rspi_data *rspi,
+ struct platform_device *pdev)
+ {
+@@ -868,12 +902,25 @@ static int rspi_remove(struct platform_device *pdev)
+ return 0;
+ }
+
++static int rspi_request_irq(struct device *dev, unsigned int irq,
++ irq_handler_t handler, const char *suffix,
++ void *dev_id)
++{
++ const char *base = dev_name(dev);
++ size_t len = strlen(base) + strlen(suffix) + 2;
++ char *name = devm_kzalloc(dev, len, GFP_KERNEL);
++ if (!name)
++ return -ENOMEM;
++ snprintf(name, len, "%s:%s", base, suffix);
++ return devm_request_irq(dev, irq, handler, 0, name, dev_id);
++}
++
+ static int rspi_probe(struct platform_device *pdev)
+ {
+ struct resource *res;
+ struct spi_master *master;
+ struct rspi_data *rspi;
+- int ret, irq;
++ int ret;
+ char clk_name[16];
+ const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev);
+ const struct spi_ops *ops;
+@@ -886,12 +933,6 @@ static int rspi_probe(struct platform_device *pdev)
+ return -ENODEV;
+ }
+
+- 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");
+@@ -934,14 +975,41 @@ static int rspi_probe(struct platform_device *pdev)
+ master->unprepare_message = rspi_unprepare_message;
+ master->mode_bits = SPI_CPHA | SPI_CPOL;
+
+- ret = devm_request_irq(&pdev->dev, irq, rspi_irq, 0,
+- dev_name(&pdev->dev), rspi);
++ ret = platform_get_irq_byname(pdev, "rx");
++ if (ret < 0) {
++ ret = platform_get_irq_byname(pdev, "mux");
++ if (ret < 0)
++ ret = platform_get_irq(pdev, 0);
++ if (ret >= 0)
++ rspi->rx_irq = rspi->tx_irq = ret;
++ } else {
++ rspi->rx_irq = ret;
++ ret = platform_get_irq_byname(pdev, "tx");
++ if (ret >= 0)
++ rspi->tx_irq = ret;
++ }
++ if (ret < 0) {
++ dev_err(&pdev->dev, "platform_get_irq error\n");
++ goto error2;
++ }
++
++ if (rspi->rx_irq == rspi->tx_irq) {
++ /* Single multiplexed interrupt */
++ ret = rspi_request_irq(&pdev->dev, rspi->rx_irq, rspi_irq_mux,
++ "mux", rspi);
++ } else {
++ /* Multi-interrupt mode, only SPRI and SPTI are used */
++ ret = rspi_request_irq(&pdev->dev, rspi->rx_irq, rspi_irq_rx,
++ "rx", rspi);
++ if (!ret)
++ ret = rspi_request_irq(&pdev->dev, rspi->tx_irq,
++ rspi_irq_tx, "tx", rspi);
++ }
+ if (ret < 0) {
+ dev_err(&pdev->dev, "request_irq error\n");
+ goto error2;
+ }
+
+- rspi->irq = irq;
+ ret = rspi_request_dma(rspi, pdev);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "rspi_request_dma failed.\n");
+--
+2.1.2
+
diff --git a/patches.renesas/0087-spi-rspi-Add-support-for-RSPI-on-RZ-A1H.patch b/patches.renesas/0087-spi-rspi-Add-support-for-RSPI-on-RZ-A1H.patch
new file mode 100644
index 00000000000000..a764c97091485c
--- /dev/null
+++ b/patches.renesas/0087-spi-rspi-Add-support-for-RSPI-on-RZ-A1H.patch
@@ -0,0 +1,214 @@
+From 3a2b3216d50f8e24683c9ec0e480b5b81d22b4e0 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:43:59 +0100
+Subject: spi: rspi: Add support for RSPI on RZ/A1H
+
+Add support for the RSPI variant in the RZ/A1H (r7s72100) SoC.
+
+Main differences with RSPI on SH are:
+ - Lack of TX only mode, hence we always have to use full duplex
+ transfers,
+ - The Data Register must be accessed used 8-bit operations.
+
+RSPI on RZ is matched using the new "rspi-rz" platform device name.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 862d357f84f009fdcba22be8d6a2f82ff80ab740)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 101 ++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 92 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index d2ade5e09f58..0c7556978d2e 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -47,7 +47,7 @@
+ #define RSPI_SPCKD 0x0c /* Clock Delay Register */
+ #define RSPI_SSLND 0x0d /* Slave Select Negation Delay Register */
+ #define RSPI_SPND 0x0e /* Next-Access Delay Register */
+-#define RSPI_SPCR2 0x0f /* Control Register 2 */
++#define RSPI_SPCR2 0x0f /* Control Register 2 (SH only) */
+ #define RSPI_SPCMD0 0x10 /* Command Register 0 */
+ #define RSPI_SPCMD1 0x12 /* Command Register 1 */
+ #define RSPI_SPCMD2 0x14 /* Command Register 2 */
+@@ -56,10 +56,12 @@
+ #define RSPI_SPCMD5 0x1a /* Command Register 5 */
+ #define RSPI_SPCMD6 0x1c /* Command Register 6 */
+ #define RSPI_SPCMD7 0x1e /* Command Register 7 */
++
++/* RSPI on RZ only */
+ #define RSPI_SPBFCR 0x20 /* Buffer Control Register */
+ #define RSPI_SPBFDR 0x22 /* Buffer Data Count Setting Register */
+
+-/*qspi only */
++/* QSPI only */
+ #define QSPI_SPBFCR 0x18 /* Buffer Control Register */
+ #define QSPI_SPBDCR 0x1a /* Buffer Data Count Register */
+ #define QSPI_SPBMUL0 0x1c /* Transfer Data Length Multiplier Setting Register 0 */
+@@ -102,7 +104,7 @@
+ #define SPSR_PERF 0x08 /* Parity Error Flag */
+ #define SPSR_MODF 0x04 /* Mode Fault Error Flag */
+ #define SPSR_IDLNF 0x02 /* RSPI Idle Flag */
+-#define SPSR_OVRF 0x01 /* Overrun Error Flag */
++#define SPSR_OVRF 0x01 /* Overrun Error Flag (RSPI only) */
+
+ /* SPSCR - Sequence Control Register */
+ #define SPSCR_SPSLN_MASK 0x07 /* Sequence Length Specification */
+@@ -119,13 +121,13 @@
+ #define SPDCR_SPLWORD SPDCR_SPLW1
+ #define SPDCR_SPLBYTE SPDCR_SPLW0
+ #define SPDCR_SPLW 0x20 /* Access Width Specification (SH) */
+-#define SPDCR_SPRDTD 0x10 /* Receive Transmit Data Select */
++#define SPDCR_SPRDTD 0x10 /* Receive Transmit Data Select (SH) */
+ #define SPDCR_SLSEL1 0x08
+ #define SPDCR_SLSEL0 0x04
+-#define SPDCR_SLSEL_MASK 0x0c /* SSL1 Output Select */
++#define SPDCR_SLSEL_MASK 0x0c /* SSL1 Output Select (SH) */
+ #define SPDCR_SPFC1 0x02
+ #define SPDCR_SPFC0 0x01
+-#define SPDCR_SPFC_MASK 0x03 /* Frame Count Setting (1-4) */
++#define SPDCR_SPFC_MASK 0x03 /* Frame Count Setting (1-4) (SH) */
+
+ /* SPCKD - Clock Delay Register */
+ #define SPCKD_SCKDL_MASK 0x07 /* Clock Delay Setting (1-8) */
+@@ -168,8 +170,8 @@
+ #define SPCMD_CPHA 0x0001 /* Clock Phase Setting */
+
+ /* SPBFCR - Buffer Control Register */
+-#define SPBFCR_TXRST 0x80 /* Transmit Buffer Data Reset (qspi only) */
+-#define SPBFCR_RXRST 0x40 /* Receive Buffer Data Reset (qspi only) */
++#define SPBFCR_TXRST 0x80 /* Transmit Buffer Data Reset */
++#define SPBFCR_RXRST 0x40 /* Receive Buffer Data Reset */
+ #define SPBFCR_TXTRG_MASK 0x30 /* Transmit Buffer Data Triggering Number */
+ #define SPBFCR_RXTRG_MASK 0x07 /* Receive Buffer Data Triggering Number */
+
+@@ -244,7 +246,7 @@ struct spi_ops {
+ };
+
+ /*
+- * functions for RSPI
++ * functions for RSPI on legacy SH
+ */
+ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+@@ -280,6 +282,39 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
+ }
+
+ /*
++ * functions for RSPI on RZ
++ */
++static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
++{
++ int spbr;
++
++ /* Sets output mode */
++ rspi_write8(rspi, 0x00, RSPI_SPPCR);
++
++ /* Sets transfer bit rate */
++ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
++ rspi_write8(rspi, clamp(spbr, 0, 255), RSPI_SPBR);
++
++ /* Disable dummy transmission, set byte access */
++ rspi_write8(rspi, SPDCR_SPLBYTE, RSPI_SPDCR);
++ rspi->byte_access = 1;
++
++ /* 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 SPCMD */
++ rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size);
++ rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
++
++ /* Sets RSPI mode */
++ rspi_write8(rspi, SPCR_MSTR, RSPI_SPCR);
++
++ return 0;
++}
++
++/*
+ * functions for QSPI
+ */
+ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+@@ -520,6 +555,13 @@ static void rspi_receive_init(const struct rspi_data *rspi)
+ RSPI_SPSR);
+ }
+
++static void rspi_rz_receive_init(const struct rspi_data *rspi)
++{
++ rspi_receive_init(rspi);
++ rspi_write8(rspi, SPBFCR_TXRST | SPBFCR_RXRST, RSPI_SPBFCR);
++ rspi_write8(rspi, 0, RSPI_SPBFCR);
++}
++
+ static void qspi_receive_init(const struct rspi_data *rspi)
+ {
+ u8 spsr;
+@@ -706,6 +748,41 @@ static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ return 0;
+ }
+
++static int rspi_rz_transfer_out_in(struct rspi_data *rspi,
++ struct spi_transfer *xfer)
++{
++ int remain = xfer->len, ret;
++ const u8 *tx_buf = xfer->tx_buf;
++ u8 *rx_buf = xfer->rx_buf;
++ u8 data;
++
++ rspi_rz_receive_init(rspi);
++
++ while (remain > 0) {
++ data = tx_buf ? *tx_buf++ : DUMMY_DATA;
++ ret = rspi_data_out_in(rspi, data);
++ if (ret < 0)
++ return ret;
++ if (rx_buf)
++ *rx_buf++ = ret;
++ remain--;
++ }
++
++ /* Wait for the last transmission */
++ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
++
++ return 0;
++}
++
++static int rspi_rz_transfer_one(struct spi_master *master,
++ struct spi_device *spi,
++ struct spi_transfer *xfer)
++{
++ struct rspi_data *rspi = spi_master_get_devdata(master);
++
++ return rspi_rz_transfer_out_in(rspi, xfer);
++}
++
+ static int qspi_transfer_out_in(struct rspi_data *rspi,
+ struct spi_transfer *xfer)
+ {
+@@ -1041,6 +1118,11 @@ static struct spi_ops rspi_ops = {
+ .transfer_one = rspi_transfer_one,
+ };
+
++static struct spi_ops rspi_rz_ops = {
++ .set_config_register = rspi_rz_set_config_register,
++ .transfer_one = rspi_rz_transfer_one,
++};
++
+ static struct spi_ops qspi_ops = {
+ .set_config_register = qspi_set_config_register,
+ .transfer_one = qspi_transfer_one,
+@@ -1048,6 +1130,7 @@ static struct spi_ops qspi_ops = {
+
+ static struct platform_device_id spi_driver_ids[] = {
+ { "rspi", (kernel_ulong_t)&rspi_ops },
++ { "rspi-rz", (kernel_ulong_t)&rspi_rz_ops },
+ { "qspi", (kernel_ulong_t)&qspi_ops },
+ {},
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0088-spi-rspi-Add-support-for-loopback-mode.patch b/patches.renesas/0088-spi-rspi-Add-support-for-loopback-mode.patch
new file mode 100644
index 00000000000000..ce0e4b0231cc8c
--- /dev/null
+++ b/patches.renesas/0088-spi-rspi-Add-support-for-loopback-mode.patch
@@ -0,0 +1,87 @@
+From 54b29f6f07854342f81d85463b16a316106c35f6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:44:00 +0100
+Subject: spi: rspi: Add support for loopback mode
+
+Add support for specifying loopback mode.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 06a7a3cff042a36fb7e6af71039a17c6d1a6d90f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 22 ++++++++++++++--------
+ 1 file changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 0c7556978d2e..28db8770aaf3 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -183,8 +183,9 @@ struct rspi_data {
+ struct spi_master *master;
+ wait_queue_head_t wait;
+ struct clk *clk;
+- u8 spsr;
+ u16 spcmd;
++ u8 spsr;
++ u8 sppcr;
+ int rx_irq, tx_irq;
+ const struct spi_ops *ops;
+
+@@ -252,8 +253,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+ int spbr;
+
+- /* Sets output mode(CMOS) and MOSI signal(from previous transfer) */
+- rspi_write8(rspi, 0x00, RSPI_SPPCR);
++ /* Sets output mode, MOSI signal, and (optionally) loopback */
++ rspi_write8(rspi, rspi->sppcr, RSPI_SPPCR);
+
+ /* Sets transfer bit rate */
+ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
+@@ -288,8 +289,8 @@ static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+ int spbr;
+
+- /* Sets output mode */
+- rspi_write8(rspi, 0x00, RSPI_SPPCR);
++ /* Sets output mode, MOSI signal, and (optionally) loopback */
++ rspi_write8(rspi, rspi->sppcr, RSPI_SPPCR);
+
+ /* Sets transfer bit rate */
+ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz) - 1;
+@@ -322,8 +323,8 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+ u16 spcmd;
+ int spbr;
+
+- /* Sets output mode(CMOS) and MOSI signal(from previous transfer) */
+- rspi_write8(rspi, 0x00, RSPI_SPPCR);
++ /* Sets output mode, MOSI signal, and (optionally) loopback */
++ rspi_write8(rspi, rspi->sppcr, RSPI_SPPCR);
+
+ /* Sets transfer bit rate */
+ spbr = clk_get_rate(rspi->clk) / (2 * rspi->max_speed_hz);
+@@ -829,6 +830,11 @@ static int rspi_setup(struct spi_device *spi)
+ if (spi->mode & SPI_CPHA)
+ rspi->spcmd |= SPCMD_CPHA;
+
++ /* CMOS output mode and MOSI signal from previous transfer */
++ rspi->sppcr = 0;
++ if (spi->mode & SPI_LOOP)
++ rspi->sppcr |= SPPCR_SPLP;
++
+ set_config_register(rspi, 8);
+
+ return 0;
+@@ -1050,7 +1056,7 @@ static int rspi_probe(struct platform_device *pdev)
+ master->cleanup = rspi_cleanup;
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+- master->mode_bits = SPI_CPHA | SPI_CPOL;
++ master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP;
+
+ ret = platform_get_irq_byname(pdev, "rx");
+ if (ret < 0) {
+--
+2.1.2
+
diff --git a/patches.renesas/0089-spi-rspi-Convert-to-clk_prepare_enable-disable_unpre.patch b/patches.renesas/0089-spi-rspi-Convert-to-clk_prepare_enable-disable_unpre.patch
new file mode 100644
index 00000000000000..6ffa2deea9e7f4
--- /dev/null
+++ b/patches.renesas/0089-spi-rspi-Convert-to-clk_prepare_enable-disable_unpre.patch
@@ -0,0 +1,55 @@
+From 571da81201378c6fe16c0f73e6da32a0a6bf63c3 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:44:01 +0100
+Subject: spi: rspi: Convert to clk_prepare_enable/disable_unprepare
+
+Get the driver ready for the migration to the common clock framework by
+calling clk_prepare_enable() and clk_disable_unprepare().
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 17fe0d9a28fe742c467f800625459cf7bcb44b3b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 28db8770aaf3..a648b40c271b 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -980,7 +980,7 @@ static int rspi_remove(struct platform_device *pdev)
+ struct rspi_data *rspi = platform_get_drvdata(pdev);
+
+ rspi_release_dma(rspi);
+- clk_disable(rspi->clk);
++ clk_disable_unprepare(rspi->clk);
+
+ return 0;
+ }
+@@ -1041,7 +1041,12 @@ static int rspi_probe(struct platform_device *pdev)
+ ret = PTR_ERR(rspi->clk);
+ goto error1;
+ }
+- clk_enable(rspi->clk);
++
++ ret = clk_prepare_enable(rspi->clk);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "unable to prepare/enable clock\n");
++ goto error1;
++ }
+
+ init_waitqueue_head(&rspi->wait);
+
+@@ -1112,7 +1117,7 @@ static int rspi_probe(struct platform_device *pdev)
+ error3:
+ rspi_release_dma(rspi);
+ error2:
+- clk_disable(rspi->clk);
++ clk_disable_unprepare(rspi->clk);
+ error1:
+ spi_master_put(master);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0090-spi-rspi-Use-NULL-as-the-clock-ID.patch b/patches.renesas/0090-spi-rspi-Use-NULL-as-the-clock-ID.patch
new file mode 100644
index 00000000000000..7daae77f91a9a5
--- /dev/null
+++ b/patches.renesas/0090-spi-rspi-Use-NULL-as-the-clock-ID.patch
@@ -0,0 +1,40 @@
+From c73c5e4e4353762705381d51bd245151bbf26fa2 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 24 Jan 2014 09:44:02 +0100
+Subject: spi: rspi: Use NULL as the clock ID
+
+There's only one RSPI/QSPI clock, so we can use NULL as the clock ID
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 29f397b739ceef90c8b848f6579cbacd088e896e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index a648b40c271b..d79a7ed9b92e 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -1004,7 +1004,6 @@ static int rspi_probe(struct platform_device *pdev)
+ struct spi_master *master;
+ struct rspi_data *rspi;
+ int ret;
+- char clk_name[16];
+ const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev);
+ const struct spi_ops *ops;
+ const struct platform_device_id *id_entry = pdev->id_entry;
+@@ -1034,8 +1033,7 @@ static int rspi_probe(struct platform_device *pdev)
+ goto error1;
+ }
+
+- snprintf(clk_name, sizeof(clk_name), "%s%d", id_entry->name, pdev->id);
+- rspi->clk = devm_clk_get(&pdev->dev, clk_name);
++ rspi->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(rspi->clk)) {
+ dev_err(&pdev->dev, "cannot get clock\n");
+ ret = PTR_ERR(rspi->clk);
+--
+2.1.2
+
diff --git a/patches.renesas/0091-spi-rspi-Add-DT-support.patch b/patches.renesas/0091-spi-rspi-Add-DT-support.patch
new file mode 100644
index 00000000000000..880b2dae9b5edd
--- /dev/null
+++ b/patches.renesas/0091-spi-rspi-Add-DT-support.patch
@@ -0,0 +1,250 @@
+From cc7129f229504fcbe503f1ccdbbb1e03538ad68c Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 28 Jan 2014 10:21:38 +0100
+Subject: spi: rspi: Add DT support
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 426ef76dd8a394a0e04d096941cd9acb49539a3e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/spi/spi-rspi.txt | 59 ++++++++++++
+ drivers/spi/spi-rspi.c | 106 +++++++++++++++------
+ 2 files changed, 136 insertions(+), 29 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/spi/spi-rspi.txt
+
+diff --git a/Documentation/devicetree/bindings/spi/spi-rspi.txt b/Documentation/devicetree/bindings/spi/spi-rspi.txt
+new file mode 100644
+index 000000000000..95f9b21d239f
+--- /dev/null
++++ b/Documentation/devicetree/bindings/spi/spi-rspi.txt
+@@ -0,0 +1,59 @@
++Device tree configuration for Renesas RSPI/QSPI driver
++
++Required properties:
++- compatible : For Renesas Serial Peripheral Interface on legacy SH:
++ "renesas,rspi-<soctype>", "renesas,rspi" as fallback.
++ For Renesas Serial Peripheral Interface on RZ/A1H:
++ "renesas,rspi-<soctype>", "renesas,rspi-rz" as fallback.
++ For Quad Serial Peripheral Interface on R-Car Gen2:
++ "renesas,qspi-<soctype>", "renesas,qspi" as fallback.
++ Examples of valid soctypes are "sh7757" (SH),
++ "r7s72100" (RZ/A1H), "r8a7790" (R-Car H2), and
++ "r8a7791" (R-Car M2).
++- reg : Address start and address range size of the device
++- interrupts : A list of interrupt-specifiers, one for each entry in
++ interrupt-names.
++ If interrupt-names is not present, an interrupt specifier
++ for a single muxed interrupt.
++- interrupt-names : A list of interrupt names. Should contain (if present):
++ - "error" for SPEI,
++ - "rx" for SPRI,
++ - "tx" to SPTI,
++ - "mux" for a single muxed interrupt.
++- interrupt-parent : The phandle for the interrupt controller that
++ services interrupts for this device.
++- num-cs : Number of chip selects. Some RSPI cores have more than 1.
++- #address-cells : Must be <1>
++- #size-cells : Must be <0>
++
++Optional properties:
++- clocks: : Must contain a reference to the functional clock.
++
++Pinctrl properties might be needed, too. See
++Documentation/devicetree/bindings/pinctrl/renesas,*.
++
++Examples:
++
++ spi0: spi@e800c800 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800c800 0x24>;
++ interrupts = <0 238 IRQ_TYPE_LEVEL_HIGH>,
++ <0 239 IRQ_TYPE_LEVEL_HIGH>,
++ <0 240 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ interrupt-parent = <&gic>;
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ };
++
++ spi: spi@e6b10000 {
++ compatible = "renesas,qspi-r8a7791", "renesas,qspi";
++ reg = <0 0xe6b10000 0 0x2c>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ };
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index d79a7ed9b92e..e56fcb5f7f99 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -31,6 +31,7 @@
+ #include <linux/clk.h>
+ #include <linux/dmaengine.h>
+ #include <linux/dma-mapping.h>
++#include <linux/of_device.h>
+ #include <linux/sh_dma.h>
+ #include <linux/spi/spi.h>
+ #include <linux/spi/rspi.h>
+@@ -985,6 +986,56 @@ static int rspi_remove(struct platform_device *pdev)
+ return 0;
+ }
+
++static const struct spi_ops rspi_ops = {
++ .set_config_register = rspi_set_config_register,
++ .transfer_one = rspi_transfer_one,
++};
++
++static const struct spi_ops rspi_rz_ops = {
++ .set_config_register = rspi_rz_set_config_register,
++ .transfer_one = rspi_rz_transfer_one,
++};
++
++static const struct spi_ops qspi_ops = {
++ .set_config_register = qspi_set_config_register,
++ .transfer_one = qspi_transfer_one,
++};
++
++#ifdef CONFIG_OF
++static const struct of_device_id rspi_of_match[] = {
++ /* RSPI on legacy SH */
++ { .compatible = "renesas,rspi", .data = &rspi_ops },
++ /* RSPI on RZ/A1H */
++ { .compatible = "renesas,rspi-rz", .data = &rspi_rz_ops },
++ /* QSPI on R-Car Gen2 */
++ { .compatible = "renesas,qspi", .data = &qspi_ops },
++ { /* sentinel */ }
++};
++
++MODULE_DEVICE_TABLE(of, rspi_of_match);
++
++static int rspi_parse_dt(struct device *dev, struct spi_master *master)
++{
++ u32 num_cs;
++ int error;
++
++ /* Parse DT properties */
++ error = of_property_read_u32(dev->of_node, "num-cs", &num_cs);
++ if (error) {
++ dev_err(dev, "of_property_read_u32 num-cs failed %d\n", error);
++ return error;
++ }
++
++ master->num_chipselect = num_cs;
++ return 0;
++}
++#else
++static inline int rspi_parse_dt(struct device *dev, struct spi_master *master)
++{
++ return -EINVAL;
++}
++#endif /* CONFIG_OF */
++
+ static int rspi_request_irq(struct device *dev, unsigned int irq,
+ irq_handler_t handler, const char *suffix,
+ void *dev_id)
+@@ -1004,16 +1055,9 @@ static int rspi_probe(struct platform_device *pdev)
+ struct spi_master *master;
+ struct rspi_data *rspi;
+ int ret;
+- const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev);
++ const struct of_device_id *of_id;
++ const struct rspi_plat_data *rspi_pd;
+ const struct spi_ops *ops;
+- const struct platform_device_id *id_entry = pdev->id_entry;
+-
+- ops = (struct spi_ops *)id_entry->driver_data;
+- /* ops parameter check */
+- if (!ops->set_config_register) {
+- dev_err(&pdev->dev, "there is no set_config_register\n");
+- return -ENODEV;
+- }
+
+ master = spi_alloc_master(&pdev->dev, sizeof(struct rspi_data));
+ if (master == NULL) {
+@@ -1021,6 +1065,28 @@ static int rspi_probe(struct platform_device *pdev)
+ return -ENOMEM;
+ }
+
++ of_id = of_match_device(rspi_of_match, &pdev->dev);
++ if (of_id) {
++ ops = of_id->data;
++ ret = rspi_parse_dt(&pdev->dev, master);
++ if (ret)
++ goto error1;
++ } else {
++ ops = (struct spi_ops *)pdev->id_entry->driver_data;
++ rspi_pd = dev_get_platdata(&pdev->dev);
++ if (rspi_pd && rspi_pd->num_chipselect)
++ master->num_chipselect = rspi_pd->num_chipselect;
++ else
++ master->num_chipselect = 2; /* default */
++ };
++
++ /* ops parameter check */
++ if (!ops->set_config_register) {
++ dev_err(&pdev->dev, "there is no set_config_register\n");
++ ret = -ENODEV;
++ goto error1;
++ }
++
+ rspi = spi_master_get_devdata(master);
+ platform_set_drvdata(pdev, rspi);
+ rspi->ops = ops;
+@@ -1048,11 +1114,6 @@ static int rspi_probe(struct platform_device *pdev)
+
+ init_waitqueue_head(&rspi->wait);
+
+- if (rspi_pd && rspi_pd->num_chipselect)
+- master->num_chipselect = rspi_pd->num_chipselect;
+- else
+- master->num_chipselect = 2; /* default */
+-
+ master->bus_num = pdev->id;
+ master->setup = rspi_setup;
+ master->transfer_one = ops->transfer_one;
+@@ -1060,6 +1121,7 @@ static int rspi_probe(struct platform_device *pdev)
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+ master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP;
++ master->dev.of_node = pdev->dev.of_node;
+
+ ret = platform_get_irq_byname(pdev, "rx");
+ if (ret < 0) {
+@@ -1122,21 +1184,6 @@ error1:
+ return ret;
+ }
+
+-static struct spi_ops rspi_ops = {
+- .set_config_register = rspi_set_config_register,
+- .transfer_one = rspi_transfer_one,
+-};
+-
+-static struct spi_ops rspi_rz_ops = {
+- .set_config_register = rspi_rz_set_config_register,
+- .transfer_one = rspi_rz_transfer_one,
+-};
+-
+-static struct spi_ops qspi_ops = {
+- .set_config_register = qspi_set_config_register,
+- .transfer_one = qspi_transfer_one,
+-};
+-
+ static struct platform_device_id spi_driver_ids[] = {
+ { "rspi", (kernel_ulong_t)&rspi_ops },
+ { "rspi-rz", (kernel_ulong_t)&rspi_rz_ops },
+@@ -1153,6 +1200,7 @@ static struct platform_driver rspi_driver = {
+ .driver = {
+ .name = "renesas_spi",
+ .owner = THIS_MODULE,
++ .of_match_table = of_match_ptr(rspi_of_match),
+ },
+ };
+ module_platform_driver(rspi_driver);
+--
+2.1.2
+
diff --git a/patches.renesas/0092-spi-rspi-Add-support-for-Quad-and-Dual-SPI-Transfers.patch b/patches.renesas/0092-spi-rspi-Add-support-for-Quad-and-Dual-SPI-Transfers.patch
new file mode 100644
index 00000000000000..747af722a126ac
--- /dev/null
+++ b/patches.renesas/0092-spi-rspi-Add-support-for-Quad-and-Dual-SPI-Transfers.patch
@@ -0,0 +1,314 @@
+From 6242b9ab76e120e95102cc1fed1e795a6ece0188 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 30 Jan 2014 09:43:50 +0100
+Subject: spi: rspi: Add support for Quad and Dual SPI Transfers on QSPI
+
+Add support for Quad and Dual SPI Transfers on the Renesas Quad Serial
+Peripheral Interface, as found in R-Car Gen2 SoCs like R-Car H2 (r8a7790)
+and R-Car M2 (r8a7791):
+ - Add unidirectional transfer methods for Quad/Dual SPI Transfers.
+ - Program the sequencer to handle SPI messages with multiple transfer
+ modes when Quad or Dual transfers are enabled for an SPI slave.
+ Up to 4 transfer modes per SPI message are supported by the hardware.
+ - Advertise the availability of Quad and Dual SPI modes on QSPI.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 880c6d114fd79a6973708744c78c7f55da6aea4c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 162 ++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 148 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index e56fcb5f7f99..34ad4bca8a41 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -2,6 +2,7 @@
+ * SH RSPI driver
+ *
+ * Copyright (C) 2012, 2013 Renesas Solutions Corp.
++ * Copyright (C) 2014 Glider bvba
+ *
+ * Based on spi-sh.c:
+ * Copyright (C) 2011 Renesas Solutions Corp.
+@@ -57,6 +58,10 @@
+ #define RSPI_SPCMD5 0x1a /* Command Register 5 */
+ #define RSPI_SPCMD6 0x1c /* Command Register 6 */
+ #define RSPI_SPCMD7 0x1e /* Command Register 7 */
++#define RSPI_SPCMD(i) (RSPI_SPCMD0 + (i) * 2)
++#define RSPI_NUM_SPCMD 8
++#define RSPI_RZ_NUM_SPCMD 4
++#define QSPI_NUM_SPCMD 4
+
+ /* RSPI on RZ only */
+ #define RSPI_SPBFCR 0x20 /* Buffer Control Register */
+@@ -69,6 +74,7 @@
+ #define QSPI_SPBMUL1 0x20 /* Transfer Data Length Multiplier Setting Register 1 */
+ #define QSPI_SPBMUL2 0x24 /* Transfer Data Length Multiplier Setting Register 2 */
+ #define QSPI_SPBMUL3 0x28 /* Transfer Data Length Multiplier Setting Register 3 */
++#define QSPI_SPBMUL(i) (QSPI_SPBMUL0 + (i) * 4)
+
+ /* SPCR - Control Register */
+ #define SPCR_SPRIE 0x80 /* Receive Interrupt Enable */
+@@ -152,7 +158,7 @@
+ #define SPCMD_LSBF 0x1000 /* LSB First */
+ #define SPCMD_SPB_MASK 0x0f00 /* Data Length Setting */
+ #define SPCMD_SPB_8_TO_16(bit) (((bit - 1) << 8) & SPCMD_SPB_MASK)
+-#define SPCMD_SPB_8BIT 0x0000 /* qspi only */
++#define SPCMD_SPB_8BIT 0x0000 /* QSPI only */
+ #define SPCMD_SPB_16BIT 0x0100
+ #define SPCMD_SPB_20BIT 0x0000
+ #define SPCMD_SPB_24BIT 0x0100
+@@ -245,6 +251,7 @@ struct spi_ops {
+ int (*set_config_register)(struct rspi_data *rspi, int access_size);
+ int (*transfer_one)(struct spi_master *master, struct spi_device *spi,
+ struct spi_transfer *xfer);
++ u16 mode_bits;
+ };
+
+ /*
+@@ -274,8 +281,8 @@ static int rspi_set_config_register(struct rspi_data *rspi, int access_size)
+ rspi_write8(rspi, 0x00, RSPI_SPCR2);
+
+ /* Sets SPCMD */
+- rspi_write16(rspi, SPCMD_SPB_8_TO_16(access_size) | rspi->spcmd,
+- RSPI_SPCMD0);
++ rspi->spcmd |= SPCMD_SPB_8_TO_16(access_size);
++ rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
+
+ /* Sets RSPI mode */
+ rspi_write8(rspi, SPCR_MSTR, RSPI_SPCR);
+@@ -321,7 +328,6 @@ static int rspi_rz_set_config_register(struct rspi_data *rspi, int access_size)
+ */
+ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+ {
+- u16 spcmd;
+ int spbr;
+
+ /* Sets output mode, MOSI signal, and (optionally) loopback */
+@@ -342,13 +348,13 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+
+ /* Data Length Setting */
+ if (access_size == 8)
+- spcmd = SPCMD_SPB_8BIT;
++ rspi->spcmd |= SPCMD_SPB_8BIT;
+ else if (access_size == 16)
+- spcmd = SPCMD_SPB_16BIT;
++ rspi->spcmd |= SPCMD_SPB_16BIT;
+ else
+- spcmd = SPCMD_SPB_32BIT;
++ rspi->spcmd |= SPCMD_SPB_32BIT;
+
+- spcmd |= SPCMD_SCKDEN | SPCMD_SLNDEN | rspi->spcmd | SPCMD_SPNDEN;
++ rspi->spcmd |= SPCMD_SCKDEN | SPCMD_SLNDEN | SPCMD_SPNDEN;
+
+ /* Resets transfer data length */
+ rspi_write32(rspi, 0, QSPI_SPBMUL0);
+@@ -359,9 +365,9 @@ static int qspi_set_config_register(struct rspi_data *rspi, int access_size)
+ rspi_write8(rspi, 0x00, QSPI_SPBFCR);
+
+ /* Sets SPCMD */
+- rspi_write16(rspi, spcmd, RSPI_SPCMD0);
++ rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
+
+- /* Enables SPI function in a master mode */
++ /* Enables SPI function in master mode */
+ rspi_write8(rspi, SPCR_SPE | SPCR_MSTR, RSPI_SPCR);
+
+ return 0;
+@@ -811,12 +817,55 @@ static int qspi_transfer_out_in(struct rspi_data *rspi,
+ return 0;
+ }
+
++static int qspi_transfer_out(struct rspi_data *rspi, struct spi_transfer *xfer)
++{
++ const u8 *buf = xfer->tx_buf;
++ unsigned int i;
++ int ret;
++
++ for (i = 0; i < xfer->len; i++) {
++ ret = rspi_data_out(rspi, *buf++);
++ if (ret < 0)
++ return ret;
++ }
++
++ /* Wait for the last transmission */
++ rspi_wait_for_interrupt(rspi, SPSR_SPTEF, SPCR_SPTIE);
++
++ return 0;
++}
++
++static int qspi_transfer_in(struct rspi_data *rspi, struct spi_transfer *xfer)
++{
++ u8 *buf = xfer->rx_buf;
++ unsigned int i;
++ int ret;
++
++ for (i = 0; i < xfer->len; i++) {
++ ret = rspi_data_in(rspi);
++ if (ret < 0)
++ return ret;
++ *buf++ = ret;
++ }
++
++ return 0;
++}
++
+ static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ struct spi_transfer *xfer)
+ {
+ struct rspi_data *rspi = spi_master_get_devdata(master);
+
+- return qspi_transfer_out_in(rspi, xfer);
++ if (xfer->tx_buf && xfer->tx_nbits > SPI_NBITS_SINGLE) {
++ /* Quad or Dual SPI Write */
++ return qspi_transfer_out(rspi, xfer);
++ } else if (xfer->rx_buf && xfer->rx_nbits > SPI_NBITS_SINGLE) {
++ /* Quad or Dual SPI Read */
++ return qspi_transfer_in(rspi, xfer);
++ } else {
++ /* Single SPI Transfer */
++ return qspi_transfer_out_in(rspi, xfer);
++ }
+ }
+
+ static int rspi_setup(struct spi_device *spi)
+@@ -845,21 +894,101 @@ static void rspi_cleanup(struct spi_device *spi)
+ {
+ }
+
++static u16 qspi_transfer_mode(const struct spi_transfer *xfer)
++{
++ if (xfer->tx_buf)
++ switch (xfer->tx_nbits) {
++ case SPI_NBITS_QUAD:
++ return SPCMD_SPIMOD_QUAD;
++ case SPI_NBITS_DUAL:
++ return SPCMD_SPIMOD_DUAL;
++ default:
++ return 0;
++ }
++ if (xfer->rx_buf)
++ switch (xfer->rx_nbits) {
++ case SPI_NBITS_QUAD:
++ return SPCMD_SPIMOD_QUAD | SPCMD_SPRW;
++ case SPI_NBITS_DUAL:
++ return SPCMD_SPIMOD_DUAL | SPCMD_SPRW;
++ default:
++ return 0;
++ }
++
++ return 0;
++}
++
++static int qspi_setup_sequencer(struct rspi_data *rspi,
++ const struct spi_message *msg)
++{
++ const struct spi_transfer *xfer;
++ unsigned int i = 0, len = 0;
++ u16 current_mode = 0xffff, mode;
++
++ list_for_each_entry(xfer, &msg->transfers, transfer_list) {
++ mode = qspi_transfer_mode(xfer);
++ if (mode == current_mode) {
++ len += xfer->len;
++ continue;
++ }
++
++ /* Transfer mode change */
++ if (i) {
++ /* Set transfer data length of previous transfer */
++ rspi_write32(rspi, len, QSPI_SPBMUL(i - 1));
++ }
++
++ if (i >= QSPI_NUM_SPCMD) {
++ dev_err(&msg->spi->dev,
++ "Too many different transfer modes");
++ return -EINVAL;
++ }
++
++ /* Program transfer mode for this transfer */
++ rspi_write16(rspi, rspi->spcmd | mode, RSPI_SPCMD(i));
++ current_mode = mode;
++ len = xfer->len;
++ i++;
++ }
++ if (i) {
++ /* Set final transfer data length and sequence length */
++ rspi_write32(rspi, len, QSPI_SPBMUL(i - 1));
++ rspi_write8(rspi, i - 1, RSPI_SPSCR);
++ }
++
++ return 0;
++}
++
+ static int rspi_prepare_message(struct spi_master *master,
+- struct spi_message *message)
++ struct spi_message *msg)
+ {
+ struct rspi_data *rspi = spi_master_get_devdata(master);
++ int ret;
+
++ if (msg->spi->mode &
++ (SPI_TX_DUAL | SPI_TX_QUAD | SPI_RX_DUAL | SPI_RX_QUAD)) {
++ /* Setup sequencer for messages with multiple transfer modes */
++ ret = qspi_setup_sequencer(rspi, msg);
++ if (ret < 0)
++ return ret;
++ }
++
++ /* Enable SPI function in master mode */
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) | SPCR_SPE, RSPI_SPCR);
+ return 0;
+ }
+
+ static int rspi_unprepare_message(struct spi_master *master,
+- struct spi_message *message)
++ struct spi_message *msg)
+ {
+ struct rspi_data *rspi = spi_master_get_devdata(master);
+
++ /* Disable SPI function */
+ rspi_write8(rspi, rspi_read8(rspi, RSPI_SPCR) & ~SPCR_SPE, RSPI_SPCR);
++
++ /* Reset sequencer for Single SPI Transfers */
++ rspi_write16(rspi, rspi->spcmd, RSPI_SPCMD0);
++ rspi_write8(rspi, 0, RSPI_SPSCR);
+ return 0;
+ }
+
+@@ -989,16 +1118,21 @@ static int rspi_remove(struct platform_device *pdev)
+ static const struct spi_ops rspi_ops = {
+ .set_config_register = rspi_set_config_register,
+ .transfer_one = rspi_transfer_one,
++ .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP,
+ };
+
+ static const struct spi_ops rspi_rz_ops = {
+ .set_config_register = rspi_rz_set_config_register,
+ .transfer_one = rspi_rz_transfer_one,
++ .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP,
+ };
+
+ static const struct spi_ops qspi_ops = {
+ .set_config_register = qspi_set_config_register,
+ .transfer_one = qspi_transfer_one,
++ .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP |
++ SPI_TX_DUAL | SPI_TX_QUAD |
++ SPI_RX_DUAL | SPI_RX_QUAD,
+ };
+
+ #ifdef CONFIG_OF
+@@ -1120,7 +1254,7 @@ static int rspi_probe(struct platform_device *pdev)
+ master->cleanup = rspi_cleanup;
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+- master->mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP;
++ master->mode_bits = ops->mode_bits;
+ master->dev.of_node = pdev->dev.of_node;
+
+ ret = platform_get_irq_byname(pdev, "rx");
+--
+2.1.2
+
diff --git a/patches.renesas/0093-spi-rspi-fix-build-error-when-CONFIG_OF-is-not-set.patch b/patches.renesas/0093-spi-rspi-fix-build-error-when-CONFIG_OF-is-not-set.patch
new file mode 100644
index 00000000000000..158ce4b42f27ed
--- /dev/null
+++ b/patches.renesas/0093-spi-rspi-fix-build-error-when-CONFIG_OF-is-not-set.patch
@@ -0,0 +1,34 @@
+From 62e867ade9937147e6df85cb10da7b06ab7758d8 Mon Sep 17 00:00:00 2001
+From: "Shimoda, Yoshihiro" <yoshihiro.shimoda.uh@renesas.com>
+Date: Mon, 3 Feb 2014 10:43:46 +0900
+Subject: spi: rspi: fix build error when CONFIG_OF is not set
+
+This patch fixes an issue that the following build error happens when
+the CONFIG_OF is not set:
+
+drivers/spi/spi-rspi.c: In function 'rspi_probe':
+drivers/spi/spi-rspi.c:1203:26: error: 'rspi_of_match' undeclared (first use in this function)
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 64b67defe4eb4de2d2df8acd5584a9e28fa727d3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 34ad4bca8a41..e5cfc3d77b8c 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -1164,6 +1164,7 @@ static int rspi_parse_dt(struct device *dev, struct spi_master *master)
+ return 0;
+ }
+ #else
++#define rspi_of_match NULL
+ static inline int rspi_parse_dt(struct device *dev, struct spi_master *master)
+ {
+ return -EINVAL;
+--
+2.1.2
+
diff --git a/patches.renesas/0094-spi-rspi-Only-enable-interrupts-when-there-s-a-need-.patch b/patches.renesas/0094-spi-rspi-Only-enable-interrupts-when-there-s-a-need-.patch
new file mode 100644
index 00000000000000..be789809b42121
--- /dev/null
+++ b/patches.renesas/0094-spi-rspi-Only-enable-interrupts-when-there-s-a-need-.patch
@@ -0,0 +1,64 @@
+From 5e1ba70515975b8c87b7aa2bd4ae730f307780a8 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 11:06:24 +0100
+Subject: spi: rspi: Only enable interrupts when there's a need to wait
+
+rspi_wait_for_interrupt() unconditionally enables interrupts, even when the
+wait condition is already satisfied. This causes a high interrupt load (2
+interrupts/byte for full-duplex Single SPI transfers, 1 interrupt/byte for
+RSPI with TX Only mode, or QSPI in unidirectional Dual or Quad Transfer
+mode).
+
+Change this to return immediately when the wait condition is satisfied.
+This dramatically reduces the interrupt load, especially in high-speed
+Quad Transfer mode, and increases transfer speed, as no interrupts need to
+be handled when there's space available in the output FIFO, or data
+available in the input FIFO.
+
+Benchmark results for QSPI on r8a7791 while reading 1 MiB from 30 MHz SPI
+FLASH on the Koelsch development board:
+
+Before:
+ Single SPI Dual SPI Quad SPI
+ Interrupts: 2096856 1048592 1048594
+ Mbps: 0.9 1.6 1.6
+
+After:
+
+ Single SPI Dual SPI Quad SPI
+ Interrupts: 1048569 21295 8
+ Mbps: 0.7 10.8 12.9
+
+I don't know why Single SPI slowed down a bit.
+
+I've also verified functionality for RSPI-RZ on r7s72100, but don't have
+benchmark results as there's no SPI FLASH connected to RSPI on the Genmai
+development board. Unlike RSPI and QSPI, RSPI-RZ has separate interrupts
+for RX and TX, which shows that Single SPI transfers now generate (mostly)
+RX interrupts, as expected.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 5dd1ad23af689591d70be06ee6efcc57d1ec2d16)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index e5cfc3d77b8c..04528888a53f 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -391,6 +391,9 @@ static int rspi_wait_for_interrupt(struct rspi_data *rspi, u8 wait_mask,
+ int ret;
+
+ rspi->spsr = rspi_read8(rspi, RSPI_SPSR);
++ if (rspi->spsr & wait_mask)
++ return 0;
++
+ rspi_enable_irq(rspi, enable_bit);
+ ret = wait_event_timeout(rspi->wait, rspi->spsr & wait_mask, HZ);
+ if (ret == 0 && !(rspi->spsr & wait_mask))
+--
+2.1.2
+
diff --git a/patches.renesas/0095-spi-rspi-Remove-empty-rspi_cleanup.patch b/patches.renesas/0095-spi-rspi-Remove-empty-rspi_cleanup.patch
new file mode 100644
index 00000000000000..a11819d945b66c
--- /dev/null
+++ b/patches.renesas/0095-spi-rspi-Remove-empty-rspi_cleanup.patch
@@ -0,0 +1,41 @@
+From 58242aaf25fcac85ce991057a0f9d1c1f4825ae6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 21 Feb 2014 17:29:17 +0100
+Subject: spi: rspi: Remove empty rspi_cleanup()
+
+If spi_master.cleanup() is not needed, it can be left unimplemented.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ab98fcba962a57cee9fdb97aff2b25248c93cea5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 04528888a53f..4a1f978c3381 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -893,10 +893,6 @@ static int rspi_setup(struct spi_device *spi)
+ return 0;
+ }
+
+-static void rspi_cleanup(struct spi_device *spi)
+-{
+-}
+-
+ static u16 qspi_transfer_mode(const struct spi_transfer *xfer)
+ {
+ if (xfer->tx_buf)
+@@ -1255,7 +1251,6 @@ static int rspi_probe(struct platform_device *pdev)
+ master->bus_num = pdev->id;
+ master->setup = rspi_setup;
+ master->transfer_one = ops->transfer_one;
+- master->cleanup = rspi_cleanup;
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+ master->mode_bits = ops->mode_bits;
+--
+2.1.2
+
diff --git a/patches.renesas/0096-spi-rspi-Fix-loopback-mode-for-Dual-Quad-SPI-Transfe.patch b/patches.renesas/0096-spi-rspi-Fix-loopback-mode-for-Dual-Quad-SPI-Transfe.patch
new file mode 100644
index 00000000000000..172c4eb2283ffb
--- /dev/null
+++ b/patches.renesas/0096-spi-rspi-Fix-loopback-mode-for-Dual-Quad-SPI-Transfe.patch
@@ -0,0 +1,38 @@
+From 79a7a72eed9898b243b8bbe3acc7f31211676ad2 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 21 Feb 2014 17:29:18 +0100
+Subject: spi: rspi: Fix loopback mode for Dual/Quad SPI Transfers
+
+While normal Dual and Quad SPI Transfers are unidirectional, we must do
+a bidirectional transfer if loopback mode is enabled, else rx_buf is not
+filled.
+
+With spidev it seemed to work, as spidev uses the same buffer for
+tranmission and reception.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ba824d4971691a7f1f66429e378a08a95fbb5b79)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 4a1f978c3381..92bec7e91046 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -859,7 +859,9 @@ static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi,
+ {
+ struct rspi_data *rspi = spi_master_get_devdata(master);
+
+- if (xfer->tx_buf && xfer->tx_nbits > SPI_NBITS_SINGLE) {
++ if (spi->mode & SPI_LOOP) {
++ return qspi_transfer_out_in(rspi, xfer);
++ } else if (xfer->tx_buf && xfer->tx_nbits > SPI_NBITS_SINGLE) {
+ /* Quad or Dual SPI Write */
+ return qspi_transfer_out(rspi, xfer);
+ } else if (xfer->rx_buf && xfer->rx_nbits > SPI_NBITS_SINGLE) {
+--
+2.1.2
+
diff --git a/patches.renesas/0097-spi-rspi-Add-runtime-PM-support-using-spi-core-auto_.patch b/patches.renesas/0097-spi-rspi-Add-runtime-PM-support-using-spi-core-auto_.patch
new file mode 100644
index 00000000000000..5c5ba4ebd14f60
--- /dev/null
+++ b/patches.renesas/0097-spi-rspi-Add-runtime-PM-support-using-spi-core-auto_.patch
@@ -0,0 +1,65 @@
+From 0d8c5015f69eede2cb2c6e888b05df3a28261ece Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 10:59:12 +0100
+Subject: spi: rspi: Add runtime PM support, using spi core auto_runtime_pm
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 490c97747d5dc77dfb5826e2823b41d8b2ef7ecc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-rspi.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
+index 92bec7e91046..1fb0ad213324 100644
+--- a/drivers/spi/spi-rspi.c
++++ b/drivers/spi/spi-rspi.c
+@@ -33,6 +33,7 @@
+ #include <linux/dmaengine.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/of_device.h>
++#include <linux/pm_runtime.h>
+ #include <linux/sh_dma.h>
+ #include <linux/spi/spi.h>
+ #include <linux/spi/rspi.h>
+@@ -1111,7 +1112,7 @@ static int rspi_remove(struct platform_device *pdev)
+ struct rspi_data *rspi = platform_get_drvdata(pdev);
+
+ rspi_release_dma(rspi);
+- clk_disable_unprepare(rspi->clk);
++ pm_runtime_disable(&pdev->dev);
+
+ return 0;
+ }
+@@ -1242,16 +1243,13 @@ static int rspi_probe(struct platform_device *pdev)
+ goto error1;
+ }
+
+- ret = clk_prepare_enable(rspi->clk);
+- if (ret < 0) {
+- dev_err(&pdev->dev, "unable to prepare/enable clock\n");
+- goto error1;
+- }
++ pm_runtime_enable(&pdev->dev);
+
+ init_waitqueue_head(&rspi->wait);
+
+ master->bus_num = pdev->id;
+ master->setup = rspi_setup;
++ master->auto_runtime_pm = true;
+ master->transfer_one = ops->transfer_one;
+ master->prepare_message = rspi_prepare_message;
+ master->unprepare_message = rspi_unprepare_message;
+@@ -1312,7 +1310,7 @@ static int rspi_probe(struct platform_device *pdev)
+ error3:
+ rspi_release_dma(rspi);
+ error2:
+- clk_disable_unprepare(rspi->clk);
++ pm_runtime_disable(&pdev->dev);
+ error1:
+ spi_master_put(master);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0098-sh-intc-Enable-driver-compilation-with-COMPILE_TEST.patch b/patches.renesas/0098-sh-intc-Enable-driver-compilation-with-COMPILE_TEST.patch
new file mode 100644
index 00000000000000..159875f801b498
--- /dev/null
+++ b/patches.renesas/0098-sh-intc-Enable-driver-compilation-with-COMPILE_TEST.patch
@@ -0,0 +1,31 @@
+From 517a42ba17e50c994ad31232fd675705634c7fea Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Wed, 27 Nov 2013 02:18:37 +0100
+Subject: sh: intc: Enable driver compilation with COMPILE_TEST
+
+This helps increasing build testing coverage.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4f3068f60503e08bc9e729528d9e54289980fa96)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/sh/intc/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/sh/intc/Kconfig b/drivers/sh/intc/Kconfig
+index a305731742a9..f7d90617c9d9 100644
+--- a/drivers/sh/intc/Kconfig
++++ b/drivers/sh/intc/Kconfig
+@@ -6,7 +6,7 @@ comment "Interrupt controller options"
+
+ config INTC_USERIMASK
+ bool "Userspace interrupt masking support"
+- depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A)
++ depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) || COMPILE_TEST
+ help
+ This enables support for hardware-assisted userspace hardirq
+ masking.
+--
+2.1.2
+
diff --git a/patches.renesas/0099-drivers-sh-compile-drivers-sh-pm_runtime.c-if-ARCH_S.patch b/patches.renesas/0099-drivers-sh-compile-drivers-sh-pm_runtime.c-if-ARCH_S.patch
new file mode 100644
index 00000000000000..64005249d6bd9f
--- /dev/null
+++ b/patches.renesas/0099-drivers-sh-compile-drivers-sh-pm_runtime.c-if-ARCH_S.patch
@@ -0,0 +1,116 @@
+From 6dcc351c5155f97f31b832c1e7f09a7887f12250 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Tue, 6 May 2014 23:26:19 +0200
+Subject: drivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI
+
+If the kernel is built to support multi-ARM configuration with shmobile
+support built in, then drivers/sh is not built. This contains the PM
+runtime code in drivers/sh/pm_runtime.c, which implicitly enables the
+module clocks for all devices, and thus is quite essential.
+Without this, the state of clocks depends on implicit reset state, or on
+the bootloader.
+
+If ARCH_SHMOBILE_MULTI then build the drivers/sh directory, but ensure that
+bits that may conflict (drivers/sh/clk if the common clock framework is
+enabled) or are not used (drivers/sh/intc), are not built.
+Also, only enable the PM runtime code when actually running on a shmobile
+SoCs that needs it.
+
+ARCH_SHMOBILE_MULTI was added a while ago by commit
+efacfce5f8a523457e9419a25d52fe39db00b26a ("ARM: shmobile: Introduce
+ARCH_SHMOBILE_MULTI"), but drivers/sh was compiled for both
+ARCH_SHMOBILE_LEGACY and ARCH_SHMOBILE_MULTI until commit
+bf98c1eac1d4a6bcf00532e4fa41d8126cd6c187 ("ARM: Rename ARCH_SHMOBILE to
+ARCH_SHMOBILE_LEGACY").
+
+Inspired by a patch from Ben Dooks <ben.dooks@codethink.co.uk>.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 3c90c55dcde745bed81f6447f24ba96bda43d984)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/Makefile | 2 +-
+ drivers/sh/Makefile | 14 ++++++++------
+ drivers/sh/pm_runtime.c | 20 +++++++++++++++++++-
+ 3 files changed, 28 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/Makefile b/drivers/Makefile
+index 8e3b8b06c0b2..3cc8214f9b26 100644
+--- a/drivers/Makefile
++++ b/drivers/Makefile
+@@ -118,7 +118,7 @@ obj-$(CONFIG_SGI_SN) += sn/
+ obj-y += firmware/
+ obj-$(CONFIG_CRYPTO) += crypto/
+ obj-$(CONFIG_SUPERH) += sh/
+-obj-$(CONFIG_ARCH_SHMOBILE_LEGACY) += sh/
++obj-$(CONFIG_ARCH_SHMOBILE) += sh/
+ ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
+ obj-y += clocksource/
+ endif
+diff --git a/drivers/sh/Makefile b/drivers/sh/Makefile
+index fc67f564f02c..788ed9b59b4e 100644
+--- a/drivers/sh/Makefile
++++ b/drivers/sh/Makefile
+@@ -1,10 +1,12 @@
+ #
+ # Makefile for the SuperH specific drivers.
+ #
+-obj-y := intc/
++obj-$(CONFIG_SUPERH) += intc/
++obj-$(CONFIG_ARCH_SHMOBILE_LEGACY) += intc/
++ifneq ($(CONFIG_COMMON_CLK),y)
++obj-$(CONFIG_HAVE_CLK) += clk/
++endif
++obj-$(CONFIG_MAPLE) += maple/
++obj-$(CONFIG_SUPERHYWAY) += superhyway/
+
+-obj-$(CONFIG_HAVE_CLK) += clk/
+-obj-$(CONFIG_MAPLE) += maple/
+-obj-$(CONFIG_SUPERHYWAY) += superhyway/
+-
+-obj-y += pm_runtime.o
++obj-y += pm_runtime.o
+diff --git a/drivers/sh/pm_runtime.c b/drivers/sh/pm_runtime.c
+index 8afa5a4589f2..10c65eb51f85 100644
+--- a/drivers/sh/pm_runtime.c
++++ b/drivers/sh/pm_runtime.c
+@@ -50,8 +50,25 @@ static struct pm_clk_notifier_block platform_bus_notifier = {
+ .con_ids = { NULL, },
+ };
+
++static bool default_pm_on;
++
+ static int __init sh_pm_runtime_init(void)
+ {
++ if (IS_ENABLED(CONFIG_ARCH_SHMOBILE_MULTI)) {
++ if (!of_machine_is_compatible("renesas,emev2") &&
++ !of_machine_is_compatible("renesas,r7s72100") &&
++ !of_machine_is_compatible("renesas,r8a73a4") &&
++ !of_machine_is_compatible("renesas,r8a7740") &&
++ !of_machine_is_compatible("renesas,r8a7778") &&
++ !of_machine_is_compatible("renesas,r8a7779") &&
++ !of_machine_is_compatible("renesas,r8a7790") &&
++ !of_machine_is_compatible("renesas,r8a7791") &&
++ !of_machine_is_compatible("renesas,sh7372") &&
++ !of_machine_is_compatible("renesas,sh73a0"))
++ return 0;
++ }
++
++ default_pm_on = true;
+ pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
+ return 0;
+ }
+@@ -59,7 +76,8 @@ core_initcall(sh_pm_runtime_init);
+
+ static int __init sh_pm_runtime_late_init(void)
+ {
+- pm_genpd_poweroff_unused();
++ if (default_pm_on)
++ pm_genpd_poweroff_unused();
+ return 0;
+ }
+ late_initcall(sh_pm_runtime_late_init);
+--
+2.1.2
+
diff --git a/patches.renesas/0100-sh_eth-use-ETH_ZLEN-instead-of-home-grown-define.patch b/patches.renesas/0100-sh_eth-use-ETH_ZLEN-instead-of-home-grown-define.patch
new file mode 100644
index 00000000000000..3f1937f0672a26
--- /dev/null
+++ b/patches.renesas/0100-sh_eth-use-ETH_ZLEN-instead-of-home-grown-define.patch
@@ -0,0 +1,50 @@
+From 9a0fd1c203823f4a7e1ff13aa4406e74e9d87eec Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Fri, 14 Feb 2014 03:05:42 +0300
+Subject: sh_eth: use ETH_ZLEN instead of home-grown #define
+
+The driver #define's and uses ETHERSMALL macro for the minimum Ethernet frame
+size for which we have a standard macro ETH_ZLEN. Use the latter instead of
+the home-grown one.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit 730c8c69bc8d4640336885e20e719b0842d0fcb2)
+Signed-off-by: Simon Horman <horms+renesas@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 957f0ffe31c4..6f1884d7804b 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2112,8 +2112,8 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+ skb->len + 2);
+ txdesc->addr = dma_map_single(&ndev->dev, skb->data, skb->len,
+ DMA_TO_DEVICE);
+- if (skb->len < ETHERSMALL)
+- txdesc->buffer_length = ETHERSMALL;
++ if (skb->len < ETH_ZLEN)
++ txdesc->buffer_length = ETH_ZLEN;
+ else
+ txdesc->buffer_length = skb->len;
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
+index a096b4bf9799..b37c427144ee 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.h
++++ b/drivers/net/ethernet/renesas/sh_eth.h
+@@ -27,8 +27,7 @@
+ #define RX_RING_MIN 64
+ #define TX_RING_MAX 1024
+ #define RX_RING_MAX 1024
+-#define ETHERSMALL 60
+-#define PKT_BUF_SZ 1538
++#define PKT_BUF_SZ 1538
+ #define SH_ETH_TSU_TIMEOUT_MS 500
+ #define SH_ETH_TSU_CAM_ENTRIES 32
+
+--
+2.1.2
+
diff --git a/patches.renesas/0101-sh_eth-add-device-tree-support.patch b/patches.renesas/0101-sh_eth-add-device-tree-support.patch
new file mode 100644
index 00000000000000..8e6d8c7cf3da7b
--- /dev/null
+++ b/patches.renesas/0101-sh_eth-add-device-tree-support.patch
@@ -0,0 +1,200 @@
+From 6ab325bd621230c0f1b4f401004268b1889c2896 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Tue, 18 Feb 2014 03:12:43 +0300
+Subject: sh_eth: add device tree support
+
+Add support of the device tree probing for the Renesas SH-Mobile SoCs
+documenting the device tree binding as necessary.
+
+This work is loosely based on the original patch by Nobuhiro Iwamatsu
+<nobuhiro.iwamatsu.yj@renesas.com>.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit b356e978e92fccd17a3e4620a4821bdbfb706c1a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/net/sh_eth.txt | 55 +++++++++++++++++++
+ drivers/net/ethernet/renesas/sh_eth.c | 69 ++++++++++++++++++++++--
+ 2 files changed, 121 insertions(+), 3 deletions(-)
+ create mode 100644 Documentation/devicetree/bindings/net/sh_eth.txt
+
+diff --git a/Documentation/devicetree/bindings/net/sh_eth.txt b/Documentation/devicetree/bindings/net/sh_eth.txt
+new file mode 100644
+index 000000000000..e7106b50dbdc
+--- /dev/null
++++ b/Documentation/devicetree/bindings/net/sh_eth.txt
+@@ -0,0 +1,55 @@
++* Renesas Electronics SH EtherMAC
++
++This file provides information on what the device node for the SH EtherMAC
++interface contains.
++
++Required properties:
++- compatible: "renesas,gether-r8a7740" if the device is a part of R8A7740 SoC.
++ "renesas,ether-r8a7778" if the device is a part of R8A7778 SoC.
++ "renesas,ether-r8a7779" if the device is a part of R8A7779 SoC.
++ "renesas,ether-r8a7790" if the device is a part of R8A7790 SoC.
++ "renesas,ether-r8a7791" if the device is a part of R8A7791 SoC.
++ "renesas,ether-r7s72100" if the device is a part of R7S72100 SoC.
++- reg: offset and length of (1) the E-DMAC/feLic register block (required),
++ (2) the TSU register block (optional).
++- interrupts: interrupt specifier for the sole interrupt.
++- phy-mode: see ethernet.txt file in the same directory.
++- phy-handle: see ethernet.txt file in the same directory.
++- #address-cells: number of address cells for the MDIO bus, must be equal to 1.
++- #size-cells: number of size cells on the MDIO bus, must be equal to 0.
++- clocks: clock phandle and specifier pair.
++- pinctrl-0: phandle, referring to a default pin configuration node.
++
++Optional properties:
++- interrupt-parent: the phandle for the interrupt controller that services
++ interrupts for this device.
++- pinctrl-names: pin configuration state name ("default").
++- renesas,no-ether-link: boolean, specify when a board does not provide a proper
++ Ether LINK signal.
++- renesas,ether-link-active-low: boolean, specify when the Ether LINK signal is
++ active-low instead of normal active-high.
++
++Example (Lager board):
++
++ ethernet@ee700000 {
++ compatible = "renesas,ether-r8a7790";
++ reg = <0 0xee700000 0 0x400>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
++ phy-mode = "rmii";
++ phy-handle = <&phy1>;
++ pinctrl-0 = <&ether_pins>;
++ pinctrl-names = "default";
++ renesas,ether-link-active-low;
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ phy1: ethernet-phy@1 {
++ reg = <1>;
++ interrupt-parent = <&irqc0>;
++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
++ pinctrl-0 = <&phy1_pins>;
++ pinctrl-names = "default";
++ };
++ };
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 6f1884d7804b..b1afdaa7a466 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-2012 Nobuhiro Iwamatsu
+- * Copyright (C) 2008-2013 Renesas Solutions Corp.
+- * Copyright (C) 2013 Cogent Embedded, Inc.
++ * Copyright (C) 2008-2014 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Cogent Embedded, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+@@ -27,6 +27,10 @@
+ #include <linux/platform_device.h>
+ #include <linux/mdio-bitbang.h>
+ #include <linux/netdevice.h>
++#include <linux/of.h>
++#include <linux/of_device.h>
++#include <linux/of_irq.h>
++#include <linux/of_net.h>
+ #include <linux/phy.h>
+ #include <linux/cache.h>
+ #include <linux/io.h>
+@@ -2724,6 +2728,54 @@ static const struct net_device_ops sh_eth_netdev_ops_tsu = {
+ .ndo_change_mtu = eth_change_mtu,
+ };
+
++#ifdef CONFIG_OF
++static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
++{
++ struct device_node *np = dev->of_node;
++ struct sh_eth_plat_data *pdata;
++ struct device_node *phy;
++ const char *mac_addr;
++
++ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
++ if (!pdata)
++ return NULL;
++
++ pdata->phy_interface = of_get_phy_mode(np);
++
++ phy = of_parse_phandle(np, "phy-handle", 0);
++ if (of_property_read_u32(phy, "reg", &pdata->phy))
++ return NULL;
++ pdata->phy_irq = irq_of_parse_and_map(phy, 0);
++
++ mac_addr = of_get_mac_address(np);
++ if (mac_addr)
++ memcpy(pdata->mac_addr, mac_addr, ETH_ALEN);
++
++ pdata->no_ether_link =
++ of_property_read_bool(np, "renesas,no-ether-link");
++ pdata->ether_link_active_low =
++ of_property_read_bool(np, "renesas,ether-link-active-low");
++
++ return pdata;
++}
++
++static const struct of_device_id sh_eth_match_table[] = {
++ { .compatible = "renesas,gether-r8a7740", .data = &r8a7740_data },
++ { .compatible = "renesas,ether-r8a7778", .data = &r8a777x_data },
++ { .compatible = "renesas,ether-r8a7779", .data = &r8a777x_data },
++ { .compatible = "renesas,ether-r8a7790", .data = &r8a779x_data },
++ { .compatible = "renesas,ether-r8a7791", .data = &r8a779x_data },
++ { .compatible = "renesas,ether-r7s72100", .data = &r7s72100_data },
++ { }
++};
++MODULE_DEVICE_TABLE(of, sh_eth_match_table);
++#else
++static inline struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
++{
++ return NULL;
++}
++#endif
++
+ static int sh_eth_drv_probe(struct platform_device *pdev)
+ {
+ int ret, devno = 0;
+@@ -2777,6 +2829,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_resume(&pdev->dev);
+
++ if (pdev->dev.of_node)
++ pd = sh_eth_parse_dt(&pdev->dev);
+ if (!pd) {
+ dev_err(&pdev->dev, "no platform data\n");
+ ret = -EINVAL;
+@@ -2792,7 +2846,15 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ mdp->ether_link_active_low = pd->ether_link_active_low;
+
+ /* set cpu data */
+- mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
++ if (id) {
++ mdp->cd = (struct sh_eth_cpu_data *)id->driver_data;
++ } else {
++ const struct of_device_id *match;
++
++ match = of_match_device(of_match_ptr(sh_eth_match_table),
++ &pdev->dev);
++ mdp->cd = (struct sh_eth_cpu_data *)match->data;
++ }
+ mdp->reg_offset = sh_eth_get_register_offset(mdp->cd->register_type);
+ sh_eth_set_default_cpu_data(mdp->cd);
+
+@@ -2934,6 +2996,7 @@ static struct platform_driver sh_eth_driver = {
+ .driver = {
+ .name = CARDNAME,
+ .pm = SH_ETH_PM_OPS,
++ .of_match_table = of_match_ptr(sh_eth_match_table),
+ },
+ };
+
+--
+2.1.2
+
diff --git a/patches.renesas/0102-sh_eth-update-OF-PHY-registeration.patch b/patches.renesas/0102-sh_eth-update-OF-PHY-registeration.patch
new file mode 100644
index 00000000000000..f45b643591dd5c
--- /dev/null
+++ b/patches.renesas/0102-sh_eth-update-OF-PHY-registeration.patch
@@ -0,0 +1,148 @@
+From ae3d328a5d6e4604fc9e54c57e4da7a36bde7d9d Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Wed, 12 Mar 2014 17:47:40 +0000
+Subject: sh_eth: update OF PHY registeration
+
+If the sh_eth device is registered using OF, then the driver
+should call of_mdiobus_register() to register the PHYs described
+in the devicetree and then use of_phy_connect() to connect the
+PHYs to the device.
+
+This ensures that any PHYs registered in the device tree are
+appropriately connected to the parent devices nodes so that
+the PHY drivers can access their OF properties.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit 702eca02b7c8574b42359512ebccfa777a71f66e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 59 +++++++++++++++++++++++------------
+ 1 file changed, 39 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index b1afdaa7a466..5242fe81ecc7 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -3,6 +3,7 @@
+ * Copyright (C) 2006-2012 Nobuhiro Iwamatsu
+ * Copyright (C) 2008-2014 Renesas Solutions Corp.
+ * Copyright (C) 2013-2014 Cogent Embedded, Inc.
++ * Copyright (C) 2014 Codethink Limited
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+@@ -40,6 +41,7 @@
+ #include <linux/if_vlan.h>
+ #include <linux/clk.h>
+ #include <linux/sh_eth.h>
++#include <linux/of_mdio.h>
+
+ #include "sh_eth.h"
+
+@@ -1775,22 +1777,37 @@ static void sh_eth_adjust_link(struct net_device *ndev)
+ /* PHY init function */
+ static int sh_eth_phy_init(struct net_device *ndev)
+ {
++ struct device_node *np = ndev->dev.parent->of_node;
+ struct sh_eth_private *mdp = netdev_priv(ndev);
+- char phy_id[MII_BUS_ID_SIZE + 3];
+ struct phy_device *phydev = NULL;
+
+- snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
+- mdp->mii_bus->id, mdp->phy_id);
+-
+ mdp->link = 0;
+ mdp->speed = 0;
+ mdp->duplex = -1;
+
+ /* Try connect to PHY */
+- phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link,
+- mdp->phy_interface);
++ if (np) {
++ struct device_node *pn;
++
++ pn = of_parse_phandle(np, "phy-handle", 0);
++ phydev = of_phy_connect(ndev, pn,
++ sh_eth_adjust_link, 0,
++ mdp->phy_interface);
++
++ if (!phydev)
++ phydev = ERR_PTR(-ENOENT);
++ } else {
++ char phy_id[MII_BUS_ID_SIZE + 3];
++
++ snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
++ mdp->mii_bus->id, mdp->phy_id);
++
++ phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link,
++ mdp->phy_interface);
++ }
++
+ if (IS_ERR(phydev)) {
+- dev_err(&ndev->dev, "phy_connect failed\n");
++ dev_err(&ndev->dev, "failed to connect PHY\n");
+ return PTR_ERR(phydev);
+ }
+
+@@ -2652,13 +2669,19 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ goto out_free_bus;
+ }
+
+- for (i = 0; i < PHY_MAX_ADDR; i++)
+- mdp->mii_bus->irq[i] = PHY_POLL;
+- if (pd->phy_irq > 0)
+- mdp->mii_bus->irq[pd->phy] = pd->phy_irq;
+-
+ /* register mdio bus */
+- ret = mdiobus_register(mdp->mii_bus);
++ if (ndev->dev.parent->of_node) {
++ ret = of_mdiobus_register(mdp->mii_bus,
++ ndev->dev.parent->of_node);
++ } else {
++ for (i = 0; i < PHY_MAX_ADDR; i++)
++ mdp->mii_bus->irq[i] = PHY_POLL;
++ if (pd->phy_irq > 0)
++ mdp->mii_bus->irq[pd->phy] = pd->phy_irq;
++
++ ret = mdiobus_register(mdp->mii_bus);
++ }
++
+ if (ret)
+ goto out_free_bus;
+
+@@ -2733,7 +2756,6 @@ static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
+ {
+ struct device_node *np = dev->of_node;
+ struct sh_eth_plat_data *pdata;
+- struct device_node *phy;
+ const char *mac_addr;
+
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+@@ -2742,11 +2764,6 @@ static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
+
+ pdata->phy_interface = of_get_phy_mode(np);
+
+- phy = of_parse_phandle(np, "phy-handle", 0);
+- if (of_property_read_u32(phy, "reg", &pdata->phy))
+- return NULL;
+- pdata->phy_irq = irq_of_parse_and_map(phy, 0);
+-
+ mac_addr = of_get_mac_address(np);
+ if (mac_addr)
+ memcpy(pdata->mac_addr, mac_addr, ETH_ALEN);
+@@ -2910,8 +2927,10 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+
+ /* mdio bus init */
+ ret = sh_mdio_init(ndev, pdev->id, pd);
+- if (ret)
++ if (ret) {
++ dev_err(&ndev->dev, "failed to initialise MDIO\n");
+ goto out_unregister;
++ }
+
+ /* print device information */
+ pr_info("Base address at 0x%x, %pM, IRQ %d.\n",
+--
+2.1.2
+
diff --git a/patches.renesas/0103-sh_eth-exit-probe-with-unknown-register-layout.patch b/patches.renesas/0103-sh_eth-exit-probe-with-unknown-register-layout.patch
new file mode 100644
index 00000000000000..0f7d53c35e4aa7
--- /dev/null
+++ b/patches.renesas/0103-sh_eth-exit-probe-with-unknown-register-layout.patch
@@ -0,0 +1,48 @@
+From dba68b222e510e01a7cd5db2654e356cf2388905 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Mar 2014 03:11:24 +0300
+Subject: sh_eth: exit probe with unknown register layout
+
+Exit the driver's probe() method when the register layout is unknown as the
+driver would cause kernel oops in this case anyway.
+
+While at it, move the corresponding error message printout and convert it from
+pr_err() to dev_err().
+
+Suggested-by: Joe Perches <joe@perches.com>
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit 264be2f5a973cc85be3e31d6bf6234b55a256627)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 5242fe81ecc7..4d3b5b704b39 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2717,7 +2717,6 @@ static const u16 *sh_eth_get_register_offset(int register_type)
+ reg_offset = sh_eth_offset_fast_sh3_sh2;
+ break;
+ default:
+- pr_err("Unknown register type (%d)\n", register_type);
+ break;
+ }
+
+@@ -2873,6 +2872,12 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ mdp->cd = (struct sh_eth_cpu_data *)match->data;
+ }
+ mdp->reg_offset = sh_eth_get_register_offset(mdp->cd->register_type);
++ if (!mdp->reg_offset) {
++ dev_err(&pdev->dev, "Unknown register type (%d)\n",
++ mdp->cd->register_type);
++ ret = -EINVAL;
++ goto out_release;
++ }
+ sh_eth_set_default_cpu_data(mdp->cd);
+
+ /* set function */
+--
+2.1.2
+
diff --git a/patches.renesas/0104-sh_eth-convert-pr_-to-netdev_-calls.patch b/patches.renesas/0104-sh_eth-convert-pr_-to-netdev_-calls.patch
new file mode 100644
index 00000000000000..9268a399aef233
--- /dev/null
+++ b/patches.renesas/0104-sh_eth-convert-pr_-to-netdev_-calls.patch
@@ -0,0 +1,53 @@
+From a62edb24ce7e83dfbb14a5898028a683171d8e47 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Mar 2014 03:27:54 +0300
+Subject: sh_eth: convert pr_*() to netdev_*() calls
+
+Convert pr_*() to netdev_*() calls as the latter provide info on a device.
+
+Suggested-by: Joe Perches <joe@perches.com>
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit f75f14ec2f7b552dc87b4b57b2a19e487378f774)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 4d3b5b704b39..32daff7fa2d1 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -421,7 +421,8 @@ static void sh_eth_select_mii(struct net_device *ndev)
+ value = 0x0;
+ break;
+ default:
+- pr_warn("PHY interface mode was not setup. Set to MII.\n");
++ netdev_warn(ndev,
++ "PHY interface mode was not setup. Set to MII.\n");
+ value = 0x1;
+ break;
+ }
+@@ -868,7 +869,7 @@ static int sh_eth_check_reset(struct net_device *ndev)
+ cnt--;
+ }
+ if (cnt <= 0) {
+- pr_err("Device reset failed\n");
++ netdev_err(ndev, "Device reset failed\n");
+ ret = -ETIMEDOUT;
+ }
+ return ret;
+@@ -2938,8 +2939,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ }
+
+ /* print device information */
+- pr_info("Base address at 0x%x, %pM, IRQ %d.\n",
+- (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
++ netdev_info(ndev, "Base address at 0x%x, %pM, IRQ %d.\n",
++ (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
+
+ platform_set_drvdata(pdev, ndev);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0105-sh_eth-convert-dev_-to-netdev_-calls.patch b/patches.renesas/0105-sh_eth-convert-dev_-to-netdev_-calls.patch
new file mode 100644
index 00000000000000..a3b04fb04f409a
--- /dev/null
+++ b/patches.renesas/0105-sh_eth-convert-dev_-to-netdev_-calls.patch
@@ -0,0 +1,180 @@
+From 9f190ca6669f8279bcf16e19db6ad088ffca73f0 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Mar 2014 03:29:14 +0300
+Subject: sh_eth: convert dev_*() to netdev_*() calls
+
+Convert dev_*(&ndev->dev, ...) to netdev_*(ndev, ...) calls since they are a bit
+shorter and at the same time give more information on a device.
+
+Suggested-by: Joe Perches <joe@perches.com>
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit da2468555643efbde3fb026cd46e5245800cc872)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 47 ++++++++++++++++++-----------------
+ 1 file changed, 24 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 32daff7fa2d1..185f185b5f6d 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -1572,7 +1572,7 @@ ignore_link:
+ if (intr_status & EESR_TABT) { /* Transmit Abort int */
+ ndev->stats.tx_aborted_errors++;
+ if (netif_msg_tx_err(mdp))
+- dev_err(&ndev->dev, "Transmit Abort\n");
++ netdev_err(ndev, "Transmit Abort\n");
+ }
+ }
+
+@@ -1582,7 +1582,7 @@ ignore_link:
+ /* Receive Frame Overflow int */
+ ndev->stats.rx_frame_errors++;
+ if (netif_msg_rx_err(mdp))
+- dev_err(&ndev->dev, "Receive Abort\n");
++ netdev_err(ndev, "Receive Abort\n");
+ }
+ }
+
+@@ -1590,14 +1590,14 @@ ignore_link:
+ /* Transmit Descriptor Empty int */
+ ndev->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+- dev_err(&ndev->dev, "Transmit Descriptor Empty\n");
++ netdev_err(ndev, "Transmit Descriptor Empty\n");
+ }
+
+ if (intr_status & EESR_TFE) {
+ /* FIFO under flow */
+ ndev->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+- dev_err(&ndev->dev, "Transmit FIFO Under flow\n");
++ netdev_err(ndev, "Transmit FIFO Under flow\n");
+ }
+
+ if (intr_status & EESR_RDE) {
+@@ -1605,21 +1605,21 @@ ignore_link:
+ ndev->stats.rx_over_errors++;
+
+ if (netif_msg_rx_err(mdp))
+- dev_err(&ndev->dev, "Receive Descriptor Empty\n");
++ netdev_err(ndev, "Receive Descriptor Empty\n");
+ }
+
+ if (intr_status & EESR_RFE) {
+ /* Receive FIFO Overflow int */
+ ndev->stats.rx_fifo_errors++;
+ if (netif_msg_rx_err(mdp))
+- dev_err(&ndev->dev, "Receive FIFO Overflow\n");
++ netdev_err(ndev, "Receive FIFO Overflow\n");
+ }
+
+ if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) {
+ /* Address Error */
+ ndev->stats.tx_fifo_errors++;
+ if (netif_msg_tx_err(mdp))
+- dev_err(&ndev->dev, "Address Error\n");
++ netdev_err(ndev, "Address Error\n");
+ }
+
+ mask = EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE;
+@@ -1630,9 +1630,9 @@ ignore_link:
+ u32 edtrr = sh_eth_read(ndev, EDTRR);
+
+ /* dmesg */
+- dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
+- intr_status, mdp->cur_tx, mdp->dirty_tx,
+- (u32)ndev->state, edtrr);
++ netdev_err(ndev, "TX error. status=%8.8x cur_tx=%8.8x dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
++ intr_status, mdp->cur_tx, mdp->dirty_tx,
++ (u32)ndev->state, edtrr);
+ /* dirty buffer free */
+ sh_eth_txfree(ndev);
+
+@@ -1677,9 +1677,9 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
+ EESIPR);
+ __napi_schedule(&mdp->napi);
+ } else {
+- dev_warn(&ndev->dev,
+- "ignoring interrupt, status 0x%08lx, mask 0x%08lx.\n",
+- intr_status, intr_enable);
++ netdev_warn(ndev,
++ "ignoring interrupt, status 0x%08lx, mask 0x%08lx.\n",
++ intr_status, intr_enable);
+ }
+ }
+
+@@ -1808,12 +1808,12 @@ static int sh_eth_phy_init(struct net_device *ndev)
+ }
+
+ if (IS_ERR(phydev)) {
+- dev_err(&ndev->dev, "failed to connect PHY\n");
++ netdev_err(ndev, "failed to connect PHY\n");
+ return PTR_ERR(phydev);
+ }
+
+- dev_info(&ndev->dev, "attached PHY %d (IRQ %d) to driver %s\n",
+- phydev->addr, phydev->irq, phydev->drv->name);
++ netdev_info(ndev, "attached PHY %d (IRQ %d) to driver %s\n",
++ phydev->addr, phydev->irq, phydev->drv->name);
+
+ mdp->phydev = phydev;
+
+@@ -1994,12 +1994,12 @@ static int sh_eth_set_ringparam(struct net_device *ndev,
+
+ ret = sh_eth_ring_init(ndev);
+ if (ret < 0) {
+- dev_err(&ndev->dev, "%s: sh_eth_ring_init failed.\n", __func__);
++ netdev_err(ndev, "%s: sh_eth_ring_init failed.\n", __func__);
+ return ret;
+ }
+ ret = sh_eth_dev_init(ndev, false);
+ if (ret < 0) {
+- dev_err(&ndev->dev, "%s: sh_eth_dev_init failed.\n", __func__);
++ netdev_err(ndev, "%s: sh_eth_dev_init failed.\n", __func__);
+ return ret;
+ }
+
+@@ -2040,7 +2040,7 @@ static int sh_eth_open(struct net_device *ndev)
+ ret = request_irq(ndev->irq, sh_eth_interrupt,
+ mdp->cd->irq_flags, ndev->name, ndev);
+ if (ret) {
+- dev_err(&ndev->dev, "Can not assign IRQ number\n");
++ netdev_err(ndev, "Can not assign IRQ number\n");
+ goto out_napi_off;
+ }
+
+@@ -2079,8 +2079,9 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
+ netif_stop_queue(ndev);
+
+ if (netif_msg_timer(mdp)) {
+- dev_err(&ndev->dev, "%s: transmit timed out, status %8.8x, resetting...\n",
+- ndev->name, (int)sh_eth_read(ndev, EESR));
++ netdev_err(ndev,
++ "transmit timed out, status %8.8x, resetting...\n",
++ (int)sh_eth_read(ndev, EESR));
+ }
+
+ /* tx_errors count up */
+@@ -2117,7 +2118,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+ if ((mdp->cur_tx - mdp->dirty_tx) >= (mdp->num_tx_ring - 4)) {
+ if (!sh_eth_txfree(ndev)) {
+ if (netif_msg_tx_queued(mdp))
+- dev_warn(&ndev->dev, "TxFD exhausted.\n");
++ netdev_warn(ndev, "TxFD exhausted.\n");
+ netif_stop_queue(ndev);
+ spin_unlock_irqrestore(&mdp->lock, flags);
+ return NETDEV_TX_BUSY;
+@@ -2287,7 +2288,7 @@ static int sh_eth_tsu_busy(struct net_device *ndev)
+ udelay(10);
+ timeout--;
+ if (timeout <= 0) {
+- dev_err(&ndev->dev, "%s: timeout\n", __func__);
++ netdev_err(ndev, "%s: timeout\n", __func__);
+ return -ETIMEDOUT;
+ }
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0106-sh_eth-fold-netif_msg_-and-netdev_-calls-into-netif_.patch b/patches.renesas/0106-sh_eth-fold-netif_msg_-and-netdev_-calls-into-netif_.patch
new file mode 100644
index 00000000000000..7bcbc924d7adca
--- /dev/null
+++ b/patches.renesas/0106-sh_eth-fold-netif_msg_-and-netdev_-calls-into-netif_.patch
@@ -0,0 +1,112 @@
+From f8c7dce7c4a327973a8ebfa729e2727f8e8e85fc Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Mar 2014 03:30:59 +0300
+Subject: sh_eth: fold netif_msg_*() and netdev_*() calls into netif_*()
+ invocations
+
+Now that we call netdev_*() under netif_msg_*() checks, we can fold these into
+netif_*() macro invocations.
+
+Suggested-by: Joe Perches <joe@perches.com>
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit 8d5009f6a9d9f4ef62a39bf68b53379b2b766c1c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 33 +++++++++++----------------------
+ 1 file changed, 11 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 185f185b5f6d..062a70f85068 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -1571,8 +1571,7 @@ ignore_link:
+ /* Unused write back interrupt */
+ if (intr_status & EESR_TABT) { /* Transmit Abort int */
+ ndev->stats.tx_aborted_errors++;
+- if (netif_msg_tx_err(mdp))
+- netdev_err(ndev, "Transmit Abort\n");
++ netif_err(mdp, tx_err, ndev, "Transmit Abort\n");
+ }
+ }
+
+@@ -1581,45 +1580,38 @@ ignore_link:
+ if (intr_status & EESR_RFRMER) {
+ /* Receive Frame Overflow int */
+ ndev->stats.rx_frame_errors++;
+- if (netif_msg_rx_err(mdp))
+- netdev_err(ndev, "Receive Abort\n");
++ netif_err(mdp, rx_err, ndev, "Receive Abort\n");
+ }
+ }
+
+ if (intr_status & EESR_TDE) {
+ /* Transmit Descriptor Empty int */
+ ndev->stats.tx_fifo_errors++;
+- if (netif_msg_tx_err(mdp))
+- netdev_err(ndev, "Transmit Descriptor Empty\n");
++ netif_err(mdp, tx_err, ndev, "Transmit Descriptor Empty\n");
+ }
+
+ if (intr_status & EESR_TFE) {
+ /* FIFO under flow */
+ ndev->stats.tx_fifo_errors++;
+- if (netif_msg_tx_err(mdp))
+- netdev_err(ndev, "Transmit FIFO Under flow\n");
++ netif_err(mdp, tx_err, ndev, "Transmit FIFO Under flow\n");
+ }
+
+ if (intr_status & EESR_RDE) {
+ /* Receive Descriptor Empty int */
+ ndev->stats.rx_over_errors++;
+-
+- if (netif_msg_rx_err(mdp))
+- netdev_err(ndev, "Receive Descriptor Empty\n");
++ netif_err(mdp, rx_err, ndev, "Receive Descriptor Empty\n");
+ }
+
+ if (intr_status & EESR_RFE) {
+ /* Receive FIFO Overflow int */
+ ndev->stats.rx_fifo_errors++;
+- if (netif_msg_rx_err(mdp))
+- netdev_err(ndev, "Receive FIFO Overflow\n");
++ netif_err(mdp, rx_err, ndev, "Receive FIFO Overflow\n");
+ }
+
+ if (!mdp->cd->no_ade && (intr_status & EESR_ADE)) {
+ /* Address Error */
+ ndev->stats.tx_fifo_errors++;
+- if (netif_msg_tx_err(mdp))
+- netdev_err(ndev, "Address Error\n");
++ netif_err(mdp, tx_err, ndev, "Address Error\n");
+ }
+
+ mask = EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE;
+@@ -2078,11 +2070,9 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
+
+ netif_stop_queue(ndev);
+
+- if (netif_msg_timer(mdp)) {
+- netdev_err(ndev,
+- "transmit timed out, status %8.8x, resetting...\n",
+- (int)sh_eth_read(ndev, EESR));
+- }
++ netif_err(mdp, timer, ndev,
++ "transmit timed out, status %8.8x, resetting...\n",
++ (int)sh_eth_read(ndev, EESR));
+
+ /* tx_errors count up */
+ ndev->stats.tx_errors++;
+@@ -2117,8 +2107,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+ spin_lock_irqsave(&mdp->lock, flags);
+ if ((mdp->cur_tx - mdp->dirty_tx) >= (mdp->num_tx_ring - 4)) {
+ if (!sh_eth_txfree(ndev)) {
+- if (netif_msg_tx_queued(mdp))
+- netdev_warn(ndev, "TxFD exhausted.\n");
++ netif_warn(mdp, tx_queued, ndev, "TxFD exhausted.\n");
+ netif_stop_queue(ndev);
+ spin_unlock_irqrestore(&mdp->lock, flags);
+ return NETDEV_TX_BUSY;
+--
+2.1.2
+
diff --git a/patches.renesas/0107-sh_eth-Use-the-platform-device-for-memory-allocation.patch b/patches.renesas/0107-sh_eth-Use-the-platform-device-for-memory-allocation.patch
new file mode 100644
index 00000000000000..41debaae3f70be
--- /dev/null
+++ b/patches.renesas/0107-sh_eth-Use-the-platform-device-for-memory-allocation.patch
@@ -0,0 +1,54 @@
+From d251430c1ff02123bb7e6a0f9640e0b984a6049a Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 20 Mar 2014 15:00:31 +0100
+Subject: sh_eth: Use the platform device for memory allocation
+
+Memory allocated for the MDIO bus with the devm_kzalloc() API is
+associated with the network device. While this will cause memory to be
+freed at the right time, it doesn't allow allocating memory before the
+network device is initialized.
+
+Replace the network device with the parent platform device for memory
+allocation to remove that dependency. This also improves consistency
+with the other devm_* calls in the driver that all use the platform
+device.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit aa8d422510969b705656e49fc0166d862aca9246)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 062a70f85068..361ac103297b 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2620,10 +2620,10 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ int ret, i;
+ struct bb_info *bitbang;
+ struct sh_eth_private *mdp = netdev_priv(ndev);
++ struct device *dev = &mdp->pdev->dev;
+
+ /* create bit control struct for PHY */
+- bitbang = devm_kzalloc(&ndev->dev, sizeof(struct bb_info),
+- GFP_KERNEL);
++ bitbang = devm_kzalloc(dev, sizeof(struct bb_info), GFP_KERNEL);
+ if (!bitbang) {
+ ret = -ENOMEM;
+ goto out;
+@@ -2652,8 +2652,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ mdp->pdev->name, id);
+
+ /* PHY IRQ */
+- mdp->mii_bus->irq = devm_kzalloc(&ndev->dev,
+- sizeof(int) * PHY_MAX_ADDR,
++ mdp->mii_bus->irq = devm_kzalloc(dev, sizeof(int) * PHY_MAX_ADDR,
+ GFP_KERNEL);
+ if (!mdp->mii_bus->irq) {
+ ret = -ENOMEM;
+--
+2.1.2
+
diff --git a/patches.renesas/0108-sh_eth-Use-the-platform-device-as-the-MDIO-bus-paren.patch b/patches.renesas/0108-sh_eth-Use-the-platform-device-as-the-MDIO-bus-paren.patch
new file mode 100644
index 00000000000000..daad9ddfcba1e4
--- /dev/null
+++ b/patches.renesas/0108-sh_eth-Use-the-platform-device-as-the-MDIO-bus-paren.patch
@@ -0,0 +1,35 @@
+From da974521644628afd7780e72e57aaf9524e7f219 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 20 Mar 2014 15:00:32 +0100
+Subject: sh_eth: Use the platform device as the MDIO bus parent
+
+The MDIO bus parent is set to the network device. Beside not reflecting
+the hardware topology, this prevents registering the MDIO bus before
+initializing the network device. Fix it by setting the MDIO bus parent
+to the platform device.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit a5bd60608936fbb84471a80592401ce29a68de71)
+Signed-off-by: Simon Horman <horms+renesas@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 361ac103297b..088d8c3edb89 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2647,7 +2647,7 @@ 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;
++ mdp->mii_bus->parent = dev;
+ snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
+ mdp->pdev->name, id);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0109-sh_eth-Simplify-MDIO-bus-initialization-and-release.patch b/patches.renesas/0109-sh_eth-Simplify-MDIO-bus-initialization-and-release.patch
new file mode 100644
index 00000000000000..497709444e7f59
--- /dev/null
+++ b/patches.renesas/0109-sh_eth-Simplify-MDIO-bus-initialization-and-release.patch
@@ -0,0 +1,110 @@
+From 5fdcbc07e9aa12bfcbf5bbb3e8ff7727c486edb4 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 20 Mar 2014 15:00:33 +0100
+Subject: sh_eth: Simplify MDIO bus initialization and release
+
+The network device passed to the sh_mdio_init and sh_mdio_release
+functions is only used to access the sh_eth_private instance. Pass it
+directly to those functions.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit bd920ff553ba17f19372501a14e432d9d92b102b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 30 +++++++++++-------------------
+ 1 file changed, 11 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 088d8c3edb89..7067fdeb5bb3 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2597,29 +2597,24 @@ static void sh_eth_tsu_init(struct sh_eth_private *mdp)
+ }
+
+ /* MDIO bus release function */
+-static int sh_mdio_release(struct net_device *ndev)
++static int sh_mdio_release(struct sh_eth_private *mdp)
+ {
+- struct mii_bus *bus = dev_get_drvdata(&ndev->dev);
+-
+ /* unregister mdio bus */
+- mdiobus_unregister(bus);
+-
+- /* remove mdio bus info from net_device */
+- dev_set_drvdata(&ndev->dev, NULL);
++ mdiobus_unregister(mdp->mii_bus);
+
+ /* free bitbang info */
+- free_mdio_bitbang(bus);
++ free_mdio_bitbang(mdp->mii_bus);
+
+ return 0;
+ }
+
+ /* MDIO bus init function */
+-static int sh_mdio_init(struct net_device *ndev, int id,
++static int sh_mdio_init(struct sh_eth_private *mdp,
+ struct sh_eth_plat_data *pd)
+ {
+ int ret, i;
+ struct bb_info *bitbang;
+- struct sh_eth_private *mdp = netdev_priv(ndev);
++ struct platform_device *pdev = mdp->pdev;
+ struct device *dev = &mdp->pdev->dev;
+
+ /* create bit control struct for PHY */
+@@ -2649,7 +2644,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ mdp->mii_bus->name = "sh_mii";
+ mdp->mii_bus->parent = dev;
+ snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
+- mdp->pdev->name, id);
++ pdev->name, pdev->id);
+
+ /* PHY IRQ */
+ mdp->mii_bus->irq = devm_kzalloc(dev, sizeof(int) * PHY_MAX_ADDR,
+@@ -2659,10 +2654,9 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ goto out_free_bus;
+ }
+
+- /* register mdio bus */
+- if (ndev->dev.parent->of_node) {
+- ret = of_mdiobus_register(mdp->mii_bus,
+- ndev->dev.parent->of_node);
++ /* register MDIO bus */
++ if (dev->of_node) {
++ ret = of_mdiobus_register(mdp->mii_bus, dev->of_node);
+ } else {
+ for (i = 0; i < PHY_MAX_ADDR; i++)
+ mdp->mii_bus->irq[i] = PHY_POLL;
+@@ -2675,8 +2669,6 @@ static int sh_mdio_init(struct net_device *ndev, int id,
+ if (ret)
+ goto out_free_bus;
+
+- dev_set_drvdata(&ndev->dev, mdp->mii_bus);
+-
+ return 0;
+
+ out_free_bus:
+@@ -2921,7 +2913,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ goto out_napi_del;
+
+ /* mdio bus init */
+- ret = sh_mdio_init(ndev, pdev->id, pd);
++ ret = sh_mdio_init(mdp, pd);
+ if (ret) {
+ dev_err(&ndev->dev, "failed to initialise MDIO\n");
+ goto out_unregister;
+@@ -2955,7 +2947,7 @@ 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);
+
+- sh_mdio_release(ndev);
++ sh_mdio_release(mdp);
+ unregister_netdev(ndev);
+ netif_napi_del(&mdp->napi);
+ pm_runtime_disable(&pdev->dev);
+--
+2.1.2
+
diff --git a/patches.renesas/0110-sh_eth-Register-MDIO-bus-before-registering-the-netw.patch b/patches.renesas/0110-sh_eth-Register-MDIO-bus-before-registering-the-netw.patch
new file mode 100644
index 00000000000000..72993e5e1a93e4
--- /dev/null
+++ b/patches.renesas/0110-sh_eth-Register-MDIO-bus-before-registering-the-netw.patch
@@ -0,0 +1,77 @@
+From afc2c0af21e2e8eff5feaedd312d4c7d3f0d6ac4 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 20 Mar 2014 15:00:34 +0100
+Subject: sh_eth: Register MDIO bus before registering the network device
+
+Network API functions that rely on the MDIO bus can be called as soon as
+the driver calls register_netdev(). Register the MDIO bus before the
+network device to avoid race conditions.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit daacf03f0bbfefee3df107c3f7659d22e22538a7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 7067fdeb5bb3..5fc66a52c471 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2905,6 +2905,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ }
+ }
+
++ /* MDIO bus init */
++ ret = sh_mdio_init(mdp, pd);
++ if (ret) {
++ dev_err(&ndev->dev, "failed to initialise MDIO\n");
++ goto out_release;
++ }
++
+ netif_napi_add(ndev, &mdp->napi, sh_eth_poll, 64);
+
+ /* network device register */
+@@ -2912,13 +2919,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ if (ret)
+ goto out_napi_del;
+
+- /* mdio bus init */
+- ret = sh_mdio_init(mdp, pd);
+- if (ret) {
+- dev_err(&ndev->dev, "failed to initialise MDIO\n");
+- goto out_unregister;
+- }
+-
+ /* print device information */
+ netdev_info(ndev, "Base address at 0x%x, %pM, IRQ %d.\n",
+ (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
+@@ -2927,11 +2927,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+
+ return ret;
+
+-out_unregister:
+- unregister_netdev(ndev);
+-
+ out_napi_del:
+ netif_napi_del(&mdp->napi);
++ sh_mdio_release(mdp);
+
+ out_release:
+ /* net_dev free */
+@@ -2947,9 +2945,9 @@ 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);
+
+- sh_mdio_release(mdp);
+ unregister_netdev(ndev);
+ netif_napi_del(&mdp->napi);
++ sh_mdio_release(mdp);
+ pm_runtime_disable(&pdev->dev);
+ free_netdev(ndev);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0111-sh_eth-Remove-goto-statements-that-jump-straight-to-.patch b/patches.renesas/0111-sh_eth-Remove-goto-statements-that-jump-straight-to-.patch
new file mode 100644
index 00000000000000..9653c062505f13
--- /dev/null
+++ b/patches.renesas/0111-sh_eth-Remove-goto-statements-that-jump-straight-to-.patch
@@ -0,0 +1,121 @@
+From 42661cefc91b7c4bd8591a4b7810fb6c8de7cc57 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 20 Mar 2014 15:00:35 +0100
+Subject: sh_eth: Remove goto statements that jump straight to a return
+
+"goto" is well accepted for error paths in the kernel but should not be
+used unnecessarily. Return the correct value directly instead of using a
+goto when possible.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit f738a13d8365b0f824f3f20450b413f55374f175)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 30 +++++++++---------------------
+ 1 file changed, 9 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 5fc66a52c471..1043bbb30061 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -887,7 +887,7 @@ static int sh_eth_reset(struct net_device *ndev)
+
+ ret = sh_eth_check_reset(ndev);
+ if (ret)
+- goto out;
++ return ret;
+
+ /* Table Init */
+ sh_eth_write(ndev, 0x0, TDLAR);
+@@ -914,7 +914,6 @@ static int sh_eth_reset(struct net_device *ndev)
+ EDMR);
+ }
+
+-out:
+ return ret;
+ }
+
+@@ -1278,7 +1277,7 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
+ /* Soft Reset */
+ ret = sh_eth_reset(ndev);
+ if (ret)
+- goto out;
++ return ret;
+
+ if (mdp->cd->rmiimode)
+ sh_eth_write(ndev, 0x1, RMIIMODE);
+@@ -1357,7 +1356,6 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
+ netif_start_queue(ndev);
+ }
+
+-out:
+ return ret;
+ }
+
+@@ -2619,10 +2617,8 @@ static int sh_mdio_init(struct sh_eth_private *mdp,
+
+ /* create bit control struct for PHY */
+ bitbang = devm_kzalloc(dev, sizeof(struct bb_info), GFP_KERNEL);
+- if (!bitbang) {
+- ret = -ENOMEM;
+- goto out;
+- }
++ if (!bitbang)
++ return -ENOMEM;
+
+ /* bitbang init */
+ bitbang->addr = mdp->addr + mdp->reg_offset[PIR];
+@@ -2635,10 +2631,8 @@ static int sh_mdio_init(struct sh_eth_private *mdp,
+
+ /* MII controller setting */
+ mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl);
+- if (!mdp->mii_bus) {
+- ret = -ENOMEM;
+- goto out;
+- }
++ if (!mdp->mii_bus)
++ return -ENOMEM;
+
+ /* Hook up MII support for ethtool */
+ mdp->mii_bus->name = "sh_mii";
+@@ -2673,8 +2667,6 @@ static int sh_mdio_init(struct sh_eth_private *mdp,
+
+ out_free_bus:
+ free_mdio_bitbang(mdp->mii_bus);
+-
+-out:
+ return ret;
+ }
+
+@@ -2787,15 +2779,12 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (unlikely(res == NULL)) {
+ dev_err(&pdev->dev, "invalid resource\n");
+- ret = -EINVAL;
+- goto out;
++ return -EINVAL;
+ }
+
+ ndev = alloc_etherdev(sizeof(struct sh_eth_private));
+- if (!ndev) {
+- ret = -ENOMEM;
+- goto out;
+- }
++ if (!ndev)
++ return -ENOMEM;
+
+ /* The sh Ether-specific entries in the device structure. */
+ ndev->base_addr = res->start;
+@@ -2936,7 +2925,6 @@ out_release:
+ if (ndev)
+ free_netdev(ndev);
+
+-out:
+ return ret;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0112-sh_eth-ensure-pm_runtime-cannot-suspend-the-device-d.patch b/patches.renesas/0112-sh_eth-ensure-pm_runtime-cannot-suspend-the-device-d.patch
new file mode 100644
index 00000000000000..4dc96161073015
--- /dev/null
+++ b/patches.renesas/0112-sh_eth-ensure-pm_runtime-cannot-suspend-the-device-d.patch
@@ -0,0 +1,77 @@
+From f137510aa8ae4e0e87c34f20ec29fae6fda13406 Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Fri, 21 Mar 2014 12:09:14 +0100
+Subject: sh_eth: ensure pm_runtime cannot suspend the device during init
+
+The pm_rumtime work queue is causing the device to be suspended during
+initialisation, thus the initialisation may not be able to access registers
+properly. As the code is called from a work queue, it is possible that this
+is not seen from certain configurations/builds due to the asynchronos
+nature of the code.
+
+Another issue has also been found where the network device registration
+calls back into the driver thus causing further pm_runtime calls that
+also caused issues with the MDIO bus code. This has now been checked
+and is the only place the MDIO can be called without the device open.
+
+Use pm_runtime_get_sync() and pm_runtime_put() to ensure that the
+pm system does not suspend it during the probe() call and remove the
+now unnecessary pm_runtime_resume() call. Also add a call in the error
+path to call pm_runtime_disable().
+
+This fixes the external abort that can cause /sbin/init or other such
+init processed to die.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+(cherry picked from commit b5893a08812602de164fa5ac6494f84df8d09a4f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/net/ethernet/renesas/sh_eth.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
+index 1043bbb30061..08ed9a30c3a7 100644
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -2786,6 +2786,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ if (!ndev)
+ return -ENOMEM;
+
++ pm_runtime_enable(&pdev->dev);
++ pm_runtime_get_sync(&pdev->dev);
++
+ /* The sh Ether-specific entries in the device structure. */
+ ndev->base_addr = res->start;
+ devno = pdev->id;
+@@ -2813,8 +2816,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+
+ spin_lock_init(&mdp->lock);
+ mdp->pdev = pdev;
+- pm_runtime_enable(&pdev->dev);
+- pm_runtime_resume(&pdev->dev);
+
+ if (pdev->dev.of_node)
+ pd = sh_eth_parse_dt(&pdev->dev);
+@@ -2912,6 +2913,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
+ netdev_info(ndev, "Base address at 0x%x, %pM, IRQ %d.\n",
+ (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
+
++ pm_runtime_put(&pdev->dev);
+ platform_set_drvdata(pdev, ndev);
+
+ return ret;
+@@ -2925,6 +2927,8 @@ out_release:
+ if (ndev)
+ free_netdev(ndev);
+
++ pm_runtime_put(&pdev->dev);
++ pm_runtime_disable(&pdev->dev);
+ return ret;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0113-mmc-sh_mobile_sdhi-Use-modern-PM-macros-to-define-pm.patch b/patches.renesas/0113-mmc-sh_mobile_sdhi-Use-modern-PM-macros-to-define-pm.patch
new file mode 100644
index 00000000000000..cd8e33b03896a4
--- /dev/null
+++ b/patches.renesas/0113-mmc-sh_mobile_sdhi-Use-modern-PM-macros-to-define-pm.patch
@@ -0,0 +1,36 @@
+From fc928a0db3812c3d823c5aa3356110797237efc0 Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+Date: Wed, 23 Oct 2013 14:51:31 +0200
+Subject: mmc: sh_mobile_sdhi: Use modern PM macros to define pm callbacks
+
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 4e262d7f6fd43d798175cf26223c5bd3ebfd7b13)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/sh_mobile_sdhi.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
+index 2d6ce257a273..03fe7518bba4 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -316,10 +316,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
+ }
+
+ static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
+- .suspend = tmio_mmc_host_suspend,
+- .resume = tmio_mmc_host_resume,
+- .runtime_suspend = tmio_mmc_host_runtime_suspend,
+- .runtime_resume = tmio_mmc_host_runtime_resume,
++ SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_host_suspend, tmio_mmc_host_resume)
++ SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
++ tmio_mmc_host_runtime_resume,
++ NULL)
+ };
+
+ static struct platform_driver sh_mobile_sdhi_driver = {
+--
+2.1.2
+
diff --git a/patches.renesas/0114-mmc-tmio_mmc-Convert-from-legacy-to-modern-PM-ops.patch b/patches.renesas/0114-mmc-tmio_mmc-Convert-from-legacy-to-modern-PM-ops.patch
new file mode 100644
index 00000000000000..25c30e662c3013
--- /dev/null
+++ b/patches.renesas/0114-mmc-tmio_mmc-Convert-from-legacy-to-modern-PM-ops.patch
@@ -0,0 +1,92 @@
+From b940887b0d91df677ace9b35e3cafeee9b0c4ff9 Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+Date: Wed, 23 Oct 2013 14:57:50 +0200
+Subject: mmc: tmio_mmc: Convert from legacy to modern PM ops
+
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit c8964481d0273ef77a37ed2c627482fde3a1222c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/tmio_mmc.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
+index 1900abb04236..cfad844730d8 100644
+--- a/drivers/mmc/host/tmio_mmc.c
++++ b/drivers/mmc/host/tmio_mmc.c
+@@ -23,38 +23,37 @@
+
+ #include "tmio_mmc.h"
+
+-#ifdef CONFIG_PM
+-static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
++#ifdef CONFIG_PM_SLEEP
++static int tmio_mmc_suspend(struct device *dev)
+ {
+- const struct mfd_cell *cell = mfd_get_cell(dev);
++ struct platform_device *pdev = to_platform_device(dev);
++ const struct mfd_cell *cell = mfd_get_cell(pdev);
+ int ret;
+
+- ret = tmio_mmc_host_suspend(&dev->dev);
++ ret = tmio_mmc_host_suspend(dev);
+
+ /* Tell MFD core it can disable us now.*/
+ if (!ret && cell->disable)
+- cell->disable(dev);
++ cell->disable(pdev);
+
+ return ret;
+ }
+
+-static int tmio_mmc_resume(struct platform_device *dev)
++static int tmio_mmc_resume(struct device *dev)
+ {
+- const struct mfd_cell *cell = mfd_get_cell(dev);
++ struct platform_device *pdev = to_platform_device(dev);
++ const struct mfd_cell *cell = mfd_get_cell(pdev);
+ int ret = 0;
+
+ /* Tell the MFD core we are ready to be enabled */
+ if (cell->resume)
+- ret = cell->resume(dev);
++ ret = cell->resume(pdev);
+
+ if (!ret)
+- ret = tmio_mmc_host_resume(&dev->dev);
++ ret = tmio_mmc_host_resume(dev);
+
+ return ret;
+ }
+-#else
+-#define tmio_mmc_suspend NULL
+-#define tmio_mmc_resume NULL
+ #endif
+
+ static int tmio_mmc_probe(struct platform_device *pdev)
+@@ -134,15 +133,18 @@ static int tmio_mmc_remove(struct platform_device *pdev)
+
+ /* ------------------- device registration ----------------------- */
+
++static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
++ SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
++};
++
+ static struct platform_driver tmio_mmc_driver = {
+ .driver = {
+ .name = "tmio-mmc",
+ .owner = THIS_MODULE,
++ .pm = &tmio_mmc_dev_pm_ops,
+ },
+ .probe = tmio_mmc_probe,
+ .remove = tmio_mmc_remove,
+- .suspend = tmio_mmc_suspend,
+- .resume = tmio_mmc_resume,
+ };
+
+ module_platform_driver(tmio_mmc_driver);
+--
+2.1.2
+
diff --git a/patches.renesas/0115-mmc-tmio-Adapt-to-proper-PM-configs-for-exported-fun.patch b/patches.renesas/0115-mmc-tmio-Adapt-to-proper-PM-configs-for-exported-fun.patch
new file mode 100644
index 00000000000000..f7678845553fc5
--- /dev/null
+++ b/patches.renesas/0115-mmc-tmio-Adapt-to-proper-PM-configs-for-exported-fun.patch
@@ -0,0 +1,77 @@
+From b79a8672b7083151d151ed2ecd0c1b139f4a6882 Mon Sep 17 00:00:00 2001
+From: Ulf Hansson <ulf.hansson@linaro.org>
+Date: Wed, 23 Oct 2013 14:55:07 +0200
+Subject: mmc: tmio: Adapt to proper PM configs for exported functions
+
+Since the users of the exported PM functions are now using the modern
+PM ops macros, we can convert to the proper corresponding PM configs.
+
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 710dec95d579bf59c157358cc9cf7b42907d1c0f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/tmio_mmc.h | 7 +++----
+ drivers/mmc/host/tmio_mmc_pio.c | 7 ++++---
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
+index aaa9c7e9e730..100ffe0b2faf 100644
+--- a/drivers/mmc/host/tmio_mmc.h
++++ b/drivers/mmc/host/tmio_mmc.h
+@@ -162,16 +162,15 @@ static inline void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
+ }
+ #endif
+
+-#ifdef CONFIG_PM
++#ifdef CONFIG_PM_SLEEP
+ int tmio_mmc_host_suspend(struct device *dev);
+ int tmio_mmc_host_resume(struct device *dev);
+-#else
+-#define tmio_mmc_host_suspend NULL
+-#define tmio_mmc_host_resume NULL
+ #endif
+
++#ifdef CONFIG_PM_RUNTIME
+ int tmio_mmc_host_runtime_suspend(struct device *dev);
+ int tmio_mmc_host_runtime_resume(struct device *dev);
++#endif
+
+ static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
+ {
+diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
+index 8d8abf23a611..faf0924e71cb 100644
+--- a/drivers/mmc/host/tmio_mmc_pio.c
++++ b/drivers/mmc/host/tmio_mmc_pio.c
+@@ -1142,7 +1142,7 @@ void tmio_mmc_host_remove(struct tmio_mmc_host *host)
+ }
+ EXPORT_SYMBOL(tmio_mmc_host_remove);
+
+-#ifdef CONFIG_PM
++#ifdef CONFIG_PM_SLEEP
+ int tmio_mmc_host_suspend(struct device *dev)
+ {
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+@@ -1165,9 +1165,9 @@ int tmio_mmc_host_resume(struct device *dev)
+ return 0;
+ }
+ EXPORT_SYMBOL(tmio_mmc_host_resume);
++#endif
+
+-#endif /* CONFIG_PM */
+-
++#ifdef CONFIG_PM_RUNTIME
+ int tmio_mmc_host_runtime_suspend(struct device *dev)
+ {
+ return 0;
+@@ -1184,5 +1184,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
+ return 0;
+ }
+ EXPORT_SYMBOL(tmio_mmc_host_runtime_resume);
++#endif
+
+ MODULE_LICENSE("GPL v2");
+--
+2.1.2
+
diff --git a/patches.renesas/0116-mmc-sdhi-tidyup-sh_mobile_sdhi_of_match-position.patch b/patches.renesas/0116-mmc-sdhi-tidyup-sh_mobile_sdhi_of_match-position.patch
new file mode 100644
index 00000000000000..ff2f42f66898a8
--- /dev/null
+++ b/patches.renesas/0116-mmc-sdhi-tidyup-sh_mobile_sdhi_of_match-position.patch
@@ -0,0 +1,64 @@
+From 8f550fbf0ea0e211a844a90f025b70039b05d9a2 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 20 Feb 2014 16:54:44 -0800
+Subject: mmc: sdhi: tidyup sh_mobile_sdhi_of_match position
+
+It is easier to read if sh_mobile_sdhi_of_cfg and
+sh_mobile_sdhi_of_match are closer.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 2772ef30eacd72fef013ac2fade2f384342ba6c7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/sh_mobile_sdhi.c | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
+index 03fe7518bba4..a7a3f689a309 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -45,6 +45,19 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
+ },
+ };
+
++static const struct of_device_id sh_mobile_sdhi_of_match[] = {
++ { .compatible = "renesas,sdhi-shmobile" },
++ { .compatible = "renesas,sdhi-sh7372" },
++ { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
++ {},
++};
++MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
++
+ struct sh_mobile_sdhi {
+ struct clk *clk;
+ struct tmio_mmc_data mmc_data;
+@@ -114,19 +127,6 @@ static const struct sh_mobile_sdhi_ops sdhi_ops = {
+ .cd_wakeup = sh_mobile_sdhi_cd_wakeup,
+ };
+
+-static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+- { .compatible = "renesas,sdhi-shmobile" },
+- { .compatible = "renesas,sdhi-sh7372" },
+- { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
+- {},
+-};
+-MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
+-
+ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
+ {
+ const struct of_device_id *of_id =
+--
+2.1.2
+
diff --git a/patches.renesas/0117-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7778.patch b/patches.renesas/0117-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7778.patch
new file mode 100644
index 00000000000000..f0d50bbb3b3eda
--- /dev/null
+++ b/patches.renesas/0117-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7778.patch
@@ -0,0 +1,59 @@
+From f560e57a6898b9d118eab107c5888d7fc13c7757 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 20 Feb 2014 16:54:58 -0800
+Subject: mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7778
+
+This patch updates r8a7778 DT data to have SoC specific settings.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit b3a5d4ce65162d27a495b8fa3ac21dcdf58738b1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/sh_mobile_sdhi.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
+index a7a3f689a309..e956bc4e28c1 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -37,6 +37,7 @@
+
+ struct sh_mobile_sdhi_of_data {
+ unsigned long tmio_flags;
++ unsigned long capabilities;
+ };
+
+ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
+@@ -45,13 +46,18 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
+ },
+ };
+
++static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
++ .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
++};
++
+ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+ { .compatible = "renesas,sdhi-shmobile" },
+ { .compatible = "renesas,sdhi-sh7372" },
+ { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+- { .compatible = "renesas,sdhi-r8a7778", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
+ { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
+ {},
+@@ -212,6 +218,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
+ if (of_id && of_id->data) {
+ const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
+ mmc_data->flags |= of_data->tmio_flags;
++ mmc_data->capabilities |= of_data->capabilities;
+ }
+
+ /* SD control register space size is 0x100, 0x200 for bus_shift=1 */
+--
+2.1.2
+
diff --git a/patches.renesas/0118-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7779.patch b/patches.renesas/0118-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7779.patch
new file mode 100644
index 00000000000000..ec1e3e3bc1b6dc
--- /dev/null
+++ b/patches.renesas/0118-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7779.patch
@@ -0,0 +1,32 @@
+From c36760186a19d0a69a3b410fbea522ae0533daa2 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 20 Feb 2014 16:55:12 -0800
+Subject: mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7779
+
+This patch updates r8a7779 DT data to have SoC specific settings.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 81bbbc7278fa109fb691446a521dcfc18b87e57d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/sh_mobile_sdhi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
+index e956bc4e28c1..38acf2665bdf 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -58,7 +58,7 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+ { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
+- { .compatible = "renesas,sdhi-r8a7779", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+ { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
+ {},
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0119-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7790.patch b/patches.renesas/0119-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7790.patch
new file mode 100644
index 00000000000000..29c165dc4b5ee3
--- /dev/null
+++ b/patches.renesas/0119-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7790.patch
@@ -0,0 +1,61 @@
+From f853726927961824e3e637944d17e426db5e8215 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 20 Feb 2014 16:55:27 -0800
+Subject: mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7790
+
+This patch updates r8a7790 DT data to have SoC specific settings.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 423f6c2e977de73b8723e73d8cc585de40893f5b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/mmc/host/sh_mobile_sdhi.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
+index 38acf2665bdf..cfc37ec26458 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -38,6 +38,7 @@
+ struct sh_mobile_sdhi_of_data {
+ unsigned long tmio_flags;
+ unsigned long capabilities;
++ unsigned long capabilities2;
+ };
+
+ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
+@@ -51,6 +52,12 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
+ .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
+ };
+
++static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = {
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE,
++ .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
++ .capabilities2 = MMC_CAP2_NO_MULTI_READ,
++};
++
+ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+ { .compatible = "renesas,sdhi-shmobile" },
+ { .compatible = "renesas,sdhi-sh7372" },
+@@ -59,7 +66,7 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+ { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+ { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
+ { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+- { .compatible = "renesas,sdhi-r8a7790", .data = &sh_mobile_sdhi_of_cfg[0], },
++ { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
+ {},
+ };
+ MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
+@@ -219,6 +226,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
+ const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
+ mmc_data->flags |= of_data->tmio_flags;
+ mmc_data->capabilities |= of_data->capabilities;
++ mmc_data->capabilities2 |= of_data->capabilities2;
+ }
+
+ /* SD control register space size is 0x100, 0x200 for bus_shift=1 */
+--
+2.1.2
+
diff --git a/patches.renesas/0120-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7791.patch b/patches.renesas/0120-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7791.patch
new file mode 100644
index 00000000000000..9bd3b8a277a8c2
--- /dev/null
+++ b/patches.renesas/0120-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7791.patch
@@ -0,0 +1,31 @@
+From 6852ba30f9916efa2c5455fc2b94bb7a798fd1a0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 20 Feb 2014 16:55:40 -0800
+Subject: mmc: sdhi: update sh_mobile_sdhi_of_data for r8a7791
+
+This patch adds DT support for r8a7791.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Chris Ball <chris@printf.net>
+(cherry picked from commit 81918d25a7ae2a7eada4237d00b8d6dbecffda6c)
+Signed-off-by: Simon Horman <horms+renesas@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 cfc37ec26458..91058dabd11a 100644
+--- a/drivers/mmc/host/sh_mobile_sdhi.c
++++ b/drivers/mmc/host/sh_mobile_sdhi.c
+@@ -67,6 +67,7 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = {
+ { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
+ { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
+ { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
++ { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, },
+ {},
+ };
+ MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);
+--
+2.1.2
+
diff --git a/patches.renesas/0121-pinctrl-sh-pfc-r8a7791-Add-QSPI-pin-groups.patch b/patches.renesas/0121-pinctrl-sh-pfc-r8a7791-Add-QSPI-pin-groups.patch
new file mode 100644
index 00000000000000..c87146b042450d
--- /dev/null
+++ b/patches.renesas/0121-pinctrl-sh-pfc-r8a7791-Add-QSPI-pin-groups.patch
@@ -0,0 +1,116 @@
+From cb1ae576dc286794f773ec63f41c95c9d8a6c73a Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Sun, 12 Jan 2014 12:00:30 +0100
+Subject: pinctrl: sh-pfc: r8a7791: Add QSPI pin groups
+
+A QSPI function set consists of 3 groups:
+ - qspi_ctrl (2 control wires)
+ - qspi_data2 (2 data wires, for Single/Dual SPI)
+ - qspi_data4 (4 data wires, for Quad SPI)
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+(cherry picked from commit 2d0c386f135e41865f15e467fa1c6c0ec93d4a60)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 63 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 63 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+index 567d6918d50b..c515f01378f0 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+@@ -2137,6 +2137,53 @@ static const unsigned int msiof2_tx_pins[] = {
+ static const unsigned int msiof2_tx_mux[] = {
+ MSIOF2_TXD_MARK,
+ };
++/* - QSPI ------------------------------------------------------------------- */
++static const unsigned int qspi_ctrl_pins[] = {
++ /* SPCLK, SSL */
++ RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 9),
++};
++static const unsigned int qspi_ctrl_mux[] = {
++ SPCLK_MARK, SSL_MARK,
++};
++static const unsigned int qspi_data2_pins[] = {
++ /* MOSI_IO0, MISO_IO1 */
++ RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6),
++};
++static const unsigned int qspi_data2_mux[] = {
++ MOSI_IO0_MARK, MISO_IO1_MARK,
++};
++static const unsigned int qspi_data4_pins[] = {
++ /* MOSI_IO0, MISO_IO1, IO2, IO3 */
++ RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
++ RCAR_GP_PIN(1, 8),
++};
++static const unsigned int qspi_data4_mux[] = {
++ MOSI_IO0_MARK, MISO_IO1_MARK, IO2_MARK, IO3_MARK,
++};
++
++static const unsigned int qspi_ctrl_b_pins[] = {
++ /* SPCLK, SSL */
++ RCAR_GP_PIN(6, 0), RCAR_GP_PIN(6, 5),
++};
++static const unsigned int qspi_ctrl_b_mux[] = {
++ SPCLK_B_MARK, SSL_B_MARK,
++};
++static const unsigned int qspi_data2_b_pins[] = {
++ /* MOSI_IO0, MISO_IO1 */
++ RCAR_GP_PIN(6, 1), RCAR_GP_PIN(6, 2),
++};
++static const unsigned int qspi_data2_b_mux[] = {
++ MOSI_IO0_B_MARK, MISO_IO1_B_MARK,
++};
++static const unsigned int qspi_data4_b_pins[] = {
++ /* MOSI_IO0, MISO_IO1, IO2, IO3 */
++ RCAR_GP_PIN(6, 1), RCAR_GP_PIN(6, 2), RCAR_GP_PIN(6, 3),
++ RCAR_GP_PIN(6, 4),
++};
++static const unsigned int qspi_data4_b_mux[] = {
++ SPCLK_B_MARK, MOSI_IO0_B_MARK, MISO_IO1_B_MARK,
++ IO2_B_MARK, IO3_B_MARK, SSL_B_MARK,
++};
+ /* - SCIF0 ------------------------------------------------------------------ */
+ static const unsigned int scif0_data_pins[] = {
+ /* RX, TX */
+@@ -3151,6 +3198,12 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(msiof2_ss2),
+ SH_PFC_PIN_GROUP(msiof2_rx),
+ SH_PFC_PIN_GROUP(msiof2_tx),
++ SH_PFC_PIN_GROUP(qspi_ctrl),
++ SH_PFC_PIN_GROUP(qspi_data2),
++ SH_PFC_PIN_GROUP(qspi_data4),
++ SH_PFC_PIN_GROUP(qspi_ctrl_b),
++ SH_PFC_PIN_GROUP(qspi_data2_b),
++ SH_PFC_PIN_GROUP(qspi_data4_b),
+ SH_PFC_PIN_GROUP(scif0_data),
+ SH_PFC_PIN_GROUP(scif0_data_b),
+ SH_PFC_PIN_GROUP(scif0_data_c),
+@@ -3378,6 +3431,15 @@ static const char * const msiof2_groups[] = {
+ "msiof2_tx",
+ };
+
++static const char * const qspi_groups[] = {
++ "qspi_ctrl",
++ "qspi_data2",
++ "qspi_data4",
++ "qspi_ctrl_b",
++ "qspi_data2_b",
++ "qspi_data4_b",
++};
++
+ static const char * const scif0_groups[] = {
+ "scif0_data",
+ "scif0_data_b",
+@@ -3573,6 +3635,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
+ SH_PFC_FUNCTION(msiof0),
+ SH_PFC_FUNCTION(msiof1),
+ SH_PFC_FUNCTION(msiof2),
++ SH_PFC_FUNCTION(qspi),
+ SH_PFC_FUNCTION(scif0),
+ SH_PFC_FUNCTION(scif1),
+ SH_PFC_FUNCTION(scif2),
+--
+2.1.2
+
diff --git a/patches.renesas/0122-pinctrl-sh-pfc-r8a7790-Break-out-USB0-OVC-VBUS.patch b/patches.renesas/0122-pinctrl-sh-pfc-r8a7790-Break-out-USB0-OVC-VBUS.patch
new file mode 100644
index 00000000000000..7e746a6aab987e
--- /dev/null
+++ b/patches.renesas/0122-pinctrl-sh-pfc-r8a7790-Break-out-USB0-OVC-VBUS.patch
@@ -0,0 +1,55 @@
+From 41402e148bb8fc61a9b22cbf980e1d86c8c027bb Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 30 Jan 2014 08:10:19 +0900
+Subject: pinctrl: sh-pfc: r8a7790: Break out USB0 OVC/VBUS
+
+Create a new group for the USB0 OVC/VBUS pin by itself. This
+allows us to monitor PWEN as GPIO on the Lager board.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 97e00faaf16a0642cac47937e26f437651a6b4a4)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+index c381ae63c508..ee2ae05c23ad 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+@@ -3231,6 +3231,13 @@ static const unsigned int usb0_pins[] = {
+ static const unsigned int usb0_mux[] = {
+ USB0_PWEN_MARK, USB0_OVC_VBUS_MARK,
+ };
++static const unsigned int usb0_ovc_vbus_pins[] = {
++ /* OVC/VBUS */
++ RCAR_GP_PIN(5, 19),
++};
++static const unsigned int usb0_ovc_vbus_mux[] = {
++ USB0_OVC_VBUS_MARK,
++};
+ /* - USB1 ------------------------------------------------------------------- */
+ static const unsigned int usb1_pins[] = {
+ /* PWEN, OVC */
+@@ -3789,6 +3796,7 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(tpu0_to2),
+ SH_PFC_PIN_GROUP(tpu0_to3),
+ SH_PFC_PIN_GROUP(usb0),
++ SH_PFC_PIN_GROUP(usb0_ovc_vbus),
+ SH_PFC_PIN_GROUP(usb1),
+ SH_PFC_PIN_GROUP(usb2),
+ VIN_DATA_PIN_GROUP(vin0_data, 24),
+@@ -4134,6 +4142,7 @@ static const char * const tpu0_groups[] = {
+
+ static const char * const usb0_groups[] = {
+ "usb0",
++ "usb0_ovc_vbus",
+ };
+
+ static const char * const usb1_groups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0123-pinctrl-sh-pfc-r8a7790-Add-QSPI-pin-groups.patch b/patches.renesas/0123-pinctrl-sh-pfc-r8a7790-Add-QSPI-pin-groups.patch
new file mode 100644
index 00000000000000..204c41eadefa30
--- /dev/null
+++ b/patches.renesas/0123-pinctrl-sh-pfc-r8a7790-Add-QSPI-pin-groups.patch
@@ -0,0 +1,87 @@
+From 52646ba303d8cd0650437c4fb99ed5fce4eabe01 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 14:00:57 +0100
+Subject: pinctrl: sh-pfc: r8a7790: Add QSPI pin groups
+
+A QSPI function set consists of 3 groups:
+ - qspi_ctrl (2 control wires)
+ - qspi_data2 (2 data wires, for Single/Dual SPI)
+ - qspi_data4 (4 data wires, for Quad SPI)
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 202909cdf117743bdbf8abc0f817950c8955c8cf)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+index ee2ae05c23ad..2814440843df 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+@@ -2389,6 +2389,29 @@ static const unsigned int msiof3_tx_pins[] = {
+ static const unsigned int msiof3_tx_mux[] = {
+ MSIOF3_TXD_MARK,
+ };
++/* - QSPI ------------------------------------------------------------------- */
++static const unsigned int qspi_ctrl_pins[] = {
++ /* SPCLK, SSL */
++ RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 9),
++};
++static const unsigned int qspi_ctrl_mux[] = {
++ SPCLK_MARK, SSL_MARK,
++};
++static const unsigned int qspi_data2_pins[] = {
++ /* MOSI_IO0, MISO_IO1 */
++ RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6),
++};
++static const unsigned int qspi_data2_mux[] = {
++ MOSI_IO0_MARK, MISO_IO1_MARK,
++};
++static const unsigned int qspi_data4_pins[] = {
++ /* MOSI_IO0, MISO_IO1, IO2, IO3 */
++ RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
++ RCAR_GP_PIN(1, 8),
++};
++static const unsigned int qspi_data4_mux[] = {
++ MOSI_IO0_MARK, MISO_IO1_MARK, IO2_MARK, IO3_MARK,
++};
+ /* - SCIF0 ------------------------------------------------------------------ */
+ static const unsigned int scif0_data_pins[] = {
+ /* RX, TX */
+@@ -3678,6 +3701,9 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(msiof3_ss2),
+ SH_PFC_PIN_GROUP(msiof3_rx),
+ SH_PFC_PIN_GROUP(msiof3_tx),
++ SH_PFC_PIN_GROUP(qspi_ctrl),
++ SH_PFC_PIN_GROUP(qspi_data2),
++ SH_PFC_PIN_GROUP(qspi_data4),
+ SH_PFC_PIN_GROUP(scif0_data),
+ SH_PFC_PIN_GROUP(scif0_clk),
+ SH_PFC_PIN_GROUP(scif0_ctrl),
+@@ -3978,6 +4004,12 @@ static const char * const msiof3_groups[] = {
+ "msiof3_tx",
+ };
+
++static const char * const qspi_groups[] = {
++ "qspi_ctrl",
++ "qspi_data2",
++ "qspi_data4",
++};
++
+ static const char * const scif0_groups[] = {
+ "scif0_data",
+ "scif0_clk",
+@@ -4222,6 +4254,7 @@ static const struct sh_pfc_function pinmux_functions[] = {
+ SH_PFC_FUNCTION(msiof1),
+ SH_PFC_FUNCTION(msiof2),
+ SH_PFC_FUNCTION(msiof3),
++ SH_PFC_FUNCTION(qspi),
+ SH_PFC_FUNCTION(scif0),
+ SH_PFC_FUNCTION(scif1),
+ SH_PFC_FUNCTION(scif2),
+--
+2.1.2
+
diff --git a/patches.renesas/0124-pinctrl-pfc-r8a7791-add-mux-data-for-IIC-B-cores.patch b/patches.renesas/0124-pinctrl-pfc-r8a7791-add-mux-data-for-IIC-B-cores.patch
new file mode 100644
index 00000000000000..1e49b3219549b1
--- /dev/null
+++ b/patches.renesas/0124-pinctrl-pfc-r8a7791-add-mux-data-for-IIC-B-cores.patch
@@ -0,0 +1,113 @@
+From 6dfd8163aed88dfcf4e9750f17edd7ad45d29b13 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Sun, 23 Feb 2014 13:38:12 +0100
+Subject: pinctrl: pfc: r8a7791: add mux data for IIC(B) cores
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 6787141361dc77b5d55bf58760029f846244ba3a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 64 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 64 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+index c515f01378f0..461e91096845 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+@@ -1945,6 +1945,50 @@ static const unsigned int i2c4_c_pins[] = {
+ static const unsigned int i2c4_c_mux[] = {
+ SCL4_C_MARK, SDA4_C_MARK,
+ };
++/* - I2C7 ------------------------------------------------------------------- */
++static const unsigned int i2c7_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 16),
++};
++static const unsigned int i2c7_mux[] = {
++ SCL7_MARK, SDA7_MARK,
++};
++static const unsigned int i2c7_b_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
++};
++static const unsigned int i2c7_b_mux[] = {
++ SCL7_B_MARK, SDA7_B_MARK,
++};
++static const unsigned int i2c7_c_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
++};
++static const unsigned int i2c7_c_mux[] = {
++ SCL7_C_MARK, SDA7_C_MARK,
++};
++/* - I2C8 ------------------------------------------------------------------- */
++static const unsigned int i2c8_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(4, 13), RCAR_GP_PIN(4, 14),
++};
++static const unsigned int i2c8_mux[] = {
++ SCL8_MARK, SDA8_MARK,
++};
++static const unsigned int i2c8_b_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
++};
++static const unsigned int i2c8_b_mux[] = {
++ SCL8_B_MARK, SDA8_B_MARK,
++};
++static const unsigned int i2c8_c_pins[] = {
++ /* SCL, SDA */
++ RCAR_GP_PIN(6, 22), RCAR_GP_PIN(6, 23),
++};
++static const unsigned int i2c8_c_mux[] = {
++ SCL8_C_MARK, SDA8_C_MARK,
++};
+ /* - INTC ------------------------------------------------------------------- */
+ static const unsigned int intc_irq0_pins[] = {
+ /* IRQ */
+@@ -3172,6 +3216,12 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(i2c4),
+ SH_PFC_PIN_GROUP(i2c4_b),
+ SH_PFC_PIN_GROUP(i2c4_c),
++ SH_PFC_PIN_GROUP(i2c7),
++ SH_PFC_PIN_GROUP(i2c7_b),
++ SH_PFC_PIN_GROUP(i2c7_c),
++ SH_PFC_PIN_GROUP(i2c8),
++ SH_PFC_PIN_GROUP(i2c8_b),
++ SH_PFC_PIN_GROUP(i2c8_c),
+ SH_PFC_PIN_GROUP(intc_irq0),
+ SH_PFC_PIN_GROUP(intc_irq1),
+ SH_PFC_PIN_GROUP(intc_irq2),
+@@ -3390,6 +3440,18 @@ static const char * const i2c4_groups[] = {
+ "i2c4_c",
+ };
+
++static const char * const i2c7_groups[] = {
++ "i2c7",
++ "i2c7_b",
++ "i2c7_c",
++};
++
++static const char * const i2c8_groups[] = {
++ "i2c8",
++ "i2c8_b",
++ "i2c8_c",
++};
++
+ static const char * const intc_groups[] = {
+ "intc_irq0",
+ "intc_irq1",
+@@ -3630,6 +3692,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
+ SH_PFC_FUNCTION(i2c2),
+ SH_PFC_FUNCTION(i2c3),
+ SH_PFC_FUNCTION(i2c4),
++ SH_PFC_FUNCTION(i2c7),
++ SH_PFC_FUNCTION(i2c8),
+ SH_PFC_FUNCTION(intc),
+ SH_PFC_FUNCTION(mmc),
+ SH_PFC_FUNCTION(msiof0),
+--
+2.1.2
+
diff --git a/patches.renesas/0125-pinctrl-sh-pfc-r8a7790-Add-alternative-MSIOF-pin-gro.patch b/patches.renesas/0125-pinctrl-sh-pfc-r8a7790-Add-alternative-MSIOF-pin-gro.patch
new file mode 100644
index 00000000000000..c4e00850a16dab
--- /dev/null
+++ b/patches.renesas/0125-pinctrl-sh-pfc-r8a7790-Add-alternative-MSIOF-pin-gro.patch
@@ -0,0 +1,212 @@
+From 2abe801bdba56180853d170ac6193f0f6399cbea Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 20:53:40 +0100
+Subject: pinctrl: sh-pfc: r8a7790: Add alternative MSIOF pin groups
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 7033168da51e43ebba7870f089d275b4589df0c5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 129 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 129 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+index 2814440843df..48093719167a 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+@@ -2260,6 +2260,42 @@ static const unsigned int msiof0_tx_pins[] = {
+ static const unsigned int msiof0_tx_mux[] = {
+ MSIOF0_TXD_MARK,
+ };
++
++static const unsigned int msiof0_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(1, 23),
++};
++static const unsigned int msiof0_clk_b_mux[] = {
++ MSIOF0_SCK_B_MARK,
++};
++static const unsigned int msiof0_ss1_b_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(1, 12),
++};
++static const unsigned int msiof0_ss1_b_mux[] = {
++ MSIOF0_SS1_B_MARK,
++};
++static const unsigned int msiof0_ss2_b_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(1, 10),
++};
++static const unsigned int msiof0_ss2_b_mux[] = {
++ MSIOF0_SS2_B_MARK,
++};
++static const unsigned int msiof0_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(1, 29),
++};
++static const unsigned int msiof0_rx_b_mux[] = {
++ MSIOF0_RXD_B_MARK,
++};
++static const unsigned int msiof0_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(1, 28),
++};
++static const unsigned int msiof0_tx_b_mux[] = {
++ MSIOF0_TXD_B_MARK,
++};
+ /* - MSIOF1 ----------------------------------------------------------------- */
+ static const unsigned int msiof1_clk_pins[] = {
+ /* SCK */
+@@ -2303,6 +2339,42 @@ static const unsigned int msiof1_tx_pins[] = {
+ static const unsigned int msiof1_tx_mux[] = {
+ MSIOF1_TXD_MARK,
+ };
++
++static const unsigned int msiof1_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(1, 16),
++};
++static const unsigned int msiof1_clk_b_mux[] = {
++ MSIOF1_SCK_B_MARK,
++};
++static const unsigned int msiof1_ss1_b_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(0, 18),
++};
++static const unsigned int msiof1_ss1_b_mux[] = {
++ MSIOF1_SS1_B_MARK,
++};
++static const unsigned int msiof1_ss2_b_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(0, 19),
++};
++static const unsigned int msiof1_ss2_b_mux[] = {
++ MSIOF1_SS2_B_MARK,
++};
++static const unsigned int msiof1_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(1, 17),
++};
++static const unsigned int msiof1_rx_b_mux[] = {
++ MSIOF1_RXD_B_MARK,
++};
++static const unsigned int msiof1_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(0, 20),
++};
++static const unsigned int msiof1_tx_b_mux[] = {
++ MSIOF1_TXD_B_MARK,
++};
+ /* - MSIOF2 ----------------------------------------------------------------- */
+ static const unsigned int msiof2_clk_pins[] = {
+ /* SCK */
+@@ -2389,6 +2461,35 @@ static const unsigned int msiof3_tx_pins[] = {
+ static const unsigned int msiof3_tx_mux[] = {
+ MSIOF3_TXD_MARK,
+ };
++
++static const unsigned int msiof3_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(0, 0),
++};
++static const unsigned int msiof3_clk_b_mux[] = {
++ MSIOF3_SCK_B_MARK,
++};
++static const unsigned int msiof3_sync_b_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(0, 1),
++};
++static const unsigned int msiof3_sync_b_mux[] = {
++ MSIOF3_SYNC_B_MARK,
++};
++static const unsigned int msiof3_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(0, 2),
++};
++static const unsigned int msiof3_rx_b_mux[] = {
++ MSIOF3_RXD_B_MARK,
++};
++static const unsigned int msiof3_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(0, 3),
++};
++static const unsigned int msiof3_tx_b_mux[] = {
++ MSIOF3_TXD_B_MARK,
++};
+ /* - QSPI ------------------------------------------------------------------- */
+ static const unsigned int qspi_ctrl_pins[] = {
+ /* SPCLK, SSL */
+@@ -3683,12 +3784,22 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(msiof0_ss2),
+ SH_PFC_PIN_GROUP(msiof0_rx),
+ SH_PFC_PIN_GROUP(msiof0_tx),
++ SH_PFC_PIN_GROUP(msiof0_clk_b),
++ SH_PFC_PIN_GROUP(msiof0_ss1_b),
++ SH_PFC_PIN_GROUP(msiof0_ss2_b),
++ SH_PFC_PIN_GROUP(msiof0_rx_b),
++ SH_PFC_PIN_GROUP(msiof0_tx_b),
+ SH_PFC_PIN_GROUP(msiof1_clk),
+ SH_PFC_PIN_GROUP(msiof1_sync),
+ SH_PFC_PIN_GROUP(msiof1_ss1),
+ SH_PFC_PIN_GROUP(msiof1_ss2),
+ SH_PFC_PIN_GROUP(msiof1_rx),
+ SH_PFC_PIN_GROUP(msiof1_tx),
++ SH_PFC_PIN_GROUP(msiof1_clk_b),
++ SH_PFC_PIN_GROUP(msiof1_ss1_b),
++ SH_PFC_PIN_GROUP(msiof1_ss2_b),
++ SH_PFC_PIN_GROUP(msiof1_rx_b),
++ SH_PFC_PIN_GROUP(msiof1_tx_b),
+ SH_PFC_PIN_GROUP(msiof2_clk),
+ SH_PFC_PIN_GROUP(msiof2_sync),
+ SH_PFC_PIN_GROUP(msiof2_ss1),
+@@ -3701,6 +3812,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(msiof3_ss2),
+ SH_PFC_PIN_GROUP(msiof3_rx),
+ SH_PFC_PIN_GROUP(msiof3_tx),
++ SH_PFC_PIN_GROUP(msiof3_clk_b),
++ SH_PFC_PIN_GROUP(msiof3_sync_b),
++ SH_PFC_PIN_GROUP(msiof3_rx_b),
++ SH_PFC_PIN_GROUP(msiof3_tx_b),
+ SH_PFC_PIN_GROUP(qspi_ctrl),
+ SH_PFC_PIN_GROUP(qspi_data2),
+ SH_PFC_PIN_GROUP(qspi_data4),
+@@ -3975,6 +4090,11 @@ static const char * const msiof0_groups[] = {
+ "msiof0_ss2",
+ "msiof0_rx",
+ "msiof0_tx",
++ "msiof0_clk_b",
++ "msiof0_ss1_b",
++ "msiof0_ss2_b",
++ "msiof0_rx_b",
++ "msiof0_tx_b",
+ };
+
+ static const char * const msiof1_groups[] = {
+@@ -3984,6 +4104,11 @@ static const char * const msiof1_groups[] = {
+ "msiof1_ss2",
+ "msiof1_rx",
+ "msiof1_tx",
++ "msiof1_clk_b",
++ "msiof1_ss1_b",
++ "msiof1_ss2_b",
++ "msiof1_rx_b",
++ "msiof1_tx_b",
+ };
+
+ static const char * const msiof2_groups[] = {
+@@ -4002,6 +4127,10 @@ static const char * const msiof3_groups[] = {
+ "msiof3_ss2",
+ "msiof3_rx",
+ "msiof3_tx",
++ "msiof3_clk_b",
++ "msiof3_sync_b",
++ "msiof3_rx_b",
++ "msiof3_tx_b",
+ };
+
+ static const char * const qspi_groups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0126-pinctrl-sh-pfc-r8a7791-Add-alternative-MSIOF-pin-gro.patch b/patches.renesas/0126-pinctrl-sh-pfc-r8a7791-Add-alternative-MSIOF-pin-gro.patch
new file mode 100644
index 00000000000000..d92132581d035a
--- /dev/null
+++ b/patches.renesas/0126-pinctrl-sh-pfc-r8a7791-Add-alternative-MSIOF-pin-gro.patch
@@ -0,0 +1,551 @@
+From 4252f641c9c171a53ec82511ce341eb54e17ddd4 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Wed, 26 Feb 2014 10:16:57 +0100
+Subject: pinctrl: sh-pfc: r8a7791: Add alternative MSIOF pin groups
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit e6fae2d03dc4f9172db88ad18a577c2a45b9e8ac)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 469 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 469 insertions(+)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+index 461e91096845..5186d70c49d4 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+@@ -2095,6 +2095,92 @@ static const unsigned int msiof0_tx_pins[] = {
+ static const unsigned int msiof0_tx_mux[] = {
+ MSIOF0_TXD_MARK,
+ };
++
++static const unsigned int msiof0_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(0, 16),
++};
++static const unsigned int msiof0_clk_b_mux[] = {
++ MSIOF0_SCK_B_MARK,
++};
++static const unsigned int msiof0_sync_b_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(0, 17),
++};
++static const unsigned int msiof0_sync_b_mux[] = {
++ MSIOF0_SYNC_B_MARK,
++};
++static const unsigned int msiof0_ss1_b_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(0, 18),
++};
++static const unsigned int msiof0_ss1_b_mux[] = {
++ MSIOF0_SS1_B_MARK,
++};
++static const unsigned int msiof0_ss2_b_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(0, 19),
++};
++static const unsigned int msiof0_ss2_b_mux[] = {
++ MSIOF0_SS2_B_MARK,
++};
++static const unsigned int msiof0_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(0, 21),
++};
++static const unsigned int msiof0_rx_b_mux[] = {
++ MSIOF0_RXD_B_MARK,
++};
++static const unsigned int msiof0_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(0, 20),
++};
++static const unsigned int msiof0_tx_b_mux[] = {
++ MSIOF0_TXD_B_MARK,
++};
++
++static const unsigned int msiof0_clk_c_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(5, 26),
++};
++static const unsigned int msiof0_clk_c_mux[] = {
++ MSIOF0_SCK_C_MARK,
++};
++static const unsigned int msiof0_sync_c_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(5, 25),
++};
++static const unsigned int msiof0_sync_c_mux[] = {
++ MSIOF0_SYNC_C_MARK,
++};
++static const unsigned int msiof0_ss1_c_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(5, 27),
++};
++static const unsigned int msiof0_ss1_c_mux[] = {
++ MSIOF0_SS1_C_MARK,
++};
++static const unsigned int msiof0_ss2_c_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(5, 28),
++};
++static const unsigned int msiof0_ss2_c_mux[] = {
++ MSIOF0_SS2_C_MARK,
++};
++static const unsigned int msiof0_rx_c_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(5, 29),
++};
++static const unsigned int msiof0_rx_c_mux[] = {
++ MSIOF0_RXD_C_MARK,
++};
++static const unsigned int msiof0_tx_c_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(5, 30),
++};
++static const unsigned int msiof0_tx_c_mux[] = {
++ MSIOF0_TXD_C_MARK,
++};
+ /* - MSIOF1 ----------------------------------------------------------------- */
+ static const unsigned int msiof1_clk_pins[] = {
+ /* SCK */
+@@ -2138,6 +2224,143 @@ static const unsigned int msiof1_tx_pins[] = {
+ static const unsigned int msiof1_tx_mux[] = {
+ MSIOF1_TXD_MARK,
+ };
++
++static const unsigned int msiof1_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(2, 29),
++};
++static const unsigned int msiof1_clk_b_mux[] = {
++ MSIOF1_SCK_B_MARK,
++};
++static const unsigned int msiof1_sync_b_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(2, 30),
++};
++static const unsigned int msiof1_sync_b_mux[] = {
++ MSIOF1_SYNC_B_MARK,
++};
++static const unsigned int msiof1_ss1_b_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(2, 31),
++};
++static const unsigned int msiof1_ss1_b_mux[] = {
++ MSIOF1_SS1_B_MARK,
++};
++static const unsigned int msiof1_ss2_b_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(7, 16),
++};
++static const unsigned int msiof1_ss2_b_mux[] = {
++ MSIOF1_SS2_B_MARK,
++};
++static const unsigned int msiof1_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(7, 18),
++};
++static const unsigned int msiof1_rx_b_mux[] = {
++ MSIOF1_RXD_B_MARK,
++};
++static const unsigned int msiof1_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(7, 17),
++};
++static const unsigned int msiof1_tx_b_mux[] = {
++ MSIOF1_TXD_B_MARK,
++};
++
++static const unsigned int msiof1_clk_c_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(2, 15),
++};
++static const unsigned int msiof1_clk_c_mux[] = {
++ MSIOF1_SCK_C_MARK,
++};
++static const unsigned int msiof1_sync_c_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(2, 16),
++};
++static const unsigned int msiof1_sync_c_mux[] = {
++ MSIOF1_SYNC_C_MARK,
++};
++static const unsigned int msiof1_rx_c_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(2, 18),
++};
++static const unsigned int msiof1_rx_c_mux[] = {
++ MSIOF1_RXD_C_MARK,
++};
++static const unsigned int msiof1_tx_c_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(2, 17),
++};
++static const unsigned int msiof1_tx_c_mux[] = {
++ MSIOF1_TXD_C_MARK,
++};
++
++static const unsigned int msiof1_clk_d_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(0, 28),
++};
++static const unsigned int msiof1_clk_d_mux[] = {
++ MSIOF1_SCK_D_MARK,
++};
++static const unsigned int msiof1_sync_d_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(0, 30),
++};
++static const unsigned int msiof1_sync_d_mux[] = {
++ MSIOF1_SYNC_D_MARK,
++};
++static const unsigned int msiof1_ss1_d_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(0, 29),
++};
++static const unsigned int msiof1_ss1_d_mux[] = {
++ MSIOF1_SS1_D_MARK,
++};
++static const unsigned int msiof1_rx_d_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(0, 27),
++};
++static const unsigned int msiof1_rx_d_mux[] = {
++ MSIOF1_RXD_D_MARK,
++};
++static const unsigned int msiof1_tx_d_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(0, 26),
++};
++static const unsigned int msiof1_tx_d_mux[] = {
++ MSIOF1_TXD_D_MARK,
++};
++
++static const unsigned int msiof1_clk_e_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(5, 18),
++};
++static const unsigned int msiof1_clk_e_mux[] = {
++ MSIOF1_SCK_E_MARK,
++};
++static const unsigned int msiof1_sync_e_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(5, 19),
++};
++static const unsigned int msiof1_sync_e_mux[] = {
++ MSIOF1_SYNC_E_MARK,
++};
++static const unsigned int msiof1_rx_e_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(5, 17),
++};
++static const unsigned int msiof1_rx_e_mux[] = {
++ MSIOF1_RXD_E_MARK,
++};
++static const unsigned int msiof1_tx_e_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(5, 20),
++};
++static const unsigned int msiof1_tx_e_mux[] = {
++ MSIOF1_TXD_E_MARK,
++};
+ /* - MSIOF2 ----------------------------------------------------------------- */
+ static const unsigned int msiof2_clk_pins[] = {
+ /* SCK */
+@@ -2181,6 +2404,150 @@ static const unsigned int msiof2_tx_pins[] = {
+ static const unsigned int msiof2_tx_mux[] = {
+ MSIOF2_TXD_MARK,
+ };
++
++static const unsigned int msiof2_clk_b_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(3, 0),
++};
++static const unsigned int msiof2_clk_b_mux[] = {
++ MSIOF2_SCK_B_MARK,
++};
++static const unsigned int msiof2_sync_b_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(3, 1),
++};
++static const unsigned int msiof2_sync_b_mux[] = {
++ MSIOF2_SYNC_B_MARK,
++};
++static const unsigned int msiof2_ss1_b_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(3, 8),
++};
++static const unsigned int msiof2_ss1_b_mux[] = {
++ MSIOF2_SS1_B_MARK,
++};
++static const unsigned int msiof2_ss2_b_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(3, 9),
++};
++static const unsigned int msiof2_ss2_b_mux[] = {
++ MSIOF2_SS2_B_MARK,
++};
++static const unsigned int msiof2_rx_b_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(3, 17),
++};
++static const unsigned int msiof2_rx_b_mux[] = {
++ MSIOF2_RXD_B_MARK,
++};
++static const unsigned int msiof2_tx_b_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(3, 16),
++};
++static const unsigned int msiof2_tx_b_mux[] = {
++ MSIOF2_TXD_B_MARK,
++};
++
++static const unsigned int msiof2_clk_c_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(2, 2),
++};
++static const unsigned int msiof2_clk_c_mux[] = {
++ MSIOF2_SCK_C_MARK,
++};
++static const unsigned int msiof2_sync_c_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(2, 3),
++};
++static const unsigned int msiof2_sync_c_mux[] = {
++ MSIOF2_SYNC_C_MARK,
++};
++static const unsigned int msiof2_rx_c_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(2, 5),
++};
++static const unsigned int msiof2_rx_c_mux[] = {
++ MSIOF2_RXD_C_MARK,
++};
++static const unsigned int msiof2_tx_c_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(2, 4),
++};
++static const unsigned int msiof2_tx_c_mux[] = {
++ MSIOF2_TXD_C_MARK,
++};
++
++static const unsigned int msiof2_clk_d_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(2, 14),
++};
++static const unsigned int msiof2_clk_d_mux[] = {
++ MSIOF2_SCK_D_MARK,
++};
++static const unsigned int msiof2_sync_d_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(2, 15),
++};
++static const unsigned int msiof2_sync_d_mux[] = {
++ MSIOF2_SYNC_D_MARK,
++};
++static const unsigned int msiof2_ss1_d_pins[] = {
++ /* SS1 */
++ RCAR_GP_PIN(2, 17),
++};
++static const unsigned int msiof2_ss1_d_mux[] = {
++ MSIOF2_SS1_D_MARK,
++};
++static const unsigned int msiof2_ss2_d_pins[] = {
++ /* SS2 */
++ RCAR_GP_PIN(2, 19),
++};
++static const unsigned int msiof2_ss2_d_mux[] = {
++ MSIOF2_SS2_D_MARK,
++};
++static const unsigned int msiof2_rx_d_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(2, 18),
++};
++static const unsigned int msiof2_rx_d_mux[] = {
++ MSIOF2_RXD_D_MARK,
++};
++static const unsigned int msiof2_tx_d_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(2, 16),
++};
++static const unsigned int msiof2_tx_d_mux[] = {
++ MSIOF2_TXD_D_MARK,
++};
++
++static const unsigned int msiof2_clk_e_pins[] = {
++ /* SCK */
++ RCAR_GP_PIN(7, 15),
++};
++static const unsigned int msiof2_clk_e_mux[] = {
++ MSIOF2_SCK_E_MARK,
++};
++static const unsigned int msiof2_sync_e_pins[] = {
++ /* SYNC */
++ RCAR_GP_PIN(7, 16),
++};
++static const unsigned int msiof2_sync_e_mux[] = {
++ MSIOF2_SYNC_E_MARK,
++};
++static const unsigned int msiof2_rx_e_pins[] = {
++ /* RXD */
++ RCAR_GP_PIN(7, 14),
++};
++static const unsigned int msiof2_rx_e_mux[] = {
++ MSIOF2_RXD_E_MARK,
++};
++static const unsigned int msiof2_tx_e_pins[] = {
++ /* TXD */
++ RCAR_GP_PIN(7, 13),
++};
++static const unsigned int msiof2_tx_e_mux[] = {
++ MSIOF2_TXD_E_MARK,
++};
+ /* - QSPI ------------------------------------------------------------------- */
+ static const unsigned int qspi_ctrl_pins[] = {
+ /* SPCLK, SSL */
+@@ -3236,18 +3603,69 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(msiof0_ss2),
+ SH_PFC_PIN_GROUP(msiof0_rx),
+ SH_PFC_PIN_GROUP(msiof0_tx),
++ SH_PFC_PIN_GROUP(msiof0_clk_b),
++ SH_PFC_PIN_GROUP(msiof0_sync_b),
++ SH_PFC_PIN_GROUP(msiof0_ss1_b),
++ SH_PFC_PIN_GROUP(msiof0_ss2_b),
++ SH_PFC_PIN_GROUP(msiof0_rx_b),
++ SH_PFC_PIN_GROUP(msiof0_tx_b),
++ SH_PFC_PIN_GROUP(msiof0_clk_c),
++ SH_PFC_PIN_GROUP(msiof0_sync_c),
++ SH_PFC_PIN_GROUP(msiof0_ss1_c),
++ SH_PFC_PIN_GROUP(msiof0_ss2_c),
++ SH_PFC_PIN_GROUP(msiof0_rx_c),
++ SH_PFC_PIN_GROUP(msiof0_tx_c),
+ SH_PFC_PIN_GROUP(msiof1_clk),
+ SH_PFC_PIN_GROUP(msiof1_sync),
+ SH_PFC_PIN_GROUP(msiof1_ss1),
+ SH_PFC_PIN_GROUP(msiof1_ss2),
+ SH_PFC_PIN_GROUP(msiof1_rx),
+ SH_PFC_PIN_GROUP(msiof1_tx),
++ SH_PFC_PIN_GROUP(msiof1_clk_b),
++ SH_PFC_PIN_GROUP(msiof1_sync_b),
++ SH_PFC_PIN_GROUP(msiof1_ss1_b),
++ SH_PFC_PIN_GROUP(msiof1_ss2_b),
++ SH_PFC_PIN_GROUP(msiof1_rx_b),
++ SH_PFC_PIN_GROUP(msiof1_tx_b),
++ SH_PFC_PIN_GROUP(msiof1_clk_c),
++ SH_PFC_PIN_GROUP(msiof1_sync_c),
++ SH_PFC_PIN_GROUP(msiof1_rx_c),
++ SH_PFC_PIN_GROUP(msiof1_tx_c),
++ SH_PFC_PIN_GROUP(msiof1_clk_d),
++ SH_PFC_PIN_GROUP(msiof1_sync_d),
++ SH_PFC_PIN_GROUP(msiof1_ss1_d),
++ SH_PFC_PIN_GROUP(msiof1_rx_d),
++ SH_PFC_PIN_GROUP(msiof1_tx_d),
++ SH_PFC_PIN_GROUP(msiof1_clk_e),
++ SH_PFC_PIN_GROUP(msiof1_sync_e),
++ SH_PFC_PIN_GROUP(msiof1_rx_e),
++ SH_PFC_PIN_GROUP(msiof1_tx_e),
+ SH_PFC_PIN_GROUP(msiof2_clk),
+ SH_PFC_PIN_GROUP(msiof2_sync),
+ SH_PFC_PIN_GROUP(msiof2_ss1),
+ SH_PFC_PIN_GROUP(msiof2_ss2),
+ SH_PFC_PIN_GROUP(msiof2_rx),
+ SH_PFC_PIN_GROUP(msiof2_tx),
++ SH_PFC_PIN_GROUP(msiof2_clk_b),
++ SH_PFC_PIN_GROUP(msiof2_sync_b),
++ SH_PFC_PIN_GROUP(msiof2_ss1_b),
++ SH_PFC_PIN_GROUP(msiof2_ss2_b),
++ SH_PFC_PIN_GROUP(msiof2_rx_b),
++ SH_PFC_PIN_GROUP(msiof2_tx_b),
++ SH_PFC_PIN_GROUP(msiof2_clk_c),
++ SH_PFC_PIN_GROUP(msiof2_sync_c),
++ SH_PFC_PIN_GROUP(msiof2_rx_c),
++ SH_PFC_PIN_GROUP(msiof2_tx_c),
++ SH_PFC_PIN_GROUP(msiof2_clk_d),
++ SH_PFC_PIN_GROUP(msiof2_sync_d),
++ SH_PFC_PIN_GROUP(msiof2_ss1_d),
++ SH_PFC_PIN_GROUP(msiof2_ss2_d),
++ SH_PFC_PIN_GROUP(msiof2_rx_d),
++ SH_PFC_PIN_GROUP(msiof2_tx_d),
++ SH_PFC_PIN_GROUP(msiof2_clk_e),
++ SH_PFC_PIN_GROUP(msiof2_sync_e),
++ SH_PFC_PIN_GROUP(msiof2_rx_e),
++ SH_PFC_PIN_GROUP(msiof2_tx_e),
+ SH_PFC_PIN_GROUP(qspi_ctrl),
+ SH_PFC_PIN_GROUP(qspi_data2),
+ SH_PFC_PIN_GROUP(qspi_data4),
+@@ -3473,6 +3891,18 @@ static const char * const msiof0_groups[] = {
+ "msiof0_ss2",
+ "msiof0_rx",
+ "msiof0_tx",
++ "msiof0_clk_b",
++ "msiof0_sync_b",
++ "msiof0_ss1_b",
++ "msiof0_ss2_b",
++ "msiof0_rx_b",
++ "msiof0_tx_b",
++ "msiof0_clk_c",
++ "msiof0_sync_c",
++ "msiof0_ss1_c",
++ "msiof0_ss2_c",
++ "msiof0_rx_c",
++ "msiof0_tx_c",
+ };
+
+ static const char * const msiof1_groups[] = {
+@@ -3482,6 +3912,25 @@ static const char * const msiof1_groups[] = {
+ "msiof1_ss2",
+ "msiof1_rx",
+ "msiof1_tx",
++ "msiof1_clk_b",
++ "msiof1_sync_b",
++ "msiof1_ss1_b",
++ "msiof1_ss2_b",
++ "msiof1_rx_b",
++ "msiof1_tx_b",
++ "msiof1_clk_c",
++ "msiof1_sync_c",
++ "msiof1_rx_c",
++ "msiof1_tx_c",
++ "msiof1_clk_d",
++ "msiof1_sync_d",
++ "msiof1_ss1_d",
++ "msiof1_rx_d",
++ "msiof1_tx_d",
++ "msiof1_clk_e",
++ "msiof1_sync_e",
++ "msiof1_rx_e",
++ "msiof1_tx_e",
+ };
+
+ static const char * const msiof2_groups[] = {
+@@ -3491,6 +3940,26 @@ static const char * const msiof2_groups[] = {
+ "msiof2_ss2",
+ "msiof2_rx",
+ "msiof2_tx",
++ "msiof2_clk_b",
++ "msiof2_sync_b",
++ "msiof2_ss1_b",
++ "msiof2_ss2_b",
++ "msiof2_rx_b",
++ "msiof2_tx_b",
++ "msiof2_clk_c",
++ "msiof2_sync_c",
++ "msiof2_rx_c",
++ "msiof2_tx_c",
++ "msiof2_clk_d",
++ "msiof2_sync_d",
++ "msiof2_ss1_d",
++ "msiof2_ss2_d",
++ "msiof2_rx_d",
++ "msiof2_tx_d",
++ "msiof2_clk_e",
++ "msiof2_sync_e",
++ "msiof2_rx_e",
++ "msiof2_tx_e",
+ };
+
+ static const char * const qspi_groups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0127-sh-pfc-r8a7790-Fix-definition-of-IPSR5.patch b/patches.renesas/0127-sh-pfc-r8a7790-Fix-definition-of-IPSR5.patch
new file mode 100644
index 00000000000000..bc92fe48c6aea9
--- /dev/null
+++ b/patches.renesas/0127-sh-pfc-r8a7790-Fix-definition-of-IPSR5.patch
@@ -0,0 +1,34 @@
+From 1d1494a483e9b3aa65b6fa56561770c16f39c88f Mon Sep 17 00:00:00 2001
+From: Guido Piasenza <gpiasenza@soft-in.com>
+Date: Tue, 22 Apr 2014 16:28:03 +0100
+Subject: sh-pfc: r8a7790: Fix definition of IPSR5
+
+The extra entry in the table makes SCIFA0_B, and all
+peripherals after it, fail.
+
+Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 34ce57e9df7d14b52c7613bb2c190e411ca99186)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+index 48093719167a..f5cd3f961808 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
+@@ -4794,8 +4794,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+ FN_MSIOF0_SCK_B, 0,
+ /* IP5_23_21 [3] */
+ FN_WE1_N, FN_IERX, FN_CAN1_RX, FN_VI1_G4,
+- FN_VI1_G4_B, FN_VI2_R6, FN_SCIFA0_CTS_N_B,
+- FN_IERX_C, 0,
++ FN_VI1_G4_B, FN_VI2_R6, FN_SCIFA0_CTS_N_B, FN_IERX_C,
+ /* IP5_20_18 [3] */
+ FN_WE0_N, FN_IECLK, FN_CAN_CLK,
+ FN_VI2_VSYNC_N, FN_SCIFA0_TXD_B, FN_VI2_VSYNC_N_B, 0, 0,
+--
+2.1.2
+
diff --git a/patches.renesas/0128-sh-pfc-r8a7791-Fix-definition-of-MOD_SEL3.patch b/patches.renesas/0128-sh-pfc-r8a7791-Fix-definition-of-MOD_SEL3.patch
new file mode 100644
index 00000000000000..a6785cc9b72522
--- /dev/null
+++ b/patches.renesas/0128-sh-pfc-r8a7791-Fix-definition-of-MOD_SEL3.patch
@@ -0,0 +1,32 @@
+From 80fcbac45afe7d8788c01697a5b1214005afc335 Mon Sep 17 00:00:00 2001
+From: Phil Edworthy <phil.edworthy@renesas.com>
+Date: Tue, 22 Apr 2014 17:38:05 +0100
+Subject: sh-pfc: r8a7791: Fix definition of MOD_SEL3
+
+There is a missing 0 entry from the MOD_SEL3 table.
+
+Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 0c66c5628bbb5e96360032440f53a6cb6f8973d0)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+index 5186d70c49d4..7868bf3a0f91 100644
+--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
++++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+@@ -5288,7 +5288,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+ /* SEL_SCIF3 [2] */
+ FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, FN_SEL_SCIF3_3,
+ /* SEL_IEB [2] */
+- FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2,
++ FN_SEL_IEB_0, FN_SEL_IEB_1, FN_SEL_IEB_2, 0,
+ /* SEL_MMC [1] */
+ FN_SEL_MMC_0, FN_SEL_MMC_1,
+ /* SEL_SCIF5 [1] */
+--
+2.1.2
+
diff --git a/patches.renesas/0129-serial-sh-sci-Fix-cast-warning.patch b/patches.renesas/0129-serial-sh-sci-Fix-cast-warning.patch
new file mode 100644
index 00000000000000..9dc8cd5fecd4e0
--- /dev/null
+++ b/patches.renesas/0129-serial-sh-sci-Fix-cast-warning.patch
@@ -0,0 +1,35 @@
+From 33c5f10c486ddf82497c27f52da7985537e00ee1 Mon Sep 17 00:00:00 2001
+From: Jingoo Han <jg1.han@samsung.com>
+Date: Wed, 5 Feb 2014 09:56:37 +0900
+Subject: serial: sh-sci: Fix cast warning
+
+Fix the following compile warning about cast to pointer from
+integer of different size.
+
+drivers/tty/serial/sh-sci.c:2021:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+
+Signed-off-by: Jingoo Han <jg1.han@samsung.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 3af4e960b8a12b3f07033f1c12504305e6d4df1a)
+Signed-off-by: Simon Horman <horms+renesas@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 be33d2b0613b..1668523d31fb 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -2018,7 +2018,7 @@ static int sci_remap_port(struct uart_port *port)
+ * need to do any remapping, just cast the cookie
+ * directly.
+ */
+- port->membase = (void __iomem *)port->mapbase;
++ port->membase = (void __iomem *)(uintptr_t)port->mapbase;
+ }
+
+ return 0;
+--
+2.1.2
+
diff --git a/patches.renesas/0130-serial-sh-sci-Fix-compatible-string-in-DT-bindings-e.patch b/patches.renesas/0130-serial-sh-sci-Fix-compatible-string-in-DT-bindings-e.patch
new file mode 100644
index 00000000000000..05cc62cfd0fdae
--- /dev/null
+++ b/patches.renesas/0130-serial-sh-sci-Fix-compatible-string-in-DT-bindings-e.patch
@@ -0,0 +1,34 @@
+From 884ca34025033d8e8d336528af65828056d074eb Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 6 Feb 2014 15:47:40 +0900
+Subject: serial: sh-sci: Fix compatible string in DT bindings example
+
+Remove the -generic suffix from the compatible string in the serial port
+DT bindings example.
+
+Cc: devicetree@vger.kernel.org
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 25eb50b97b61a237168137411550aa792bb27c00)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/serial/renesas,sci-serial.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
+index f372cf29068d..53e6c175db6c 100644
+--- a/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
++++ b/Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
+@@ -37,7 +37,7 @@ Example:
+ };
+
+ scifa0: serial@e6c40000 {
+- compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
+--
+2.1.2
+
diff --git a/patches.renesas/0131-serial-sh-sci-Add-missing-call-to-uart_remove_one_po.patch b/patches.renesas/0131-serial-sh-sci-Add-missing-call-to-uart_remove_one_po.patch
new file mode 100644
index 00000000000000..3ba1a33f689d24
--- /dev/null
+++ b/patches.renesas/0131-serial-sh-sci-Add-missing-call-to-uart_remove_one_po.patch
@@ -0,0 +1,39 @@
+From 2dc17f253c2627524da362ba6824f5098d76687d Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 28 Feb 2014 14:21:33 +0100
+Subject: serial: sh-sci: Add missing call to uart_remove_one_port() in failure
+ path
+
+If cpufreq_register_notifier() fails, we have to remove the port added by
+sci_probe_single(), which is not done by sci_cleanup_single().
+
+Else the serial port stays active from the point of view of the serial
+subsystem, and it may crash when userspace getty is started, or when the
+loadable driver module is unloaded.
+
+This was introduced by commit 6dae14216c85eea13db7b12c469475c5d30e5499
+("serial: sh-sci: Fix probe error paths").
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit bf13c9a894162a91c8bb7d9555933e9fc3ff7d0e)
+Signed-off-by: Simon Horman <horms+renesas@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 1668523d31fb..0cb52376f97d 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -2564,6 +2564,7 @@ static int sci_probe(struct platform_device *dev)
+ ret = cpufreq_register_notifier(&sp->freq_transition,
+ CPUFREQ_TRANSITION_NOTIFIER);
+ if (unlikely(ret < 0)) {
++ uart_remove_one_port(&sci_uart_driver, &sp->port);
+ sci_cleanup_single(sp);
+ return ret;
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0132-serial-sh-sci-Replace-printk-by-pr_.patch b/patches.renesas/0132-serial-sh-sci-Replace-printk-by-pr_.patch
new file mode 100644
index 00000000000000..7be75b360f4fe1
--- /dev/null
+++ b/patches.renesas/0132-serial-sh-sci-Replace-printk-by-pr_.patch
@@ -0,0 +1,52 @@
+From 8a9fcc46f87a1b0d310bbbbdc5dd19c537997ec9 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 11:11:17 +0100
+Subject: serial: sh-sci: Replace printk() by pr_*()
+
+Make banner const while we're at it
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Simon Horman <horms@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 6c13d5d27c5ecd7a2ce7c104c7726b0d7aa7d7b5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/tty/serial/sh-sci.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index 0cb52376f97d..60a8f7db2948 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -428,7 +428,7 @@ static int sci_probe_regmap(struct plat_sci_port *cfg)
+ cfg->regtype = SCIx_HSCIF_REGTYPE;
+ break;
+ default:
+- printk(KERN_ERR "Can't probe register map for given port\n");
++ pr_err("Can't probe register map for given port\n");
+ return -EINVAL;
+ }
+
+@@ -2389,8 +2389,7 @@ static inline int sci_probe_earlyprintk(struct platform_device *pdev)
+
+ #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */
+
+-static char banner[] __initdata =
+- KERN_INFO "SuperH (H)SCI(F) driver initialized\n";
++static const char banner[] __initconst = "SuperH (H)SCI(F) driver initialized";
+
+ static struct uart_driver sci_uart_driver = {
+ .owner = THIS_MODULE,
+@@ -2616,7 +2615,7 @@ static int __init sci_init(void)
+ {
+ int ret;
+
+- printk(banner);
++ pr_info("%s\n", banner);
+
+ ret = uart_register_driver(&sci_uart_driver);
+ if (likely(ret == 0)) {
+--
+2.1.2
+
diff --git a/patches.renesas/0133-serial-sh-sci-Remove-useless-casts.patch b/patches.renesas/0133-serial-sh-sci-Remove-useless-casts.patch
new file mode 100644
index 00000000000000..975e74ff85d031
--- /dev/null
+++ b/patches.renesas/0133-serial-sh-sci-Remove-useless-casts.patch
@@ -0,0 +1,52 @@
+From 6228c70afc56c58203fcbaa93f475504ede42694 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 11:11:18 +0100
+Subject: serial: sh-sci: Remove useless casts
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Simon Horman <horms@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit ff43da00e0d407cd8e7faaf2ac150001d29827e4)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/tty/serial/sh-sci.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index 60a8f7db2948..c93154f690a6 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -2423,25 +2423,25 @@ struct sci_port_info {
+ static const struct of_device_id of_sci_match[] = {
+ {
+ .compatible = "renesas,scif",
+- .data = (void *)&(const struct sci_port_info) {
++ .data = &(const struct sci_port_info) {
+ .type = PORT_SCIF,
+ .regtype = SCIx_SH4_SCIF_REGTYPE,
+ },
+ }, {
+ .compatible = "renesas,scifa",
+- .data = (void *)&(const struct sci_port_info) {
++ .data = &(const struct sci_port_info) {
+ .type = PORT_SCIFA,
+ .regtype = SCIx_SCIFA_REGTYPE,
+ },
+ }, {
+ .compatible = "renesas,scifb",
+- .data = (void *)&(const struct sci_port_info) {
++ .data = &(const struct sci_port_info) {
+ .type = PORT_SCIFB,
+ .regtype = SCIx_SCIFB_REGTYPE,
+ },
+ }, {
+ .compatible = "renesas,hscif",
+- .data = (void *)&(const struct sci_port_info) {
++ .data = &(const struct sci_port_info) {
+ .type = PORT_HSCIF,
+ .regtype = SCIx_HSCIF_REGTYPE,
+ },
+--
+2.1.2
+
diff --git a/patches.renesas/0134-serial-sh-sci-Add-more-register-documentation.patch b/patches.renesas/0134-serial-sh-sci-Add-more-register-documentation.patch
new file mode 100644
index 00000000000000..d9345bdd835119
--- /dev/null
+++ b/patches.renesas/0134-serial-sh-sci-Add-more-register-documentation.patch
@@ -0,0 +1,237 @@
+From 765cc0c7db581b63c92fb06fd463f929c404e177 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 11:11:19 +0100
+Subject: serial: sh-sci: Add more register documentation
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Simon Horman <horms@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 26de4f1b2fb45e53a9e8f4f913b9cdf6c294070b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/tty/serial/sh-sci.c | 28 +++++++-------
+ include/linux/serial_sci.h | 93 ++++++++++++++++++++++++++++-----------------
+ 2 files changed, 73 insertions(+), 48 deletions(-)
+
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index c93154f690a6..22a508a638b9 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -911,7 +911,7 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr)
+ /* Disable future Rx interrupts */
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
+ disable_irq_nosync(irq);
+- scr |= 0x4000;
++ scr |= SCSCR_RDRQE;
+ } else {
+ scr &= ~SCSCR_RIE;
+ }
+@@ -1200,7 +1200,9 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl)
+ */
+ reg = sci_getreg(port, SCFCR);
+ if (reg->size)
+- serial_port_out(port, SCFCR, serial_port_in(port, SCFCR) | 1);
++ serial_port_out(port, SCFCR,
++ serial_port_in(port, SCFCR) |
++ SCFCR_LOOP);
+ }
+ }
+
+@@ -1496,9 +1498,9 @@ static void sci_start_tx(struct uart_port *port)
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
+ u16 new, scr = serial_port_in(port, SCSCR);
+ if (s->chan_tx)
+- new = scr | 0x8000;
++ new = scr | SCSCR_TDRQE;
+ else
+- new = scr & ~0x8000;
++ new = scr & ~SCSCR_TDRQE;
+ if (new != scr)
+ serial_port_out(port, SCSCR, new);
+ }
+@@ -1525,7 +1527,7 @@ static void sci_stop_tx(struct uart_port *port)
+ ctrl = serial_port_in(port, SCSCR);
+
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
+- ctrl &= ~0x8000;
++ ctrl &= ~SCSCR_TDRQE;
+
+ ctrl &= ~SCSCR_TIE;
+
+@@ -1539,7 +1541,7 @@ static void sci_start_rx(struct uart_port *port)
+ ctrl = serial_port_in(port, SCSCR) | port_rx_irq_mask(port);
+
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
+- ctrl &= ~0x4000;
++ ctrl &= ~SCSCR_RDRQE;
+
+ serial_port_out(port, SCSCR, ctrl);
+ }
+@@ -1551,7 +1553,7 @@ static void sci_stop_rx(struct uart_port *port)
+ ctrl = serial_port_in(port, SCSCR);
+
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
+- ctrl &= ~0x4000;
++ ctrl &= ~SCSCR_RDRQE;
+
+ ctrl &= ~port_rx_irq_mask(port);
+
+@@ -1614,7 +1616,7 @@ static void rx_timer_fn(unsigned long arg)
+ u16 scr = serial_port_in(port, SCSCR);
+
+ if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) {
+- scr &= ~0x4000;
++ scr &= ~SCSCR_RDRQE;
+ enable_irq(s->irqs[SCIx_RXI_IRQ]);
+ }
+ serial_port_out(port, SCSCR, scr | SCSCR_RIE);
+@@ -1871,13 +1873,13 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
+ smr_val = serial_port_in(port, SCSMR) & 3;
+
+ if ((termios->c_cflag & CSIZE) == CS7)
+- smr_val |= 0x40;
++ smr_val |= SCSMR_CHR;
+ if (termios->c_cflag & PARENB)
+- smr_val |= 0x20;
++ smr_val |= SCSMR_PE;
+ if (termios->c_cflag & PARODD)
+- smr_val |= 0x30;
++ smr_val |= SCSMR_PE | SCSMR_ODD;
+ if (termios->c_cflag & CSTOPB)
+- smr_val |= 0x08;
++ smr_val |= SCSMR_STOP;
+
+ uart_update_timeout(port, termios->c_cflag, baud);
+
+@@ -1885,7 +1887,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
+ __func__, smr_val, cks, t, s->cfg->scscr);
+
+ if (t >= 0) {
+- serial_port_out(port, SCSMR, (smr_val & ~3) | cks);
++ serial_port_out(port, SCSMR, (smr_val & ~SCSMR_CKS) | cks);
+ serial_port_out(port, SCBRR, t);
+ reg = sci_getreg(port, HSSRR);
+ if (reg->size)
+diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
+index 22b3640c9424..6c5e3bb282b0 100644
+--- a/include/linux/serial_sci.h
++++ b/include/linux/serial_sci.h
+@@ -10,45 +10,59 @@
+
+ #define SCIx_NOT_SUPPORTED (-1)
+
+-#define SCSCR_TIE (1 << 7)
+-#define SCSCR_RIE (1 << 6)
+-#define SCSCR_TE (1 << 5)
+-#define SCSCR_RE (1 << 4)
+-#define SCSCR_REIE (1 << 3) /* not supported by all parts */
+-#define SCSCR_TOIE (1 << 2) /* not supported by all parts */
+-#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
++/* SCSMR (Serial Mode Register) */
++#define SCSMR_CHR (1 << 6) /* 7-bit Character Length */
++#define SCSMR_PE (1 << 5) /* Parity Enable */
++#define SCSMR_ODD (1 << 4) /* Odd Parity */
++#define SCSMR_STOP (1 << 3) /* Stop Bit Length */
++#define SCSMR_CKS 0x0003 /* Clock Select */
++
++/* Serial Control Register (@ = not supported by all parts) */
++#define SCSCR_TIE (1 << 7) /* Transmit Interrupt Enable */
++#define SCSCR_RIE (1 << 6) /* Receive Interrupt Enable */
++#define SCSCR_TE (1 << 5) /* Transmit Enable */
++#define SCSCR_RE (1 << 4) /* Receive Enable */
++#define SCSCR_REIE (1 << 3) /* Receive Error Interrupt Enable @ */
++#define SCSCR_TOIE (1 << 2) /* Timeout Interrupt Enable @ */
++#define SCSCR_CKE1 (1 << 1) /* Clock Enable 1 */
++#define SCSCR_CKE0 (1 << 0) /* Clock Enable 0 */
++/* SCIFA/SCIFB only */
++#define SCSCR_TDRQE (1 << 15) /* Tx Data Transfer Request Enable */
++#define SCSCR_RDRQE (1 << 14) /* Rx Data Transfer Request Enable */
++
++/* SCxSR (Serial Status Register) on SCI */
++#define SCI_TDRE 0x80 /* Transmit Data Register Empty */
++#define SCI_RDRF 0x40 /* Receive Data Register Full */
++#define SCI_ORER 0x20 /* Overrun Error */
++#define SCI_FER 0x10 /* Framing Error */
++#define SCI_PER 0x08 /* Parity Error */
++#define SCI_TEND 0x04 /* Transmit End */
+
+ #define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
+
+-/* SCxSR SCIF, HSCIF */
+-#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
++/* SCxSR (Serial Status Register) on SCIF, HSCIF */
++#define SCIF_ER 0x0080 /* Receive Error */
++#define SCIF_TEND 0x0040 /* Transmission End */
++#define SCIF_TDFE 0x0020 /* Transmit FIFO Data Empty */
++#define SCIF_BRK 0x0010 /* Break Detect */
++#define SCIF_FER 0x0008 /* Framing Error */
++#define SCIF_PER 0x0004 /* Parity Error */
++#define SCIF_RDF 0x0002 /* Receive FIFO Data Full */
++#define SCIF_DR 0x0001 /* Receive Data Ready */
+
+ #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)
+-#define SCSPTR_SPB2IO (1 << 1)
+-#define SCSPTR_SPB2DT (1 << 0)
++/* SCFCR (FIFO Control Register) */
++#define SCFCR_LOOP (1 << 0) /* Loopback Test */
++
++/* SCSPTR (Serial Port Register), optional */
++#define SCSPTR_RTSIO (1 << 7) /* Serial Port RTS Pin Input/Output */
++#define SCSPTR_CTSIO (1 << 5) /* Serial Port CTS Pin Input/Output */
++#define SCSPTR_SPB2IO (1 << 1) /* Serial Port Break Input/Output */
++#define SCSPTR_SPB2DT (1 << 0) /* Serial Port Break Data */
+
+ /* HSSRR HSCIF */
+-#define HSCIF_SRE 0x8000
++#define HSCIF_SRE 0x8000 /* Sampling Rate Register Enable */
+
+ enum {
+ SCIx_PROBE_REGTYPE,
+@@ -73,10 +87,19 @@ enum {
+ * Not all registers will exist on all parts.
+ */
+ enum {
+- SCSMR, SCBRR, SCSCR, SCxSR,
+- SCFCR, SCFDR, SCxTDR, SCxRDR,
+- SCLSR, SCTFDR, SCRFDR, SCSPTR,
+- HSSRR,
++ SCSMR, /* Serial Mode Register */
++ SCBRR, /* Bit Rate Register */
++ SCSCR, /* Serial Control Register */
++ SCxSR, /* Serial Status Register */
++ SCFCR, /* FIFO Control Register */
++ SCFDR, /* FIFO Data Count Register */
++ SCxTDR, /* Transmit (FIFO) Data Register */
++ SCxRDR, /* Receive (FIFO) Data Register */
++ SCLSR, /* Line Status Register */
++ SCTFDR, /* Transmit FIFO Data Count Register */
++ SCRFDR, /* Receive FIFO Data Count Register */
++ SCSPTR, /* Serial Port Register */
++ HSSRR, /* Sampling Rate Register */
+
+ SCIx_NR_REGS,
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0135-serial-sh-sci-Replace-hardcoded-3-by-UART_PM_STATE_O.patch b/patches.renesas/0135-serial-sh-sci-Replace-hardcoded-3-by-UART_PM_STATE_O.patch
new file mode 100644
index 00000000000000..77b118d93580d3
--- /dev/null
+++ b/patches.renesas/0135-serial-sh-sci-Replace-hardcoded-3-by-UART_PM_STATE_O.patch
@@ -0,0 +1,31 @@
+From ddc5c39453a1ed61441bb19b59fe15dec6ed35e6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 11:11:20 +0100
+Subject: serial: sh-sci: Replace hardcoded 3 by UART_PM_STATE_OFF
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Simon Horman <horms@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit d3dfe5d9b4c8b3156b28f99f7a4a59ad8be09b15)
+Signed-off-by: Simon Horman <horms+renesas@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 22a508a638b9..634ecae2efd4 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -1955,7 +1955,7 @@ static void sci_pm(struct uart_port *port, unsigned int state,
+ struct sci_port *sci_port = to_sci_port(port);
+
+ switch (state) {
+- case 3:
++ case UART_PM_STATE_OFF:
+ sci_port_disable(sci_port);
+ break;
+ default:
+--
+2.1.2
+
diff --git a/patches.renesas/0136-serial-sh-sci-Neaten-dev_-level-uses.patch b/patches.renesas/0136-serial-sh-sci-Neaten-dev_-level-uses.patch
new file mode 100644
index 00000000000000..b7df895d34ef7d
--- /dev/null
+++ b/patches.renesas/0136-serial-sh-sci-Neaten-dev_-level-uses.patch
@@ -0,0 +1,141 @@
+From e4af69de04f1a47a3b8eb7915b950852e4f70417 Mon Sep 17 00:00:00 2001
+From: Joe Perches <joe@perches.com>
+Date: Tue, 11 Mar 2014 10:10:46 -0700
+Subject: serial: sh-sci: Neaten dev_<level> uses
+
+Add missing newlines and coalesce formats.
+Realign arguments.
+
+Signed-off-by: Joe Perches <joe@perches.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 9b971cd206c019fc6aeeb7e04136a49f9312df4a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/tty/serial/sh-sci.c | 38 ++++++++++++++++++--------------------
+ 1 file changed, 18 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index 634ecae2efd4..7ee5a79222ff 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -788,7 +788,7 @@ static int sci_handle_errors(struct uart_port *port)
+ if (tty_insert_flip_char(tport, 0, TTY_OVERRUN))
+ copied++;
+
+- dev_notice(port->dev, "overrun error");
++ dev_notice(port->dev, "overrun error\n");
+ }
+
+ if (status & SCxSR_FER(port)) {
+@@ -830,7 +830,7 @@ static int sci_handle_errors(struct uart_port *port)
+ if (tty_insert_flip_char(tport, 0, TTY_PARITY))
+ copied++;
+
+- dev_notice(port->dev, "parity error");
++ dev_notice(port->dev, "parity error\n");
+ }
+
+ if (copied)
+@@ -1292,7 +1292,8 @@ static void sci_dma_rx_complete(void *arg)
+ unsigned long flags;
+ int count;
+
+- dev_dbg(port->dev, "%s(%d) active #%d\n", __func__, port->line, s->active_rx);
++ dev_dbg(port->dev, "%s(%d) active #%d\n",
++ __func__, port->line, s->active_rx);
+
+ spin_lock_irqsave(&port->lock, flags);
+
+@@ -1368,8 +1369,8 @@ static void sci_submit_rx(struct sci_port *s)
+ sci_rx_dma_release(s, true);
+ return;
+ }
+- dev_dbg(s->port.dev, "%s(): cookie %d to #%d\n", __func__,
+- s->cookie_rx[i], i);
++ dev_dbg(s->port.dev, "%s(): cookie %d to #%d\n",
++ __func__, s->cookie_rx[i], i);
+ }
+
+ s->active_rx = s->cookie_rx[0];
+@@ -1428,8 +1429,8 @@ static void work_fn_rx(struct work_struct *work)
+
+ s->active_rx = s->cookie_rx[!new];
+
+- dev_dbg(port->dev, "%s: cookie %d #%d, new active #%d\n", __func__,
+- s->cookie_rx[new], new, s->active_rx);
++ dev_dbg(port->dev, "%s: cookie %d #%d, new active #%d\n",
++ __func__, s->cookie_rx[new], new, s->active_rx);
+ }
+
+ static void work_fn_tx(struct work_struct *work)
+@@ -1482,8 +1483,8 @@ static void work_fn_tx(struct work_struct *work)
+ return;
+ }
+
+- dev_dbg(port->dev, "%s: %p: %d...%d, cookie %d\n", __func__,
+- xmit->buf, xmit->tail, xmit->head, s->cookie_tx);
++ dev_dbg(port->dev, "%s: %p: %d...%d, cookie %d\n",
++ __func__, xmit->buf, xmit->tail, xmit->head, s->cookie_tx);
+
+ dma_async_issue_pending(chan);
+ }
+@@ -1602,8 +1603,8 @@ static bool filter(struct dma_chan *chan, void *slave)
+ {
+ struct sh_dmae_slave *param = slave;
+
+- dev_dbg(chan->device->dev, "%s: slave ID %d\n", __func__,
+- param->shdma_slave.slave_id);
++ dev_dbg(chan->device->dev, "%s: slave ID %d\n",
++ __func__, param->shdma_slave.slave_id);
+
+ chan->private = &param->shdma_slave;
+ return true;
+@@ -1632,8 +1633,7 @@ static void sci_request_dma(struct uart_port *port)
+ dma_cap_mask_t mask;
+ int nent;
+
+- dev_dbg(port->dev, "%s: port %d\n", __func__,
+- port->line);
++ dev_dbg(port->dev, "%s: port %d\n", __func__, port->line);
+
+ if (s->cfg->dma_slave_tx <= 0 || s->cfg->dma_slave_rx <= 0)
+ return;
+@@ -1661,7 +1661,8 @@ static void sci_request_dma(struct uart_port *port)
+ if (!nent)
+ sci_tx_dma_release(s, false);
+ else
+- dev_dbg(port->dev, "%s: mapped %d@%p to %pad\n", __func__,
++ dev_dbg(port->dev, "%s: mapped %d@%p to %pad\n",
++ __func__,
+ sg_dma_len(&s->sg_tx), port->state->xmit.buf,
+ &sg_dma_address(&s->sg_tx));
+
+@@ -1935,8 +1936,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
+ if (s->chan_rx) {
+ s->rx_timeout = (port->timeout - HZ / 50) * s->buf_len_rx * 3 /
+ port->fifosize / 2;
+- dev_dbg(port->dev,
+- "DMA Rx t-out %ums, tty t-out %u jiffies\n",
++ dev_dbg(port->dev, "DMA Rx t-out %ums, tty t-out %u jiffies\n",
+ s->rx_timeout * 1000 / HZ, port->timeout);
+ if (s->rx_timeout < msecs_to_jiffies(20))
+ s->rx_timeout = msecs_to_jiffies(20);
+@@ -2503,11 +2503,9 @@ static int sci_probe_single(struct platform_device *dev,
+
+ /* Sanity check */
+ if (unlikely(index >= SCI_NPORTS)) {
+- dev_notice(&dev->dev, "Attempting to register port "
+- "%d when only %d are available.\n",
++ dev_notice(&dev->dev, "Attempting to register port %d when only %d are available\n",
+ index+1, SCI_NPORTS);
+- dev_notice(&dev->dev, "Consider bumping "
+- "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n");
++ dev_notice(&dev->dev, "Consider bumping CONFIG_SERIAL_SH_SCI_NR_UARTS!\n");
+ return -EINVAL;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0137-cpufreq-remove-unused-notifier-CPUFREQ_-SUSPENDCHANG.patch b/patches.renesas/0137-cpufreq-remove-unused-notifier-CPUFREQ_-SUSPENDCHANG.patch
new file mode 100644
index 00000000000000..d4a595791afccf
--- /dev/null
+++ b/patches.renesas/0137-cpufreq-remove-unused-notifier-CPUFREQ_-SUSPENDCHANG.patch
@@ -0,0 +1,182 @@
+From c3a0c39f60e1cea0139d989209bfb7ce6773f3b9 Mon Sep 17 00:00:00 2001
+From: Viresh Kumar <viresh.kumar@linaro.org>
+Date: Wed, 19 Mar 2014 11:24:58 +0530
+Subject: cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE}
+
+Two cpufreq notifiers CPUFREQ_RESUMECHANGE and CPUFREQ_SUSPENDCHANGE have
+not been used for some time, so remove them to clean up code a bit.
+
+Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
+[rjw: Changelog]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+
+(cherry picked from commit 0b443ead714f0cba797a7f2476dd756f22b5421e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/cpu-freq/core.txt | 4 ----
+ arch/arm/kernel/smp.c | 3 +--
+ arch/arm/kernel/smp_twd.c | 2 +-
+ arch/arm/mach-pxa/viper.c | 3 ---
+ arch/powerpc/oprofile/op_model_cell.c | 3 +--
+ arch/sparc/kernel/time_64.c | 3 +--
+ arch/x86/kernel/tsc.c | 3 +--
+ drivers/cpufreq/cpufreq.c | 3 +--
+ drivers/pcmcia/sa11xx_base.c | 3 ---
+ drivers/tty/serial/sh-sci.c | 3 +--
+ include/linux/cpufreq.h | 2 --
+ 11 files changed, 7 insertions(+), 25 deletions(-)
+
+diff --git a/Documentation/cpu-freq/core.txt b/Documentation/cpu-freq/core.txt
+index ce0666e51036..0060d76b445f 100644
+--- a/Documentation/cpu-freq/core.txt
++++ b/Documentation/cpu-freq/core.txt
+@@ -92,7 +92,3 @@ values:
+ cpu - number of the affected CPU
+ old - old frequency
+ new - new frequency
+-
+-If the cpufreq core detects the frequency has changed while the system
+-was suspended, these notifiers are called with CPUFREQ_RESUMECHANGE as
+-second argument.
+diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
+index b7b4c86e338b..7c4fada440f0 100644
+--- a/arch/arm/kernel/smp.c
++++ b/arch/arm/kernel/smp.c
+@@ -674,8 +674,7 @@ static int cpufreq_callback(struct notifier_block *nb,
+ }
+
+ if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
+- (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+- (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
++ (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
+ loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
+ global_l_p_j_ref_freq,
+ freq->new);
+diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
+index 6591e26fc13f..dfc32130bc44 100644
+--- a/arch/arm/kernel/smp_twd.c
++++ b/arch/arm/kernel/smp_twd.c
+@@ -166,7 +166,7 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
+ * frequency. The timer is local to a cpu, so cross-call to the
+ * changing cpu.
+ */
+- if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE)
++ if (state == CPUFREQ_POSTCHANGE)
+ smp_call_function_single(freqs->cpu, twd_update_frequency,
+ NULL, 1);
+
+diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
+index 29905b127ad9..41f27f667ca8 100644
+--- a/arch/arm/mach-pxa/viper.c
++++ b/arch/arm/mach-pxa/viper.c
+@@ -885,9 +885,6 @@ static int viper_cpufreq_notifier(struct notifier_block *nb,
+ viper_set_core_cpu_voltage(freq->new, 0);
+ }
+ break;
+- case CPUFREQ_RESUMECHANGE:
+- viper_set_core_cpu_voltage(freq->new, 0);
+- break;
+ default:
+ /* ignore */
+ break;
+diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
+index 1f0ebdeea5f7..863d89386f60 100644
+--- a/arch/powerpc/oprofile/op_model_cell.c
++++ b/arch/powerpc/oprofile/op_model_cell.c
+@@ -1121,8 +1121,7 @@ oprof_cpufreq_notify(struct notifier_block *nb, unsigned long val, void *data)
+ int ret = 0;
+ struct cpufreq_freqs *frq = data;
+ if ((val == CPUFREQ_PRECHANGE && frq->old < frq->new) ||
+- (val == CPUFREQ_POSTCHANGE && frq->old > frq->new) ||
+- (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE))
++ (val == CPUFREQ_POSTCHANGE && frq->old > frq->new))
+ set_spu_profiling_frequency(frq->new, spu_cycle_reset);
+ return ret;
+ }
+diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
+index c3d82b5f54ca..b397e053b872 100644
+--- a/arch/sparc/kernel/time_64.c
++++ b/arch/sparc/kernel/time_64.c
+@@ -659,8 +659,7 @@ static int sparc64_cpufreq_notifier(struct notifier_block *nb, unsigned long val
+ ft->clock_tick_ref = cpu_data(cpu).clock_tick;
+ }
+ if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
+- (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+- (val == CPUFREQ_RESUMECHANGE)) {
++ (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
+ cpu_data(cpu).clock_tick =
+ cpufreq_scale(ft->clock_tick_ref,
+ ft->ref_freq,
+diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
+index e0d1d7a8354e..6b8d35b8cd62 100644
+--- a/arch/x86/kernel/tsc.c
++++ b/arch/x86/kernel/tsc.c
+@@ -914,8 +914,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
+ tsc_khz_ref = tsc_khz;
+ }
+ if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) ||
+- (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+- (val == CPUFREQ_RESUMECHANGE)) {
++ (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) {
+ *lpj = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
+
+ tsc_khz = cpufreq_scale(tsc_khz_ref, ref_freq, freq->new);
+diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
+index 153f4b92cc05..dc1447dc173e 100644
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -257,8 +257,7 @@ static void adjust_jiffies(unsigned long val, struct cpufreq_freqs *ci)
+ pr_debug("saving %lu as reference value for loops_per_jiffy; "
+ "freq is %u kHz\n", l_p_j_ref, l_p_j_ref_freq);
+ }
+- if ((val == CPUFREQ_POSTCHANGE && ci->old != ci->new) ||
+- (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
++ if (val == CPUFREQ_POSTCHANGE && ci->old != ci->new) {
+ loops_per_jiffy = cpufreq_scale(l_p_j_ref, l_p_j_ref_freq,
+ ci->new);
+ pr_debug("scaling loops_per_jiffy to %lu "
+diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c
+index 6eecd7cddf57..54d3089d157b 100644
+--- a/drivers/pcmcia/sa11xx_base.c
++++ b/drivers/pcmcia/sa11xx_base.c
+@@ -125,9 +125,6 @@ sa1100_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
+ if (freqs->new < freqs->old)
+ sa1100_pcmcia_set_mecr(skt, freqs->new);
+ break;
+- case CPUFREQ_RESUMECHANGE:
+- sa1100_pcmcia_set_mecr(skt, freqs->new);
+- break;
+ }
+
+ return 0;
+diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
+index 7ee5a79222ff..88236da0ddf7 100644
+--- a/drivers/tty/serial/sh-sci.c
++++ b/drivers/tty/serial/sh-sci.c
+@@ -1041,8 +1041,7 @@ static int sci_notifier(struct notifier_block *self,
+
+ sci_port = container_of(self, struct sci_port, freq_transition);
+
+- if ((phase == CPUFREQ_POSTCHANGE) ||
+- (phase == CPUFREQ_RESUMECHANGE)) {
++ if (phase == CPUFREQ_POSTCHANGE) {
+ struct uart_port *port = &sci_port->port;
+
+ spin_lock_irqsave(&port->lock, flags);
+diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
+index 4d89e0e6f9cc..945313ca4bbf 100644
+--- a/include/linux/cpufreq.h
++++ b/include/linux/cpufreq.h
+@@ -306,8 +306,6 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
+ /* Transition notifiers */
+ #define CPUFREQ_PRECHANGE (0)
+ #define CPUFREQ_POSTCHANGE (1)
+-#define CPUFREQ_RESUMECHANGE (8)
+-#define CPUFREQ_SUSPENDCHANGE (9)
+
+ /* Policy Notifiers */
+ #define CPUFREQ_ADJUST (0)
+--
+2.1.2
+
diff --git a/patches.renesas/0138-media-media-soc_camera-rcar_vin-Add-support-for-10-b.patch b/patches.renesas/0138-media-media-soc_camera-rcar_vin-Add-support-for-10-b.patch
new file mode 100644
index 00000000000000..beafc0b3dca292
--- /dev/null
+++ b/patches.renesas/0138-media-media-soc_camera-rcar_vin-Add-support-for-10-b.patch
@@ -0,0 +1,54 @@
+From 5fce7877354041df38ae2f08ba270f4bb8021488 Mon Sep 17 00:00:00 2001
+From: Phil Edworthy <phil.edworthy@renesas.com>
+Date: Tue, 25 Feb 2014 06:10:27 -0300
+Subject: [media] media: soc_camera: rcar_vin: Add support for 10-bit YUV
+ cameras
+
+Add support for MBUS YUV10 BT656 and BT601 formats at rcar driver.
+
+Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
+Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
+(cherry picked from commit cbe504d4d4d88375ef912975f816d1e3c3f14194)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/media/platform/soc_camera/rcar_vin.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
+index 3b1c05a72d00..702dc47062a2 100644
+--- a/drivers/media/platform/soc_camera/rcar_vin.c
++++ b/drivers/media/platform/soc_camera/rcar_vin.c
+@@ -68,6 +68,8 @@
+ #define VNMC_YCAL (1 << 19)
+ #define VNMC_INF_YUV8_BT656 (0 << 16)
+ #define VNMC_INF_YUV8_BT601 (1 << 16)
++#define VNMC_INF_YUV10_BT656 (2 << 16)
++#define VNMC_INF_YUV10_BT601 (3 << 16)
+ #define VNMC_INF_YUV16 (5 << 16)
+ #define VNMC_VUP (1 << 10)
+ #define VNMC_IM_ODD (0 << 3)
+@@ -275,6 +277,12 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv)
+ /* BT.656 8bit YCbCr422 or BT.601 8bit YCbCr422 */
+ vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ?
+ VNMC_INF_YUV8_BT656 : VNMC_INF_YUV8_BT601;
++ break;
++ case V4L2_MBUS_FMT_YUYV10_2X10:
++ /* BT.656 10bit YCbCr422 or BT.601 10bit YCbCr422 */
++ vnmc |= priv->pdata->flags & RCAR_VIN_BT656 ?
++ VNMC_INF_YUV10_BT656 : VNMC_INF_YUV10_BT601;
++ break;
+ default:
+ break;
+ }
+@@ -1003,6 +1011,7 @@ static int rcar_vin_get_formats(struct soc_camera_device *icd, unsigned int idx,
+ switch (code) {
+ case V4L2_MBUS_FMT_YUYV8_1X16:
+ case V4L2_MBUS_FMT_YUYV8_2X8:
++ case V4L2_MBUS_FMT_YUYV10_2X10:
+ if (cam->extra_fmt)
+ break;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0139-i2c-add-deprecation-warning-for-class-based-instanti.patch b/patches.renesas/0139-i2c-add-deprecation-warning-for-class-based-instanti.patch
new file mode 100644
index 00000000000000..333c4beff7565f
--- /dev/null
+++ b/patches.renesas/0139-i2c-add-deprecation-warning-for-class-based-instanti.patch
@@ -0,0 +1,54 @@
+From 6a6becd1fa5fedfcb8305618fc68a931b0f0ed66 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@the-dreams.de>
+Date: Mon, 10 Feb 2014 11:03:56 +0100
+Subject: i2c: add deprecation warning for class based instantiation
+
+Class based instantiation can cause noticeable delays when booting. This
+mechanism is used when it is not possible to describe slaves on I2C
+busses. As we do have other mechanisms, most embedded I2C will not need
+classes and for embedded it is explicitly not recommended to use them. Add
+a deprecation warning for drivers which want to disable class based
+instantiation in the near future to gain boot-up time, so users relying
+on this technique can switch to something better. They really should.
+
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+(cherry picked from commit 0c176170089c3a7f2a891f9860f5cdc5f481ff78)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/i2c/i2c-core.c | 7 +++++++
+ include/linux/i2c.h | 1 +
+ 2 files changed, 8 insertions(+)
+
+diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
+index 5fb80b8962a2..98a5fd950f16 100644
+--- a/drivers/i2c/i2c-core.c
++++ b/drivers/i2c/i2c-core.c
+@@ -1941,6 +1941,13 @@ static int i2c_detect_address(struct i2c_client *temp_client,
+ struct i2c_client *client;
+
+ /* Detection succeeded, instantiate the device */
++ if (adapter->class & I2C_CLASS_DEPRECATED)
++ dev_warn(&adapter->dev,
++ "This adapter will soon drop class based instantiation of devices. "
++ "Please make sure client 0x%02x gets instantiated by other means. "
++ "Check 'Documentation/i2c/instantiating-devices' for details.\n",
++ info.addr);
++
+ dev_dbg(&adapter->dev, "Creating %s at 0x%02x\n",
+ info.type, info.addr);
+ client = i2c_new_device(adapter, &info);
+diff --git a/include/linux/i2c.h b/include/linux/i2c.h
+index deddeb8c337c..b556e0ab946f 100644
+--- a/include/linux/i2c.h
++++ b/include/linux/i2c.h
+@@ -487,6 +487,7 @@ void i2c_unlock_adapter(struct i2c_adapter *);
+ #define I2C_CLASS_HWMON (1<<0) /* lm_sensors, ... */
+ #define I2C_CLASS_DDC (1<<3) /* DDC bus on graphics adapters */
+ #define I2C_CLASS_SPD (1<<7) /* Memory modules */
++#define I2C_CLASS_DEPRECATED (1<<8) /* Warn users that adapter will stop using classes */
+
+ /* Internal numbers to terminate lists */
+ #define I2C_CLIENT_END 0xfffeU
+--
+2.1.2
+
diff --git a/patches.renesas/0140-i2c-rcar-add-compatible-entry-for-r8a7791.patch b/patches.renesas/0140-i2c-rcar-add-compatible-entry-for-r8a7791.patch
new file mode 100644
index 00000000000000..b812d8935b0eaf
--- /dev/null
+++ b/patches.renesas/0140-i2c-rcar-add-compatible-entry-for-r8a7791.patch
@@ -0,0 +1,65 @@
+From eb90b9b2e14bb641472568355f2c57e7c5110168 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Thu, 20 Feb 2014 09:03:20 +0100
+Subject: i2c: rcar: add compatible entry for r8a7791
+
+While we are here, also brush up the devicetree binding documentation.
+The example was an inappropriate copy from the sh_mobile driver.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+(cherry picked from commit e89364556824cc7a947f99173af842217074c099)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/i2c/i2c-rcar.txt | 14 ++++++++++----
+ drivers/i2c/busses/i2c-rcar.c | 1 +
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
+index 897cfcd5ce92..dd8b2dd1edeb 100644
+--- a/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
++++ b/Documentation/devicetree/bindings/i2c/i2c-rcar.txt
+@@ -6,6 +6,7 @@ Required properties:
+ "renesas,i2c-r8a7778"
+ "renesas,i2c-r8a7779"
+ "renesas,i2c-r8a7790"
++ "renesas,i2c-r8a7791"
+ - reg: physical base address of the controller and length of memory mapped
+ region.
+ - interrupts: interrupt specifier.
+@@ -13,11 +14,16 @@ Required properties:
+ Optional properties:
+ - clock-frequency: desired I2C bus clock frequency in Hz. The absence of this
+ propoerty indicates the default frequency 100 kHz.
++- clocks: clock specifier.
+
+ Examples :
+
+-i2c0: i2c@e6500000 {
+- compatible = "renesas,i2c-rcar-h2";
+- reg = <0 0xe6500000 0 0x428>;
+- interrupts = <0 174 0x4>;
++i2c0: i2c@e6508000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6508000 0 0x40>;
++ interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
++ clock-frequency = <400000>;
+ };
+diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
+index d3c5d6216575..233812c431c3 100644
+--- a/drivers/i2c/busses/i2c-rcar.c
++++ b/drivers/i2c/busses/i2c-rcar.c
+@@ -645,6 +645,7 @@ static const struct of_device_id rcar_i2c_dt_ids[] = {
+ { .compatible = "renesas,i2c-r8a7778", .data = (void *)I2C_RCAR_GEN1 },
+ { .compatible = "renesas,i2c-r8a7779", .data = (void *)I2C_RCAR_GEN1 },
+ { .compatible = "renesas,i2c-r8a7790", .data = (void *)I2C_RCAR_GEN2 },
++ { .compatible = "renesas,i2c-r8a7791", .data = (void *)I2C_RCAR_GEN2 },
+ {},
+ };
+ MODULE_DEVICE_TABLE(of, rcar_i2c_dt_ids);
+--
+2.1.2
+
diff --git a/patches.renesas/0141-i2c-i2c-rcar-deprecate-class-based-instantiation.patch b/patches.renesas/0141-i2c-i2c-rcar-deprecate-class-based-instantiation.patch
new file mode 100644
index 00000000000000..03d66a38594131
--- /dev/null
+++ b/patches.renesas/0141-i2c-i2c-rcar-deprecate-class-based-instantiation.patch
@@ -0,0 +1,31 @@
+From 6fd642d3cd7ba533c1794b14540fbdb337b93261 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@the-dreams.de>
+Date: Mon, 10 Feb 2014 11:04:06 +0100
+Subject: i2c: i2c-rcar: deprecate class based instantiation
+
+Warn users that class based instantiation is going away soon in favour
+of more robust probing and faster bootup times.
+
+Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
+(cherry picked from commit 96c4b6bb5ddb03881dfc1c91410548432138d4ba)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/i2c/busses/i2c-rcar.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
+index 233812c431c3..06d47aafbb79 100644
+--- a/drivers/i2c/busses/i2c-rcar.c
++++ b/drivers/i2c/busses/i2c-rcar.c
+@@ -699,7 +699,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
+ adap = &priv->adap;
+ adap->nr = pdev->id;
+ adap->algo = &rcar_i2c_algo;
+- adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
++ adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD | I2C_CLASS_DEPRECATED;
+ adap->retries = 3;
+ adap->dev.parent = dev;
+ adap->dev.of_node = dev->of_node;
+--
+2.1.2
+
diff --git a/patches.renesas/0142-regulator-da9210-Remove-redundant-error-message.patch b/patches.renesas/0142-regulator-da9210-Remove-redundant-error-message.patch
new file mode 100644
index 00000000000000..6f1a1b35b4e69a
--- /dev/null
+++ b/patches.renesas/0142-regulator-da9210-Remove-redundant-error-message.patch
@@ -0,0 +1,35 @@
+From 0537baae6b2603fc814a50c0a524a52fe41172b9 Mon Sep 17 00:00:00 2001
+From: Sachin Kamat <sachin.kamat@linaro.org>
+Date: Thu, 20 Feb 2014 14:23:02 +0530
+Subject: regulator: da9210: Remove redundant error message
+
+kzalloc prints its own OOM message upon failure.
+
+Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6c48acfb2affa8b2aed810bb67888e0d1720a884)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/da9210-regulator.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/drivers/regulator/da9210-regulator.c b/drivers/regulator/da9210-regulator.c
+index 6f5ecbe1132e..7a320dd11c46 100644
+--- a/drivers/regulator/da9210-regulator.c
++++ b/drivers/regulator/da9210-regulator.c
+@@ -134,11 +134,8 @@ static int da9210_i2c_probe(struct i2c_client *i2c,
+ int error;
+
+ chip = devm_kzalloc(&i2c->dev, sizeof(struct da9210), GFP_KERNEL);
+- if (NULL == chip) {
+- dev_err(&i2c->dev,
+- "Cannot kzalloc memory for regulator structure\n");
++ if (!chip)
+ return -ENOMEM;
+- }
+
+ chip->regmap = devm_regmap_init_i2c(i2c, &da9210_regmap_config);
+ if (IS_ERR(chip->regmap)) {
+--
+2.1.2
+
diff --git a/patches.renesas/0143-spi-Provide-core-support-for-DMA-mapping-transfers.patch b/patches.renesas/0143-spi-Provide-core-support-for-DMA-mapping-transfers.patch
new file mode 100644
index 00000000000000..7c547128da184e
--- /dev/null
+++ b/patches.renesas/0143-spi-Provide-core-support-for-DMA-mapping-transfers.patch
@@ -0,0 +1,193 @@
+From ea9312515cb68c7a190c62a7288e5e0ad1447dd1 Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@linaro.org>
+Date: Thu, 16 Jan 2014 12:22:43 +0000
+Subject: spi: Provide core support for DMA mapping transfers
+
+The process of DMA mapping buffers for SPI transfers does not vary between
+devices so in order to save duplication of code in drivers this can be
+factored out into the core, allowing it to be integrated with the work that
+is being done on factoring out the common elements from the data path
+including more sharing of dmaengine code.
+
+In order to use this masters need to provide a can_dma() operation and while
+the hardware is prepared they should ensure that DMA channels are provided
+in tx_dma and rx_dma. The core will then ensure that the buffers are mapped
+for DMA prior to calling transfer_one_message().
+
+Currently the cleanup on error is not complete, this needs to be improved.
+
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 99adef310f682d6343cb40c1f6c9c25a4b3a450d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++
+ include/linux/spi/spi.h | 18 +++++++++++
+ 2 files changed, 100 insertions(+)
+
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index fbf3b22efe5a..048eb72029a4 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -24,6 +24,8 @@
+ #include <linux/device.h>
+ #include <linux/init.h>
+ #include <linux/cache.h>
++#include <linux/dma-mapping.h>
++#include <linux/dmaengine.h>
+ #include <linux/mutex.h>
+ #include <linux/of_device.h>
+ #include <linux/of_irq.h>
+@@ -580,6 +582,77 @@ static void spi_set_cs(struct spi_device *spi, bool enable)
+ spi->master->set_cs(spi, !enable);
+ }
+
++static int spi_map_msg(struct spi_master *master, struct spi_message *msg)
++{
++ struct device *dev = master->dev.parent;
++ struct device *tx_dev, *rx_dev;
++ struct spi_transfer *xfer;
++
++ if (msg->is_dma_mapped || !master->can_dma)
++ return 0;
++
++ tx_dev = &master->dma_tx->dev->device;
++ rx_dev = &master->dma_rx->dev->device;
++
++ list_for_each_entry(xfer, &msg->transfers, transfer_list) {
++ if (!master->can_dma(master, msg->spi, xfer))
++ continue;
++
++ if (xfer->tx_buf != NULL) {
++ xfer->tx_dma = dma_map_single(tx_dev,
++ (void *)xfer->tx_buf,
++ xfer->len,
++ DMA_TO_DEVICE);
++ if (dma_mapping_error(dev, xfer->tx_dma)) {
++ dev_err(dev, "dma_map_single Tx failed\n");
++ return -ENOMEM;
++ }
++ }
++
++ if (xfer->rx_buf != NULL) {
++ xfer->rx_dma = dma_map_single(rx_dev,
++ xfer->rx_buf, xfer->len,
++ DMA_FROM_DEVICE);
++ if (dma_mapping_error(dev, xfer->rx_dma)) {
++ dev_err(dev, "dma_map_single Rx failed\n");
++ dma_unmap_single(tx_dev, xfer->tx_dma,
++ xfer->len, DMA_TO_DEVICE);
++ return -ENOMEM;
++ }
++ }
++ }
++
++ master->cur_msg_mapped = true;
++
++ return 0;
++}
++
++static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
++{
++ struct spi_transfer *xfer;
++ struct device *tx_dev, *rx_dev;
++
++ if (!master->cur_msg_mapped || msg->is_dma_mapped || !master->can_dma)
++ return 0;
++
++ tx_dev = &master->dma_tx->dev->device;
++ rx_dev = &master->dma_rx->dev->device;
++
++ list_for_each_entry(xfer, &msg->transfers, transfer_list) {
++ if (!master->can_dma(master, msg->spi, xfer))
++ continue;
++
++ if (xfer->rx_buf)
++ dma_unmap_single(rx_dev, xfer->rx_dma, xfer->len,
++ DMA_FROM_DEVICE);
++ if (xfer->tx_buf)
++ dma_unmap_single(tx_dev, xfer->tx_dma, xfer->len,
++ DMA_TO_DEVICE);
++ }
++
++ return 0;
++}
++
+ /*
+ * spi_transfer_one_message - Default implementation of transfer_one_message()
+ *
+@@ -752,6 +825,13 @@ static void spi_pump_messages(struct kthread_work *work)
+ master->cur_msg_prepared = true;
+ }
+
++ ret = spi_map_msg(master, master->cur_msg);
++ if (ret) {
++ master->cur_msg->status = ret;
++ spi_finalize_current_message(master);
++ return;
++ }
++
+ ret = master->transfer_one_message(master, master->cur_msg);
+ if (ret) {
+ dev_err(&master->dev,
+@@ -839,6 +919,8 @@ void spi_finalize_current_message(struct spi_master *master)
+ queue_kthread_work(&master->kworker, &master->pump_messages);
+ spin_unlock_irqrestore(&master->queue_lock, flags);
+
++ spi_unmap_msg(master, mesg);
++
+ if (master->cur_msg_prepared && master->unprepare_message) {
+ ret = master->unprepare_message(master, mesg);
+ if (ret) {
+diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
+index 4203c66d8803..dd8b91d95110 100644
+--- a/include/linux/spi/spi.h
++++ b/include/linux/spi/spi.h
+@@ -25,6 +25,8 @@
+ #include <linux/kthread.h>
+ #include <linux/completion.h>
+
++struct dma_chan;
++
+ /*
+ * INTERFACES between SPI master-side drivers and SPI infrastructure.
+ * (There's no SPI slave support for Linux yet...)
+@@ -390,6 +392,17 @@ struct spi_master {
+ void (*cleanup)(struct spi_device *spi);
+
+ /*
++ * Used to enable core support for DMA handling, if can_dma()
++ * exists and returns true then the transfer will be mapped
++ * prior to transfer_one() being called. The driver should
++ * not modify or store xfer and dma_tx and dma_rx must be set
++ * while the device is prepared.
++ */
++ bool (*can_dma)(struct spi_master *master,
++ struct spi_device *spi,
++ struct spi_transfer *xfer);
++
++ /*
+ * These hooks are for drivers that want to use the generic
+ * master transfer queueing mechanism. If these are used, the
+ * transfer() function above must NOT be specified by the driver.
+@@ -407,6 +420,7 @@ struct spi_master {
+ bool rt;
+ bool auto_runtime_pm;
+ bool cur_msg_prepared;
++ bool cur_msg_mapped;
+ struct completion xfer_completion;
+
+ int (*prepare_transfer_hardware)(struct spi_master *master);
+@@ -428,6 +442,10 @@ struct spi_master {
+
+ /* gpio chip select */
+ int *cs_gpios;
++
++ /* DMA channels for use with core dmaengine helpers */
++ struct dma_chan *dma_tx;
++ struct dma_chan *dma_rx;
+ };
+
+ static inline void *spi_master_get_devdata(struct spi_master *master)
+--
+2.1.2
+
diff --git a/patches.renesas/0144-spi-Provide-core-support-for-full-duplex-devices.patch b/patches.renesas/0144-spi-Provide-core-support-for-full-duplex-devices.patch
new file mode 100644
index 00000000000000..df84313a76626d
--- /dev/null
+++ b/patches.renesas/0144-spi-Provide-core-support-for-full-duplex-devices.patch
@@ -0,0 +1,116 @@
+From 36996316db8296af016c6636b2fb5d00974fc2de Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@linaro.org>
+Date: Tue, 28 Jan 2014 20:17:03 +0000
+Subject: spi: Provide core support for full duplex devices
+
+It is fairly common for SPI devices to require that one or both transfer
+directions is always active. Currently drivers open code this in various
+ways with varying degrees of efficiency. Start factoring this out by
+providing flags SPI_MASTER_MUST_TX and SPI_MASTER_MUST_RX. These will cause
+the core to provide buffers for the requested direction if none are
+specified in the underlying transfer.
+
+Currently this is fairly inefficient since we actually allocate a data
+buffer which may get large, support for mapping transfers using a
+scatterlist will allow us to avoid this for DMA based transfers.
+
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 3a2eba9bd0a6447dfbc01635e4cd0689f5f2bdad)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
+ include/linux/spi/spi.h | 6 ++++++
+ 2 files changed, 53 insertions(+)
+
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index 048eb72029a4..dbab6681a1a1 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -587,6 +587,49 @@ static int spi_map_msg(struct spi_master *master, struct spi_message *msg)
+ struct device *dev = master->dev.parent;
+ struct device *tx_dev, *rx_dev;
+ struct spi_transfer *xfer;
++ void *tmp;
++ size_t max_tx, max_rx;
++
++ if (master->flags & (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX)) {
++ max_tx = 0;
++ max_rx = 0;
++
++ list_for_each_entry(xfer, &msg->transfers, transfer_list) {
++ if ((master->flags & SPI_MASTER_MUST_TX) &&
++ !xfer->tx_buf)
++ max_tx = max(xfer->len, max_tx);
++ if ((master->flags & SPI_MASTER_MUST_RX) &&
++ !xfer->rx_buf)
++ max_rx = max(xfer->len, max_rx);
++ }
++
++ if (max_tx) {
++ tmp = krealloc(master->dummy_tx, max_tx,
++ GFP_KERNEL | GFP_DMA);
++ if (!tmp)
++ return -ENOMEM;
++ master->dummy_tx = tmp;
++ memset(tmp, 0, max_tx);
++ }
++
++ if (max_rx) {
++ tmp = krealloc(master->dummy_rx, max_rx,
++ GFP_KERNEL | GFP_DMA);
++ if (!tmp)
++ return -ENOMEM;
++ master->dummy_rx = tmp;
++ }
++
++ if (max_tx || max_rx) {
++ list_for_each_entry(xfer, &msg->transfers,
++ transfer_list) {
++ if (!xfer->tx_buf)
++ xfer->tx_buf = master->dummy_tx;
++ if (!xfer->rx_buf)
++ xfer->rx_buf = master->dummy_rx;
++ }
++ }
++ }
+
+ if (msg->is_dma_mapped || !master->can_dma)
+ return 0;
+@@ -759,6 +802,10 @@ static void spi_pump_messages(struct kthread_work *work)
+ }
+ master->busy = false;
+ spin_unlock_irqrestore(&master->queue_lock, flags);
++ kfree(master->dummy_rx);
++ master->dummy_rx = NULL;
++ kfree(master->dummy_tx);
++ master->dummy_tx = NULL;
+ if (master->unprepare_transfer_hardware &&
+ master->unprepare_transfer_hardware(master))
+ dev_err(&master->dev,
+diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
+index dd8b91d95110..c4c68093cd7c 100644
+--- a/include/linux/spi/spi.h
++++ b/include/linux/spi/spi.h
+@@ -350,6 +350,8 @@ struct spi_master {
+ #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
+ #define SPI_MASTER_NO_RX BIT(1) /* can't do buffer read */
+ #define SPI_MASTER_NO_TX BIT(2) /* can't do buffer write */
++#define SPI_MASTER_MUST_RX BIT(3) /* requires rx */
++#define SPI_MASTER_MUST_TX BIT(4) /* requires tx */
+
+ /* lock and mutex for SPI bus locking */
+ spinlock_t bus_lock_spinlock;
+@@ -446,6 +448,10 @@ struct spi_master {
+ /* DMA channels for use with core dmaengine helpers */
+ struct dma_chan *dma_tx;
+ struct dma_chan *dma_rx;
++
++ /* dummy data for full duplex devices */
++ void *dummy_rx;
++ void *dummy_tx;
+ };
+
+ static inline void *spi_master_get_devdata(struct spi_master *master)
+--
+2.1.2
+
diff --git a/patches.renesas/0145-spi-core-Ignore-unsupported-spi-tr-x-bus-width-prope.patch b/patches.renesas/0145-spi-core-Ignore-unsupported-spi-tr-x-bus-width-prope.patch
new file mode 100644
index 00000000000000..aa988d8486a706
--- /dev/null
+++ b/patches.renesas/0145-spi-core-Ignore-unsupported-spi-tr-x-bus-width-prope.patch
@@ -0,0 +1,56 @@
+From 213d3433d7939ab9a1318d32fe7e11d363da42dd Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Mon, 26 May 2014 14:05:25 +0200
+Subject: spi: core: Ignore unsupported spi-[tr]x-bus-width property values
+
+Rejecting unsupported values of spi-tx-bus-width and spi-rx-bus-width
+may break compatibility with future DTs. Just ignore them, falling back
+to Single SPI Transfers.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 80874d8c9e9cbfa195572dfea46f2314098b3869)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi.c | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index dbab6681a1a1..3f401021f104 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -1190,11 +1190,10 @@ static void of_register_spi_devices(struct spi_master *master)
+ spi->mode |= SPI_TX_QUAD;
+ break;
+ default:
+- dev_err(&master->dev,
+- "spi-tx-bus-width %d not supported\n",
+- value);
+- spi_dev_put(spi);
+- continue;
++ dev_warn(&master->dev,
++ "spi-tx-bus-width %d not supported\n",
++ value);
++ break;
+ }
+ }
+
+@@ -1209,11 +1208,10 @@ static void of_register_spi_devices(struct spi_master *master)
+ spi->mode |= SPI_RX_QUAD;
+ break;
+ default:
+- dev_err(&master->dev,
+- "spi-rx-bus-width %d not supported\n",
+- value);
+- spi_dev_put(spi);
+- continue;
++ dev_warn(&master->dev,
++ "spi-rx-bus-width %d not supported\n",
++ value);
++ break;
+ }
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0146-spi-Make-core-DMA-mapping-functions-generate-scatter.patch b/patches.renesas/0146-spi-Make-core-DMA-mapping-functions-generate-scatter.patch
new file mode 100644
index 00000000000000..5913fdaa859b41
--- /dev/null
+++ b/patches.renesas/0146-spi-Make-core-DMA-mapping-functions-generate-scatter.patch
@@ -0,0 +1,294 @@
+From bb6b8838d1fbc5eeaaa05fc4323d23bc031780ae Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@linaro.org>
+Date: Sun, 2 Feb 2014 13:47:47 +0000
+Subject: spi: Make core DMA mapping functions generate scatterlists
+
+We cannot unconditionally use dma_map_single() to map data for use with
+SPI since transfers may exceed a page and virtual addresses may not be
+provided with physically contiguous pages. Further, addresses allocated
+using vmalloc() need to be mapped differently to other addresses.
+
+Currently only the MXS driver handles all this, a few drivers do handle
+the possibility that buffers may not be physically contiguous which is
+the main potential problem but many don't even do that. Factoring this
+out into the core will make it easier for drivers to do a good job so if
+the driver is using the core DMA code then generate a scatterlist
+instead of mapping to a single address so do that.
+
+This code is mainly based on a combination of the existing code in the MXS
+and PXA2xx drivers. In future we should be able to extend it to allow the
+core to concatenate adjacent transfers if they are compatible, improving
+performance.
+
+Currently for simplicity clients are not allowed to use the scatterlist
+when they do DMA mapping, in the future the existing single address
+mappings will be replaced with use of the scatterlist most likely as
+part of pre-verifying transfers.
+
+This change makes it mandatory to use scatterlists when using the core DMA
+mapping so update the s3c64xx driver to do this when used with dmaengine.
+Doing so makes the code more ugly but it is expected that the old s3c-dma
+code can be removed very soon.
+
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6ad45a27cbe343ec8d7888e5edf6335499a4b555)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-s3c64xx.c | 14 +++++--
+ drivers/spi/spi.c | 101 ++++++++++++++++++++++++++++++++++------------
+ include/linux/spi/spi.h | 7 ++++
+ 3 files changed, 94 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
+index ae907dde1371..c717b2b1b911 100644
+--- a/drivers/spi/spi-s3c64xx.c
++++ b/drivers/spi/spi-s3c64xx.c
+@@ -381,7 +381,7 @@ static void s3c64xx_spi_dma_stop(struct s3c64xx_spi_driver_data *sdd,
+ #else
+
+ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
+- unsigned len, dma_addr_t buf)
++ struct sg_table *sgt)
+ {
+ struct s3c64xx_spi_driver_data *sdd;
+ struct dma_slave_config config;
+@@ -407,8 +407,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
+ dmaengine_slave_config(dma->ch, &config);
+ }
+
+- desc = dmaengine_prep_slave_single(dma->ch, buf, len,
+- dma->direction, DMA_PREP_INTERRUPT);
++ desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents,
++ dma->direction, DMA_PREP_INTERRUPT);
+
+ desc->callback = s3c64xx_spi_dmacb;
+ desc->callback_param = dma;
+@@ -515,7 +515,11 @@ static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+ chcfg |= S3C64XX_SPI_CH_TXCH_ON;
+ if (dma_mode) {
+ modecfg |= S3C64XX_SPI_MODE_TXDMA_ON;
++#ifndef CONFIG_S3C_DMA
++ prepare_dma(&sdd->tx_dma, &xfer->tx_sg);
++#else
+ prepare_dma(&sdd->tx_dma, xfer->len, xfer->tx_dma);
++#endif
+ } else {
+ switch (sdd->cur_bpw) {
+ case 32:
+@@ -547,7 +551,11 @@ static void enable_datapath(struct s3c64xx_spi_driver_data *sdd,
+ writel(((xfer->len * 8 / sdd->cur_bpw) & 0xffff)
+ | S3C64XX_SPI_PACKET_CNT_EN,
+ regs + S3C64XX_SPI_PACKET_CNT);
++#ifndef CONFIG_S3C_DMA
++ prepare_dma(&sdd->rx_dma, &xfer->rx_sg);
++#else
+ prepare_dma(&sdd->rx_dma, xfer->len, xfer->rx_dma);
++#endif
+ }
+ }
+
+diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
+index 3f401021f104..caa658f8c910 100644
+--- a/drivers/spi/spi.c
++++ b/drivers/spi/spi.c
+@@ -582,13 +582,70 @@ static void spi_set_cs(struct spi_device *spi, bool enable)
+ spi->master->set_cs(spi, !enable);
+ }
+
++static int spi_map_buf(struct spi_master *master, struct device *dev,
++ struct sg_table *sgt, void *buf, size_t len,
++ enum dma_data_direction dir)
++{
++ const bool vmalloced_buf = is_vmalloc_addr(buf);
++ const int desc_len = vmalloced_buf ? PAGE_SIZE : master->max_dma_len;
++ const int sgs = DIV_ROUND_UP(len, desc_len);
++ struct page *vm_page;
++ void *sg_buf;
++ size_t min;
++ int i, ret;
++
++ ret = sg_alloc_table(sgt, sgs, GFP_KERNEL);
++ if (ret != 0)
++ return ret;
++
++ for (i = 0; i < sgs; i++) {
++ min = min_t(size_t, len, desc_len);
++
++ if (vmalloced_buf) {
++ vm_page = vmalloc_to_page(buf);
++ if (!vm_page) {
++ sg_free_table(sgt);
++ return -ENOMEM;
++ }
++ sg_buf = page_address(vm_page) +
++ ((size_t)buf & ~PAGE_MASK);
++ } else {
++ sg_buf = buf;
++ }
++
++ sg_set_buf(&sgt->sgl[i], sg_buf, min);
++
++ buf += min;
++ len -= min;
++ }
++
++ ret = dma_map_sg(dev, sgt->sgl, sgt->nents, dir);
++ if (ret < 0) {
++ sg_free_table(sgt);
++ return ret;
++ }
++
++ sgt->nents = ret;
++
++ return 0;
++}
++
++static void spi_unmap_buf(struct spi_master *master, struct device *dev,
++ struct sg_table *sgt, enum dma_data_direction dir)
++{
++ if (sgt->orig_nents) {
++ dma_unmap_sg(dev, sgt->sgl, sgt->orig_nents, dir);
++ sg_free_table(sgt);
++ }
++}
++
+ static int spi_map_msg(struct spi_master *master, struct spi_message *msg)
+ {
+- struct device *dev = master->dev.parent;
+ struct device *tx_dev, *rx_dev;
+ struct spi_transfer *xfer;
+ void *tmp;
+ size_t max_tx, max_rx;
++ int ret;
+
+ if (master->flags & (SPI_MASTER_MUST_RX | SPI_MASTER_MUST_TX)) {
+ max_tx = 0;
+@@ -631,7 +688,7 @@ static int spi_map_msg(struct spi_master *master, struct spi_message *msg)
+ }
+ }
+
+- if (msg->is_dma_mapped || !master->can_dma)
++ if (!master->can_dma)
+ return 0;
+
+ tx_dev = &master->dma_tx->dev->device;
+@@ -642,25 +699,21 @@ static int spi_map_msg(struct spi_master *master, struct spi_message *msg)
+ continue;
+
+ if (xfer->tx_buf != NULL) {
+- xfer->tx_dma = dma_map_single(tx_dev,
+- (void *)xfer->tx_buf,
+- xfer->len,
+- DMA_TO_DEVICE);
+- if (dma_mapping_error(dev, xfer->tx_dma)) {
+- dev_err(dev, "dma_map_single Tx failed\n");
+- return -ENOMEM;
+- }
++ ret = spi_map_buf(master, tx_dev, &xfer->tx_sg,
++ (void *)xfer->tx_buf, xfer->len,
++ DMA_TO_DEVICE);
++ if (ret != 0)
++ return ret;
+ }
+
+ if (xfer->rx_buf != NULL) {
+- xfer->rx_dma = dma_map_single(rx_dev,
+- xfer->rx_buf, xfer->len,
+- DMA_FROM_DEVICE);
+- if (dma_mapping_error(dev, xfer->rx_dma)) {
+- dev_err(dev, "dma_map_single Rx failed\n");
+- dma_unmap_single(tx_dev, xfer->tx_dma,
+- xfer->len, DMA_TO_DEVICE);
+- return -ENOMEM;
++ ret = spi_map_buf(master, rx_dev, &xfer->rx_sg,
++ xfer->rx_buf, xfer->len,
++ DMA_FROM_DEVICE);
++ if (ret != 0) {
++ spi_unmap_buf(master, tx_dev, &xfer->tx_sg,
++ DMA_TO_DEVICE);
++ return ret;
+ }
+ }
+ }
+@@ -675,7 +728,7 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
+ struct spi_transfer *xfer;
+ struct device *tx_dev, *rx_dev;
+
+- if (!master->cur_msg_mapped || msg->is_dma_mapped || !master->can_dma)
++ if (!master->cur_msg_mapped || !master->can_dma)
+ return 0;
+
+ tx_dev = &master->dma_tx->dev->device;
+@@ -685,12 +738,8 @@ static int spi_unmap_msg(struct spi_master *master, struct spi_message *msg)
+ if (!master->can_dma(master, msg->spi, xfer))
+ continue;
+
+- if (xfer->rx_buf)
+- dma_unmap_single(rx_dev, xfer->rx_dma, xfer->len,
+- DMA_FROM_DEVICE);
+- if (xfer->tx_buf)
+- dma_unmap_single(tx_dev, xfer->tx_dma, xfer->len,
+- DMA_TO_DEVICE);
++ spi_unmap_buf(master, rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE);
++ spi_unmap_buf(master, tx_dev, &xfer->tx_sg, DMA_TO_DEVICE);
+ }
+
+ return 0;
+@@ -1499,6 +1548,8 @@ int spi_register_master(struct spi_master *master)
+ mutex_init(&master->bus_lock_mutex);
+ master->bus_lock_flag = 0;
+ init_completion(&master->xfer_completion);
++ if (!master->max_dma_len)
++ master->max_dma_len = INT_MAX;
+
+ /* register the device, then userspace will see it.
+ * registration fails if the bus ID is in use.
+diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
+index c4c68093cd7c..36c86ef51ff3 100644
+--- a/include/linux/spi/spi.h
++++ b/include/linux/spi/spi.h
+@@ -24,6 +24,7 @@
+ #include <linux/slab.h>
+ #include <linux/kthread.h>
+ #include <linux/completion.h>
++#include <linux/scatterlist.h>
+
+ struct dma_chan;
+
+@@ -268,6 +269,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
+ * @auto_runtime_pm: the core should ensure a runtime PM reference is held
+ * while the hardware is prepared, using the parent
+ * device for the spidev
++ * @max_dma_len: Maximum length of a DMA transfer for the device.
+ * @prepare_transfer_hardware: a message will soon arrive from the queue
+ * so the subsystem requests the driver to prepare the transfer hardware
+ * by issuing this call
+@@ -424,6 +426,7 @@ struct spi_master {
+ bool cur_msg_prepared;
+ bool cur_msg_mapped;
+ struct completion xfer_completion;
++ size_t max_dma_len;
+
+ int (*prepare_transfer_hardware)(struct spi_master *master);
+ int (*transfer_one_message)(struct spi_master *master,
+@@ -536,6 +539,8 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
+ * (optionally) changing the chipselect status, then starting
+ * the next transfer or completing this @spi_message.
+ * @transfer_list: transfers are sequenced through @spi_message.transfers
++ * @tx_sg: Scatterlist for transmit, currently not for client use
++ * @rx_sg: Scatterlist for receive, currently not for client use
+ *
+ * SPI transfers always write the same number of bytes as they read.
+ * Protocol drivers should always provide @rx_buf and/or @tx_buf.
+@@ -603,6 +608,8 @@ struct spi_transfer {
+
+ dma_addr_t tx_dma;
+ dma_addr_t rx_dma;
++ struct sg_table tx_sg;
++ struct sg_table rx_sg;
+
+ unsigned cs_change:1;
+ unsigned tx_nbits:3;
+--
+2.1.2
+
diff --git a/patches.renesas/0147-regulator-core-Allow-regulator_set_voltage-for-fixed.patch b/patches.renesas/0147-regulator-core-Allow-regulator_set_voltage-for-fixed.patch
new file mode 100644
index 00000000000000..f6f1d9b0ed3837
--- /dev/null
+++ b/patches.renesas/0147-regulator-core-Allow-regulator_set_voltage-for-fixed.patch
@@ -0,0 +1,53 @@
+From da34517710552131881039400947fec6ec621ee7 Mon Sep 17 00:00:00 2001
+From: Bjorn Andersson <bjorn@kryo.se>
+Date: Wed, 5 Feb 2014 12:30:26 -0800
+Subject: regulator: core: Allow regulator_set_voltage for fixed regulators
+
+Make it okay to call regulator_set_voltage on regulators with fixed
+voltage if the requested range overlaps the current/configured voltage.
+
+Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c00dc359e5e0b10de993651d8e73e60c41bf29cd)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d5c3595331d512c6af6b636cef687421c2ba11e3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/core.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index afca1bc24f26..bac485acc7f3 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -2399,6 +2399,7 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
+ struct regulator_dev *rdev = regulator->rdev;
+ int ret = 0;
+ int old_min_uV, old_max_uV;
++ int current_uV;
+
+ mutex_lock(&rdev->mutex);
+
+@@ -2409,6 +2410,19 @@ int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV)
+ if (regulator->min_uV == min_uV && regulator->max_uV == max_uV)
+ goto out;
+
++ /* If we're trying to set a range that overlaps the current voltage,
++ * return succesfully even though the regulator does not support
++ * changing the voltage.
++ */
++ if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
++ current_uV = _regulator_get_voltage(rdev);
++ if (min_uV <= current_uV && current_uV <= max_uV) {
++ regulator->min_uV = min_uV;
++ regulator->max_uV = max_uV;
++ goto out;
++ }
++ }
++
+ /* sanity check */
+ if (!rdev->desc->ops->set_voltage &&
+ !rdev->desc->ops->set_voltage_sel) {
+--
+2.1.2
+
diff --git a/patches.renesas/0148-DMA-shdma-Fix-warnings-due-to-improper-casts-and-pri.patch b/patches.renesas/0148-DMA-shdma-Fix-warnings-due-to-improper-casts-and-pri.patch
new file mode 100644
index 00000000000000..21bb4554601feb
--- /dev/null
+++ b/patches.renesas/0148-DMA-shdma-Fix-warnings-due-to-improper-casts-and-pri.patch
@@ -0,0 +1,90 @@
+From 05def426e1d6c75750069a663f0f43c12ada76c4 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Wed, 11 Dec 2013 15:29:15 +0100
+Subject: DMA: shdma: Fix warnings due to improper casts and printk formats
+
+Use the %zu and %pad printk specifiers to print size_t and dma_addr_t
+variables, and cast pointers to uintptr_t instead of unsigned int where
+applicable. This fixes warnings on platforms where pointers and/or
+dma_addr_t have a different size than int
+
+Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
+Cc: Vinod Koul <vinod.koul@intel.com>
+Cc: dmaengine@vger.kernel.org
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+(cherry picked from commit 42e4a12a0d92d09de66d8b5b2c85855b8051c15e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/dma/sh/shdma-base.c | 10 +++++-----
+ drivers/dma/sh/shdma-of.c | 3 ++-
+ drivers/dma/sh/sudmac.c | 4 ++--
+ 3 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
+index 2e7b394def80..52396771acbe 100644
+--- a/drivers/dma/sh/shdma-base.c
++++ b/drivers/dma/sh/shdma-base.c
+@@ -227,7 +227,7 @@ bool shdma_chan_filter(struct dma_chan *chan, void *arg)
+ struct shdma_chan *schan = to_shdma_chan(chan);
+ struct shdma_dev *sdev = to_shdma_dev(schan->dma_chan.device);
+ const struct shdma_ops *ops = sdev->ops;
+- int match = (int)arg;
++ int match = (long)arg;
+ int ret;
+
+ if (match < 0)
+@@ -491,8 +491,8 @@ static struct shdma_desc *shdma_add_desc(struct shdma_chan *schan,
+ }
+
+ dev_dbg(schan->dev,
+- "chaining (%u/%u)@%x -> %x with %p, cookie %d\n",
+- copy_size, *len, *src, *dst, &new->async_tx,
++ "chaining (%zu/%zu)@%pad -> %pad with %p, cookie %d\n",
++ copy_size, *len, src, dst, &new->async_tx,
+ new->async_tx.cookie);
+
+ new->mark = DESC_PREPARED;
+@@ -555,8 +555,8 @@ static struct dma_async_tx_descriptor *shdma_prep_sg(struct shdma_chan *schan,
+ goto err_get_desc;
+
+ do {
+- dev_dbg(schan->dev, "Add SG #%d@%p[%d], dma %llx\n",
+- i, sg, len, (unsigned long long)sg_addr);
++ dev_dbg(schan->dev, "Add SG #%d@%p[%zu], dma %pad\n",
++ i, sg, len, &sg_addr);
+
+ if (direction == DMA_DEV_TO_MEM)
+ new = shdma_add_desc(schan, flags,
+diff --git a/drivers/dma/sh/shdma-of.c b/drivers/dma/sh/shdma-of.c
+index 06473a05fe4e..b4ff9d3e56d1 100644
+--- a/drivers/dma/sh/shdma-of.c
++++ b/drivers/dma/sh/shdma-of.c
+@@ -33,7 +33,8 @@ static struct dma_chan *shdma_of_xlate(struct of_phandle_args *dma_spec,
+ /* Only slave DMA channels can be allocated via DT */
+ dma_cap_set(DMA_SLAVE, mask);
+
+- chan = dma_request_channel(mask, shdma_chan_filter, (void *)id);
++ chan = dma_request_channel(mask, shdma_chan_filter,
++ (void *)(uintptr_t)id);
+ if (chan)
+ to_shdma_chan(chan)->hw_req = id;
+
+diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
+index c7e9cdff0708..4e7df43b50d6 100644
+--- a/drivers/dma/sh/sudmac.c
++++ b/drivers/dma/sh/sudmac.c
+@@ -178,8 +178,8 @@ static int sudmac_desc_setup(struct shdma_chan *schan,
+ struct sudmac_chan *sc = to_chan(schan);
+ struct sudmac_desc *sd = to_desc(sdesc);
+
+- dev_dbg(sc->shdma_chan.dev, "%s: src=%x, dst=%x, len=%d\n",
+- __func__, src, dst, *len);
++ dev_dbg(sc->shdma_chan.dev, "%s: src=%pad, dst=%pad, len=%zu\n",
++ __func__, &src, &dst, *len);
+
+ if (*len > schan->max_xfer_len)
+ *len = schan->max_xfer_len;
+--
+2.1.2
+
diff --git a/patches.renesas/0149-shdma-add-R-Car-Audio-DMAC-peri-peri-driver.patch b/patches.renesas/0149-shdma-add-R-Car-Audio-DMAC-peri-peri-driver.patch
new file mode 100644
index 00000000000000..dcc73a9c5f2b1f
--- /dev/null
+++ b/patches.renesas/0149-shdma-add-R-Car-Audio-DMAC-peri-peri-driver.patch
@@ -0,0 +1,419 @@
+From 4a005a3a4332c487525abd14a3df9634b4bd55bd Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 10 Mar 2014 18:11:50 -0700
+Subject: shdma: add R-Car Audio DMAC peri peri driver
+
+Add support Audio DMAC peri peri driver
+for Renesas R-Car Gen2 SoC, using 'shdma-base'
+DMA driver framework.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+[fixed checkpatch error]
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+
+(cherry picked from commit e43a34e3ec5d1b14a11c3220f5a12aa797d73cd1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/dma/sh/Kconfig | 6 +
+ drivers/dma/sh/Makefile | 1 +
+ drivers/dma/sh/rcar-audmapp.c | 320 +++++++++++++++++++++++++
+ include/linux/platform_data/dma-rcar-audmapp.h | 34 +++
+ 4 files changed, 361 insertions(+)
+ create mode 100644 drivers/dma/sh/rcar-audmapp.c
+ create mode 100644 include/linux/platform_data/dma-rcar-audmapp.h
+
+diff --git a/drivers/dma/sh/Kconfig b/drivers/dma/sh/Kconfig
+index dadd9e010c0b..b4c813831006 100644
+--- a/drivers/dma/sh/Kconfig
++++ b/drivers/dma/sh/Kconfig
+@@ -29,6 +29,12 @@ config RCAR_HPB_DMAE
+ help
+ Enable support for the Renesas R-Car series DMA controllers.
+
++config RCAR_AUDMAC_PP
++ tristate "Renesas R-Car Audio DMAC Peripheral Peripheral support"
++ depends on SH_DMAE_BASE
++ help
++ Enable support for the Renesas R-Car Audio DMAC Peripheral Peripheral controllers.
++
+ config SHDMA_R8A73A4
+ def_bool y
+ depends on ARCH_R8A73A4 && SH_DMAE != n
+diff --git a/drivers/dma/sh/Makefile b/drivers/dma/sh/Makefile
+index e856af23b789..1ce88b28cfc6 100644
+--- a/drivers/dma/sh/Makefile
++++ b/drivers/dma/sh/Makefile
+@@ -7,3 +7,4 @@ endif
+ shdma-objs := $(shdma-y)
+ obj-$(CONFIG_SUDMAC) += sudmac.o
+ obj-$(CONFIG_RCAR_HPB_DMAE) += rcar-hpbdma.o
++obj-$(CONFIG_RCAR_AUDMAC_PP) += rcar-audmapp.o
+diff --git a/drivers/dma/sh/rcar-audmapp.c b/drivers/dma/sh/rcar-audmapp.c
+new file mode 100644
+index 000000000000..2de77289a2e9
+--- /dev/null
++++ b/drivers/dma/sh/rcar-audmapp.c
+@@ -0,0 +1,320 @@
++/*
++ * This is for Renesas R-Car Audio-DMAC-peri-peri.
++ *
++ * Copyright (C) 2014 Renesas Electronics Corporation
++ * Copyright (C) 2014 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
++ *
++ * based on the drivers/dma/sh/shdma.c
++ *
++ * Copyright (C) 2011-2012 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
++ * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
++ * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
++ * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
++ *
++ * This 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/delay.h>
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/dmaengine.h>
++#include <linux/platform_data/dma-rcar-audmapp.h>
++#include <linux/platform_device.h>
++#include <linux/shdma-base.h>
++
++/*
++ * DMA register
++ */
++#define PDMASAR 0x00
++#define PDMADAR 0x04
++#define PDMACHCR 0x0c
++
++/* PDMACHCR */
++#define PDMACHCR_DE (1 << 0)
++
++#define AUDMAPP_MAX_CHANNELS 29
++
++/* Default MEMCPY transfer size = 2^2 = 4 bytes */
++#define LOG2_DEFAULT_XFER_SIZE 2
++#define AUDMAPP_SLAVE_NUMBER 256
++#define AUDMAPP_LEN_MAX (16 * 1024 * 1024)
++
++struct audmapp_chan {
++ struct shdma_chan shdma_chan;
++ struct audmapp_slave_config *config;
++ void __iomem *base;
++};
++
++struct audmapp_device {
++ struct shdma_dev shdma_dev;
++ struct audmapp_pdata *pdata;
++ struct device *dev;
++ void __iomem *chan_reg;
++};
++
++#define to_chan(chan) container_of(chan, struct audmapp_chan, shdma_chan)
++#define to_dev(chan) container_of(chan->shdma_chan.dma_chan.device, \
++ struct audmapp_device, shdma_dev.dma_dev)
++
++static void audmapp_write(struct audmapp_chan *auchan, u32 data, u32 reg)
++{
++ struct audmapp_device *audev = to_dev(auchan);
++ struct device *dev = audev->dev;
++
++ dev_dbg(dev, "w %p : %08x\n", auchan->base + reg, data);
++
++ iowrite32(data, auchan->base + reg);
++}
++
++static u32 audmapp_read(struct audmapp_chan *auchan, u32 reg)
++{
++ return ioread32(auchan->base + reg);
++}
++
++static void audmapp_halt(struct shdma_chan *schan)
++{
++ struct audmapp_chan *auchan = to_chan(schan);
++ int i;
++
++ audmapp_write(auchan, 0, PDMACHCR);
++
++ for (i = 0; i < 1024; i++) {
++ if (0 == audmapp_read(auchan, PDMACHCR))
++ return;
++ udelay(1);
++ }
++}
++
++static void audmapp_start_xfer(struct shdma_chan *schan,
++ struct shdma_desc *sdecs)
++{
++ struct audmapp_chan *auchan = to_chan(schan);
++ struct audmapp_device *audev = to_dev(auchan);
++ struct audmapp_slave_config *cfg = auchan->config;
++ struct device *dev = audev->dev;
++ u32 chcr = cfg->chcr | PDMACHCR_DE;
++
++ dev_dbg(dev, "src/dst/chcr = %pad/%pad/%x\n",
++ &cfg->src, &cfg->dst, cfg->chcr);
++
++ audmapp_write(auchan, cfg->src, PDMASAR);
++ audmapp_write(auchan, cfg->dst, PDMADAR);
++ audmapp_write(auchan, chcr, PDMACHCR);
++}
++
++static struct audmapp_slave_config *
++audmapp_find_slave(struct audmapp_chan *auchan, int slave_id)
++{
++ struct audmapp_device *audev = to_dev(auchan);
++ struct audmapp_pdata *pdata = audev->pdata;
++ struct audmapp_slave_config *cfg;
++ int i;
++
++ if (slave_id >= AUDMAPP_SLAVE_NUMBER)
++ return NULL;
++
++ for (i = 0, cfg = pdata->slave; i < pdata->slave_num; i++, cfg++)
++ if (cfg->slave_id == slave_id)
++ return cfg;
++
++ return NULL;
++}
++
++static int audmapp_set_slave(struct shdma_chan *schan, int slave_id,
++ dma_addr_t slave_addr, bool try)
++{
++ struct audmapp_chan *auchan = to_chan(schan);
++ struct audmapp_slave_config *cfg =
++ audmapp_find_slave(auchan, slave_id);
++
++ if (!cfg)
++ return -ENODEV;
++ if (try)
++ return 0;
++
++ auchan->config = cfg;
++
++ return 0;
++}
++
++static int audmapp_desc_setup(struct shdma_chan *schan,
++ struct shdma_desc *sdecs,
++ dma_addr_t src, dma_addr_t dst, size_t *len)
++{
++ struct audmapp_chan *auchan = to_chan(schan);
++ struct audmapp_slave_config *cfg = auchan->config;
++
++ if (!cfg)
++ return -ENODEV;
++
++ if (*len > (size_t)AUDMAPP_LEN_MAX)
++ *len = (size_t)AUDMAPP_LEN_MAX;
++
++ return 0;
++}
++
++static void audmapp_setup_xfer(struct shdma_chan *schan,
++ int slave_id)
++{
++}
++
++static dma_addr_t audmapp_slave_addr(struct shdma_chan *schan)
++{
++ return 0; /* always fixed address */
++}
++
++static bool audmapp_channel_busy(struct shdma_chan *schan)
++{
++ struct audmapp_chan *auchan = to_chan(schan);
++ u32 chcr = audmapp_read(auchan, PDMACHCR);
++
++ return chcr & ~PDMACHCR_DE;
++}
++
++static bool audmapp_desc_completed(struct shdma_chan *schan,
++ struct shdma_desc *sdesc)
++{
++ return true;
++}
++
++static struct shdma_desc *audmapp_embedded_desc(void *buf, int i)
++{
++ return &((struct shdma_desc *)buf)[i];
++}
++
++static const struct shdma_ops audmapp_shdma_ops = {
++ .halt_channel = audmapp_halt,
++ .desc_setup = audmapp_desc_setup,
++ .set_slave = audmapp_set_slave,
++ .start_xfer = audmapp_start_xfer,
++ .embedded_desc = audmapp_embedded_desc,
++ .setup_xfer = audmapp_setup_xfer,
++ .slave_addr = audmapp_slave_addr,
++ .channel_busy = audmapp_channel_busy,
++ .desc_completed = audmapp_desc_completed,
++};
++
++static int audmapp_chan_probe(struct platform_device *pdev,
++ struct audmapp_device *audev, int id)
++{
++ struct shdma_dev *sdev = &audev->shdma_dev;
++ struct audmapp_chan *auchan;
++ struct shdma_chan *schan;
++ struct device *dev = audev->dev;
++
++ auchan = devm_kzalloc(dev, sizeof(*auchan), GFP_KERNEL);
++ if (!auchan)
++ return -ENOMEM;
++
++ schan = &auchan->shdma_chan;
++ schan->max_xfer_len = AUDMAPP_LEN_MAX;
++
++ shdma_chan_probe(sdev, schan, id);
++
++ auchan->base = audev->chan_reg + 0x20 + (0x10 * id);
++ dev_dbg(dev, "%02d : %p / %p", id, auchan->base, audev->chan_reg);
++
++ return 0;
++}
++
++static void audmapp_chan_remove(struct audmapp_device *audev)
++{
++ struct dma_device *dma_dev = &audev->shdma_dev.dma_dev;
++ struct shdma_chan *schan;
++ int i;
++
++ shdma_for_each_chan(schan, &audev->shdma_dev, i) {
++ BUG_ON(!schan);
++ shdma_chan_remove(schan);
++ }
++ dma_dev->chancnt = 0;
++}
++
++static int audmapp_probe(struct platform_device *pdev)
++{
++ struct audmapp_pdata *pdata = pdev->dev.platform_data;
++ struct audmapp_device *audev;
++ struct shdma_dev *sdev;
++ struct dma_device *dma_dev;
++ struct resource *res;
++ int err, i;
++
++ if (!pdata)
++ return -ENODEV;
++
++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++
++ audev = devm_kzalloc(&pdev->dev, sizeof(*audev), GFP_KERNEL);
++ if (!audev)
++ return -ENOMEM;
++
++ audev->dev = &pdev->dev;
++ audev->pdata = pdata;
++ audev->chan_reg = devm_ioremap_resource(&pdev->dev, res);
++ if (IS_ERR(audev->chan_reg))
++ return PTR_ERR(audev->chan_reg);
++
++ sdev = &audev->shdma_dev;
++ sdev->ops = &audmapp_shdma_ops;
++ sdev->desc_size = sizeof(struct shdma_desc);
++
++ dma_dev = &sdev->dma_dev;
++ dma_dev->copy_align = LOG2_DEFAULT_XFER_SIZE;
++ dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);
++
++ err = shdma_init(&pdev->dev, sdev, AUDMAPP_MAX_CHANNELS);
++ if (err < 0)
++ return err;
++
++ platform_set_drvdata(pdev, audev);
++
++ /* Create DMA Channel */
++ for (i = 0; i < AUDMAPP_MAX_CHANNELS; i++) {
++ err = audmapp_chan_probe(pdev, audev, i);
++ if (err)
++ goto chan_probe_err;
++ }
++
++ err = dma_async_device_register(dma_dev);
++ if (err < 0)
++ goto chan_probe_err;
++
++ return err;
++
++chan_probe_err:
++ audmapp_chan_remove(audev);
++ shdma_cleanup(sdev);
++
++ return err;
++}
++
++static int audmapp_remove(struct platform_device *pdev)
++{
++ struct audmapp_device *audev = platform_get_drvdata(pdev);
++ struct dma_device *dma_dev = &audev->shdma_dev.dma_dev;
++
++ dma_async_device_unregister(dma_dev);
++
++ audmapp_chan_remove(audev);
++ shdma_cleanup(&audev->shdma_dev);
++
++ return 0;
++}
++
++static struct platform_driver audmapp_driver = {
++ .probe = audmapp_probe,
++ .remove = audmapp_remove,
++ .driver = {
++ .owner = THIS_MODULE,
++ .name = "rcar-audmapp-engine",
++ },
++};
++module_platform_driver(audmapp_driver);
++
++MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
++MODULE_DESCRIPTION("Renesas R-Car Audio DMAC peri-peri driver");
++MODULE_LICENSE("GPL");
+diff --git a/include/linux/platform_data/dma-rcar-audmapp.h b/include/linux/platform_data/dma-rcar-audmapp.h
+new file mode 100644
+index 000000000000..471fffebbeb4
+--- /dev/null
++++ b/include/linux/platform_data/dma-rcar-audmapp.h
+@@ -0,0 +1,34 @@
++/*
++ * This is for Renesas R-Car Audio-DMAC-peri-peri.
++ *
++ * Copyright (C) 2014 Renesas Electronics Corporation
++ * Copyright (C) 2014 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
++ *
++ * This file is based on the include/linux/sh_dma.h
++ *
++ * Header for the new SH dmaengine driver
++ *
++ * Copyright (C) 2010 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 SH_AUDMAPP_H
++#define SH_AUDMAPP_H
++
++#include <linux/dmaengine.h>
++
++struct audmapp_slave_config {
++ int slave_id;
++ dma_addr_t src;
++ dma_addr_t dst;
++ u32 chcr;
++};
++
++struct audmapp_pdata {
++ struct audmapp_slave_config *slave;
++ int slave_num;
++};
++
++#endif /* SH_AUDMAPP_H */
+--
+2.1.2
+
diff --git a/patches.renesas/0150-of-add-functions-to-count-number-of-elements-in-a-pr.patch b/patches.renesas/0150-of-add-functions-to-count-number-of-elements-in-a-pr.patch
new file mode 100644
index 00000000000000..9c362630d8b333
--- /dev/null
+++ b/patches.renesas/0150-of-add-functions-to-count-number-of-elements-in-a-pr.patch
@@ -0,0 +1,171 @@
+From ae34ad43660203b9c5264ef2f281eb4aea5240a0 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Date: Wed, 12 Feb 2014 01:00:34 +0100
+Subject: of: add functions to count number of elements in a property
+
+The need to know the number of array elements in a property is
+a common pattern. To prevent duplication of open-coded implementations
+add a helper static function that also centralises strict sanity
+checking and DTB format details, as well as a set of wrapper functions
+for u8, u16, u32 and u64.
+
+Suggested-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Acked-by: Rob Herring <robh@kernel.org>
+Acked-by: Grant Likely <grant.likely@linaro.org>
+Acked-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ad54a0cfbeb4bd4033d09017557ccbc423f9d5ff)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/of/base.c | 32 +++++++++++++++++++++++
+ include/linux/of.h | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 108 insertions(+)
+
+diff --git a/drivers/of/base.c b/drivers/of/base.c
+index 89e888a78899..1b95a405628f 100644
+--- a/drivers/of/base.c
++++ b/drivers/of/base.c
+@@ -904,6 +904,38 @@ struct device_node *of_find_node_by_phandle(phandle handle)
+ EXPORT_SYMBOL(of_find_node_by_phandle);
+
+ /**
++ * of_property_count_elems_of_size - Count the number of elements in a property
++ *
++ * @np: device node from which the property value is to be read.
++ * @propname: name of the property to be searched.
++ * @elem_size: size of the individual element
++ *
++ * Search for a property in a device node and count the number of elements of
++ * size elem_size in it. Returns number of elements on sucess, -EINVAL if the
++ * property does not exist or its length does not match a multiple of elem_size
++ * and -ENODATA if the property does not have a value.
++ */
++int of_property_count_elems_of_size(const struct device_node *np,
++ const char *propname, int elem_size)
++{
++ struct property *prop = of_find_property(np, propname, NULL);
++
++ if (!prop)
++ return -EINVAL;
++ if (!prop->value)
++ return -ENODATA;
++
++ if (prop->length % elem_size != 0) {
++ pr_err("size of %s in node %s is not a multiple of %d\n",
++ propname, np->full_name, elem_size);
++ return -EINVAL;
++ }
++
++ return prop->length / elem_size;
++}
++EXPORT_SYMBOL_GPL(of_property_count_elems_of_size);
++
++/**
+ * of_find_property_value_of_size
+ *
+ * @np: device node from which the property value is to be read.
+diff --git a/include/linux/of.h b/include/linux/of.h
+index 435cb995904d..83d1ac80c91e 100644
+--- a/include/linux/of.h
++++ b/include/linux/of.h
+@@ -198,6 +198,8 @@ extern struct device_node *of_find_node_with_property(
+ extern struct property *of_find_property(const struct device_node *np,
+ const char *name,
+ int *lenp);
++extern int of_property_count_elems_of_size(const struct device_node *np,
++ const char *propname, int elem_size);
+ extern int of_property_read_u32_index(const struct device_node *np,
+ const char *propname,
+ u32 index, u32 *out_value);
+@@ -390,6 +392,12 @@ static inline struct device_node *of_find_compatible_node(
+ return NULL;
+ }
+
++static inline int of_property_count_elems_of_size(const struct device_node *np,
++ const char *propname, int elem_size)
++{
++ return -ENOSYS;
++}
++
+ static inline int of_property_read_u32_index(const struct device_node *np,
+ const char *propname, u32 index, u32 *out_value)
+ {
+@@ -536,6 +544,74 @@ static inline struct device_node *of_find_matching_node(
+ }
+
+ /**
++ * of_property_count_u8_elems - Count the number of u8 elements in a property
++ *
++ * @np: device node from which the property value is to be read.
++ * @propname: name of the property to be searched.
++ *
++ * Search for a property in a device node and count the number of u8 elements
++ * in it. Returns number of elements on sucess, -EINVAL if the property does
++ * not exist or its length does not match a multiple of u8 and -ENODATA if the
++ * property does not have a value.
++ */
++static inline int of_property_count_u8_elems(const struct device_node *np,
++ const char *propname)
++{
++ return of_property_count_elems_of_size(np, propname, sizeof(u8));
++}
++
++/**
++ * of_property_count_u16_elems - Count the number of u16 elements in a property
++ *
++ * @np: device node from which the property value is to be read.
++ * @propname: name of the property to be searched.
++ *
++ * Search for a property in a device node and count the number of u16 elements
++ * in it. Returns number of elements on sucess, -EINVAL if the property does
++ * not exist or its length does not match a multiple of u16 and -ENODATA if the
++ * property does not have a value.
++ */
++static inline int of_property_count_u16_elems(const struct device_node *np,
++ const char *propname)
++{
++ return of_property_count_elems_of_size(np, propname, sizeof(u16));
++}
++
++/**
++ * of_property_count_u32_elems - Count the number of u32 elements in a property
++ *
++ * @np: device node from which the property value is to be read.
++ * @propname: name of the property to be searched.
++ *
++ * Search for a property in a device node and count the number of u32 elements
++ * in it. Returns number of elements on sucess, -EINVAL if the property does
++ * not exist or its length does not match a multiple of u32 and -ENODATA if the
++ * property does not have a value.
++ */
++static inline int of_property_count_u32_elems(const struct device_node *np,
++ const char *propname)
++{
++ return of_property_count_elems_of_size(np, propname, sizeof(u32));
++}
++
++/**
++ * of_property_count_u64_elems - Count the number of u64 elements in a property
++ *
++ * @np: device node from which the property value is to be read.
++ * @propname: name of the property to be searched.
++ *
++ * Search for a property in a device node and count the number of u64 elements
++ * in it. Returns number of elements on sucess, -EINVAL if the property does
++ * not exist or its length does not match a multiple of u64 and -ENODATA if the
++ * property does not have a value.
++ */
++static inline int of_property_count_u64_elems(const struct device_node *np,
++ const char *propname)
++{
++ return of_property_count_elems_of_size(np, propname, sizeof(u64));
++}
++
++/**
+ * of_property_read_bool - Findfrom a property
+ * @np: device node from which the property value is to be read.
+ * @propname: name of the property to be searched.
+--
+2.1.2
+
diff --git a/patches.renesas/0151-ASoC-add-snd_soc_of_parse_audio_simple_widgets-for-D.patch b/patches.renesas/0151-ASoC-add-snd_soc_of_parse_audio_simple_widgets-for-D.patch
new file mode 100644
index 00000000000000..a34a1bf03f851b
--- /dev/null
+++ b/patches.renesas/0151-ASoC-add-snd_soc_of_parse_audio_simple_widgets-for-D.patch
@@ -0,0 +1,144 @@
+From 1a9a16b92ac95caea67821067224e19da1597f4c Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Sat, 8 Feb 2014 15:59:52 +0800
+Subject: ASoC: add snd_soc_of_parse_audio_simple_widgets for DT
+
+This patch adds snd_soc_of_parse_audio_simple_widgets() and supports
+below style of widgets name on DT:
+
+ "template-wname", "user supplied wname"
+
+For instance:
+ simple-audio-widgets =
+ "Microphone", "Microphone Jack",
+ "Line", "Line In Jack",
+ "Line", "Line Out Jack",
+ "Headphone", "Headphone Jack",
+ "Speaker", "Speaker External";
+
+The "template-wname" currently includes: "Microphone", "Line", "Headphone"
+and "Speaker".
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9a6d48605e632e84db2895cf752c65b3c908cd09)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/soc.h | 2 ++
+ sound/soc/soc-core.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 89 insertions(+)
+
+diff --git a/include/sound/soc.h b/include/sound/soc.h
+index 9a001472b96a..465dc6e0674d 100644
+--- a/include/sound/soc.h
++++ b/include/sound/soc.h
+@@ -1173,6 +1173,8 @@ void snd_soc_util_exit(void);
+
+ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
+ const char *propname);
++int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
++ const char *propname);
+ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
+ const char *propname);
+ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
+diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
+index fe1df50805a3..0540cb08e0ea 100644
+--- a/sound/soc/soc-core.c
++++ b/sound/soc/soc-core.c
+@@ -4417,6 +4417,93 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
+ }
+ EXPORT_SYMBOL_GPL(snd_soc_of_parse_card_name);
+
++static const struct snd_soc_dapm_widget simple_widgets[] = {
++ SND_SOC_DAPM_MIC("Microphone", NULL),
++ SND_SOC_DAPM_LINE("Line", NULL),
++ SND_SOC_DAPM_HP("Headphone", NULL),
++ SND_SOC_DAPM_SPK("Speaker", NULL),
++};
++
++int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
++ const char *propname)
++{
++ struct device_node *np = card->dev->of_node;
++ struct snd_soc_dapm_widget *widgets;
++ const char *template, *wname;
++ int i, j, num_widgets, ret;
++
++ num_widgets = of_property_count_strings(np, propname);
++ if (num_widgets < 0) {
++ dev_err(card->dev,
++ "ASoC: Property '%s' does not exist\n", propname);
++ return -EINVAL;
++ }
++ if (num_widgets & 1) {
++ dev_err(card->dev,
++ "ASoC: Property '%s' length is not even\n", propname);
++ return -EINVAL;
++ }
++
++ num_widgets /= 2;
++ if (!num_widgets) {
++ dev_err(card->dev, "ASoC: Property '%s's length is zero\n",
++ propname);
++ return -EINVAL;
++ }
++
++ widgets = devm_kcalloc(card->dev, num_widgets, sizeof(*widgets),
++ GFP_KERNEL);
++ if (!widgets) {
++ dev_err(card->dev,
++ "ASoC: Could not allocate memory for widgets\n");
++ return -ENOMEM;
++ }
++
++ for (i = 0; i < num_widgets; i++) {
++ ret = of_property_read_string_index(np, propname,
++ 2 * i, &template);
++ if (ret) {
++ dev_err(card->dev,
++ "ASoC: Property '%s' index %d read error:%d\n",
++ propname, 2 * i, ret);
++ return -EINVAL;
++ }
++
++ for (j = 0; j < ARRAY_SIZE(simple_widgets); j++) {
++ if (!strncmp(template, simple_widgets[j].name,
++ strlen(simple_widgets[j].name))) {
++ widgets[i] = simple_widgets[j];
++ break;
++ }
++ }
++
++ if (j >= ARRAY_SIZE(simple_widgets)) {
++ dev_err(card->dev,
++ "ASoC: DAPM widget '%s' is not supported\n",
++ template);
++ return -EINVAL;
++ }
++
++ ret = of_property_read_string_index(np, propname,
++ (2 * i) + 1,
++ &wname);
++ if (ret) {
++ dev_err(card->dev,
++ "ASoC: Property '%s' index %d read error:%d\n",
++ propname, (2 * i) + 1, ret);
++ return -EINVAL;
++ }
++
++ widgets[i].name = wname;
++ }
++
++ card->dapm_widgets = widgets;
++ card->num_dapm_widgets = num_widgets;
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets);
++
+ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
+ const char *propname)
+ {
+--
+2.1.2
+
diff --git a/patches.renesas/0152-ASoC-core-add-TDM-slot-parsing-from-DT-supports.patch b/patches.renesas/0152-ASoC-core-add-TDM-slot-parsing-from-DT-supports.patch
new file mode 100644
index 00000000000000..7e2b1592b009f7
--- /dev/null
+++ b/patches.renesas/0152-ASoC-core-add-TDM-slot-parsing-from-DT-supports.patch
@@ -0,0 +1,149 @@
+From 0063caf83ab43e26efc2c1b9e829b1a7a024e7c0 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Fri, 14 Feb 2014 09:34:35 +0800
+Subject: ASoC: core: add TDM slot parsing from DT supports
+
+For some CPU/CODEC DAI devices the TDM slot infomation maybe needed. This
+patch adds the slot parsing from DT supports.
+
+TDM slot properties:
+ dai-tdm-slot-num : Number of slots in use.
+ dai-tdm-slot-width : Width in bits for each slot.
+
+For instance:
+ dai-tdm-slot-num = <2>;
+ dai-tdm-slot-width = <8>;
+
+And for each spcified driver, there could be one .of_xlate_tdm_slot_mask()
+to specify a explicit mapping of the channels and the slots. If it's absent
+the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the
+tx and rx masks.
+
+For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit
+for an active slot as default, and the default active bits are at the LSB of
+the masks.
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 89c6785715592a6b082b3f9f28c27bb14b041c7d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/soc-dai.h | 2 ++
+ include/sound/soc.h | 3 +++
+ sound/soc/soc-core.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 64 insertions(+)
+
+diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
+index 71f27c403194..d86e0fc41e80 100644
+--- a/include/sound/soc-dai.h
++++ b/include/sound/soc-dai.h
+@@ -142,6 +142,8 @@ struct snd_soc_dai_ops {
+ * Called by soc_card drivers, normally in their hw_params.
+ */
+ int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);
++ int (*of_xlate_tdm_slot_mask)(unsigned int slots,
++ unsigned int *tx_mask, unsigned int *rx_mask);
+ int (*set_tdm_slot)(struct snd_soc_dai *dai,
+ unsigned int tx_mask, unsigned int rx_mask,
+ int slots, int slot_width);
+diff --git a/include/sound/soc.h b/include/sound/soc.h
+index 465dc6e0674d..2a878d03c147 100644
+--- a/include/sound/soc.h
++++ b/include/sound/soc.h
+@@ -1175,6 +1175,9 @@ int snd_soc_of_parse_card_name(struct snd_soc_card *card,
+ const char *propname);
+ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
+ const char *propname);
++int snd_soc_of_parse_tdm_slot(struct device_node *np,
++ unsigned int *slots,
++ unsigned int *slot_width);
+ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
+ const char *propname);
+ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
+diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
+index 0540cb08e0ea..5b7d3ba87c7a 100644
+--- a/sound/soc/soc-core.c
++++ b/sound/soc/soc-core.c
+@@ -3609,6 +3609,30 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
+
+ /**
++ * snd_soc_of_xlate_tdm_slot - generate tx/rx slot mask.
++ * @slots: Number of slots in use.
++ * @tx_mask: bitmask representing active TX slots.
++ * @rx_mask: bitmask representing active RX slots.
++ *
++ * Generates the TDM tx and rx slot default masks for DAI.
++ */
++static int snd_soc_of_xlate_tdm_slot_mask(unsigned int slots,
++ unsigned int *tx_mask,
++ unsigned int *rx_mask)
++{
++ if (*tx_mask || *rx_mask)
++ return 0;
++
++ if (!slots)
++ return -EINVAL;
++
++ *tx_mask = (1 << slots) - 1;
++ *rx_mask = (1 << slots) - 1;
++
++ return 0;
++}
++
++/**
+ * snd_soc_dai_set_tdm_slot - configure DAI TDM.
+ * @dai: DAI
+ * @tx_mask: bitmask representing active TX slots.
+@@ -3622,6 +3646,12 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_set_fmt);
+ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
+ unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
+ {
++ if (dai->driver && dai->driver->ops->of_xlate_tdm_slot_mask)
++ dai->driver->ops->of_xlate_tdm_slot_mask(slots,
++ &tx_mask, &rx_mask);
++ else
++ snd_soc_of_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask);
++
+ if (dai->driver && dai->driver->ops->set_tdm_slot)
+ return dai->driver->ops->set_tdm_slot(dai, tx_mask, rx_mask,
+ slots, slot_width);
+@@ -4504,6 +4534,35 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
+ }
+ EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_simple_widgets);
+
++int snd_soc_of_parse_tdm_slot(struct device_node *np,
++ unsigned int *slots,
++ unsigned int *slot_width)
++{
++ u32 val;
++ int ret;
++
++ if (of_property_read_bool(np, "dai-tdm-slot-num")) {
++ ret = of_property_read_u32(np, "dai-tdm-slot-num", &val);
++ if (ret)
++ return ret;
++
++ if (slots)
++ *slots = val;
++ }
++
++ if (of_property_read_bool(np, "dai-tdm-slot-width")) {
++ ret = of_property_read_u32(np, "dai-tdm-slot-width", &val);
++ if (ret)
++ return ret;
++
++ if (slot_width)
++ *slot_width = val;
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot);
++
+ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
+ const char *propname)
+ {
+--
+2.1.2
+
diff --git a/patches.renesas/0153-clocksource-Add-Kconfig-entries-for-CMT-MTU2-TMU-and.patch b/patches.renesas/0153-clocksource-Add-Kconfig-entries-for-CMT-MTU2-TMU-and.patch
new file mode 100644
index 00000000000000..a327f977f74b1f
--- /dev/null
+++ b/patches.renesas/0153-clocksource-Add-Kconfig-entries-for-CMT-MTU2-TMU-and.patch
@@ -0,0 +1,74 @@
+From 6a415e552e53b859d7127464270c251165e72f30 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 20 Feb 2014 12:54:45 +0100
+Subject: clocksource: Add Kconfig entries for CMT, MTU2, TMU and STI
+
+Add Kconfig entries for CMT, MTU2, TMU and STI to
+drivers/clocksource/Kconfig. This will allow us to
+get rid of duplicated entires in architecture code
+such as arch/sh and arch/arm/mach-shmobile.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+(cherry picked from commit fd3f1270d237d1afb344ee6bfd0e50c488c29e34)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/clocksource/Kconfig | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
+index cd6950fd8caf..4f754a972139 100644
+--- a/drivers/clocksource/Kconfig
++++ b/drivers/clocksource/Kconfig
+@@ -140,3 +140,47 @@ config VF_PIT_TIMER
+ bool
+ help
+ Support for Period Interrupt Timer on Freescale Vybrid Family SoCs.
++
++config SYS_SUPPORTS_SH_CMT
++ bool
++
++config SYS_SUPPORTS_SH_MTU2
++ bool
++
++config SYS_SUPPORTS_SH_TMU
++ bool
++
++config SYS_SUPPORTS_EM_STI
++ bool
++
++config SH_TIMER_CMT
++ bool "Renesas CMT timer driver" if COMPILE_TEST
++ default SYS_SUPPORTS_SH_CMT
++ help
++ This enables build of a clocksource and clockevent driver for
++ the Compare Match Timer (CMT) hardware available in 16/32/48-bit
++ variants on a wide range of Mobile and Automotive SoCs from Renesas.
++
++config SH_TIMER_MTU2
++ bool "Renesas MTU2 timer driver" if COMPILE_TEST
++ default SYS_SUPPORTS_SH_MTU2
++ help
++ This enables build of a clockevent driver for the Multi-Function
++ Timer Pulse Unit 2 (TMU2) hardware available on SoCs from Renesas.
++ This hardware comes with 16 bit-timer registers.
++
++config SH_TIMER_TMU
++ bool "Renesas TMU timer driver" if COMPILE_TEST
++ default SYS_SUPPORTS_SH_TMU
++ help
++ This enables build of a clocksource and clockevent driver for
++ the 32-bit Timer Unit (TMU) hardware available on a wide range
++ SoCs from Renesas.
++
++config EM_TIMER_STI
++ bool "Renesas STI timer driver" if COMPILE_TEST
++ default SYS_SUPPORTS_EM_STI
++ help
++ This enables build of a clocksource and clockevent driver for
++ the 48-bit System Timer (STI) hardware available on a SoCs
++ such as EMEV2 from former NEC Electronics.
+--
+2.1.2
+
diff --git a/patches.renesas/0154-clocksource-CMT-MTU2-TMU-and-STI-should-depend-on-GE.patch b/patches.renesas/0154-clocksource-CMT-MTU2-TMU-and-STI-should-depend-on-GE.patch
new file mode 100644
index 00000000000000..0a0edbe436b012
--- /dev/null
+++ b/patches.renesas/0154-clocksource-CMT-MTU2-TMU-and-STI-should-depend-on-GE.patch
@@ -0,0 +1,78 @@
+From 6eebf8e07c5018c43adc98bd244d27878e2770d8 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Thu, 20 Mar 2014 15:05:50 +0100
+Subject: clocksource: CMT, MTU2, TMU and STI should depend on
+ GENERIC_CLOCKEVENTS
+
+If GENERIC_CLOCKEVENTS=n:
+
+drivers/clocksource/sh_cmt.c:54:28: error: field 'ced' has incomplete type
+drivers/clocksource/sh_cmt.c: In function 'sh_cmt_interrupt':
+drivers/clocksource/sh_cmt.c:407:23: error: 'CLOCK_EVT_MODE_ONESHOT' undeclared (first use in this function)
+
+drivers/clocksource/sh_mtu2.c:44:28: error: field 'ced' has incomplete type
+drivers/clocksource/sh_mtu2.c: In function 'ced_to_sh_mtu2':
+drivers/clocksource/sh_mtu2.c:184:70: warning: initialization from incompatible pointer type [enabled by default]
+drivers/clocksource/sh_mtu2.c: At top level:
+drivers/clocksource/sh_mtu2.c:188:16: warning: 'enum clock_event_mode' declared inside parameter list [enabled by default]
+
+drivers/clocksource/sh_tmu.c:45:28: error: field 'ced' has incomplete type
+drivers/clocksource/sh_tmu.c: In function 'sh_tmu_interrupt':
+drivers/clocksource/sh_tmu.c:207:21: error: 'CLOCK_EVT_MODE_ONESHOT' undeclared (first use in this function)
+
+drivers/clocksource/em_sti.c:44:28: error: field 'ced' has incomplete type
+drivers/clocksource/em_sti.c: In function 'ced_to_em_sti':
+drivers/clocksource/em_sti.c:251:69: warning: initialization from incompatible pointer type [enabled by default]
+drivers/clocksource/em_sti.c: At top level:
+drivers/clocksource/em_sti.c:255:16: warning: 'enum clock_event_mode' declared inside parameter list [enabled by default]
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Cc: Magnus Damm <damm@opensource.se>
+Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
+Link: http://lkml.kernel.org/r/1395324352-9146-1-git-send-email-geert@linux-m68k.org
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+(cherry picked from commit 87291a9267ecc0a8efceb4d9cbd4da870f958fc1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/clocksource/Kconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
+index 4f754a972139..52e9329e3c51 100644
+--- a/drivers/clocksource/Kconfig
++++ b/drivers/clocksource/Kconfig
+@@ -155,6 +155,7 @@ config SYS_SUPPORTS_EM_STI
+
+ config SH_TIMER_CMT
+ bool "Renesas CMT timer driver" if COMPILE_TEST
++ depends on GENERIC_CLOCKEVENTS
+ default SYS_SUPPORTS_SH_CMT
+ help
+ This enables build of a clocksource and clockevent driver for
+@@ -163,6 +164,7 @@ config SH_TIMER_CMT
+
+ config SH_TIMER_MTU2
+ bool "Renesas MTU2 timer driver" if COMPILE_TEST
++ depends on GENERIC_CLOCKEVENTS
+ default SYS_SUPPORTS_SH_MTU2
+ help
+ This enables build of a clockevent driver for the Multi-Function
+@@ -171,6 +173,7 @@ config SH_TIMER_MTU2
+
+ config SH_TIMER_TMU
+ bool "Renesas TMU timer driver" if COMPILE_TEST
++ depends on GENERIC_CLOCKEVENTS
+ default SYS_SUPPORTS_SH_TMU
+ help
+ This enables build of a clocksource and clockevent driver for
+@@ -179,6 +182,7 @@ config SH_TIMER_TMU
+
+ config EM_TIMER_STI
+ bool "Renesas STI timer driver" if COMPILE_TEST
++ depends on GENERIC_CLOCKEVENTS
+ default SYS_SUPPORTS_EM_STI
+ help
+ This enables build of a clocksource and clockevent driver for
+--
+2.1.2
+
diff --git a/patches.renesas/0155-regulator-gpio-regulator-Remove-unneeded-OOM-error-m.patch b/patches.renesas/0155-regulator-gpio-regulator-Remove-unneeded-OOM-error-m.patch
new file mode 100644
index 00000000000000..473c0a9f5d5318
--- /dev/null
+++ b/patches.renesas/0155-regulator-gpio-regulator-Remove-unneeded-OOM-error-m.patch
@@ -0,0 +1,35 @@
+From 4a44aab126539a33973bd8ff676876eda0ab2732 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <fabio.estevam@freescale.com>
+Date: Fri, 24 Jan 2014 15:48:18 -0200
+Subject: regulator: gpio-regulator: Remove unneeded OOM error message
+
+There is no need to print an OOM message after devm_kzalloc, since there is
+a generic OOM message in place.
+
+Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9c25960cbba1fb452adf6a7b9d740fc4358f7d92)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/gpio-regulator.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
+index c0a1d00b78c9..bad44f366b3f 100644
+--- a/drivers/regulator/gpio-regulator.c
++++ b/drivers/regulator/gpio-regulator.c
+@@ -239,10 +239,8 @@ static int gpio_regulator_probe(struct platform_device *pdev)
+
+ drvdata = devm_kzalloc(&pdev->dev, sizeof(struct gpio_regulator_data),
+ GFP_KERNEL);
+- if (drvdata == NULL) {
+- dev_err(&pdev->dev, "Failed to allocate device data\n");
++ if (drvdata == NULL)
+ return -ENOMEM;
+- }
+
+ drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);
+ if (drvdata->desc.name == NULL) {
+--
+2.1.2
+
diff --git a/patches.renesas/0156-regulator-gpio-add-gpios-status-for-DT.patch b/patches.renesas/0156-regulator-gpio-add-gpios-status-for-DT.patch
new file mode 100644
index 00000000000000..9d3d8aab0e34e5
--- /dev/null
+++ b/patches.renesas/0156-regulator-gpio-add-gpios-status-for-DT.patch
@@ -0,0 +1,64 @@
+From 4182ab8f3cbbf0495bb760341da9631fd6981aec Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 30 Jan 2014 21:25:14 -0800
+Subject: regulator: gpio: add gpios-status for DT
+
+config->gpios[x].flags indicates initial pin status,
+and it will be used for drvdata->state
+on gpio_regulator_probe().
+But, current of_get_gpio_regulator_config() doesn't care
+about this flags.
+This patch adds new gpios-status property in order to
+care about initial pin status.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 0094050d783bbadffe83effef11a0bda901153ce)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/regulator/gpio-regulator.txt | 1 +
+ drivers/regulator/gpio-regulator.c | 11 +++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+index 63c659800c03..3ecb585e786c 100644
+--- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
++++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+@@ -8,6 +8,7 @@ Required properties:
+ Optional properties:
+ - enable-gpio : GPIO to use to enable/disable the regulator.
+ - gpios : GPIO group used to control voltage.
++- gpios-states : gpios pin's initial states. 1 means HIGH
+ - startup-delay-us : Startup time in microseconds.
+ - enable-active-high : Polarity of GPIO is active high (default is low).
+
+diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
+index bad44f366b3f..ac3a8c732dd8 100644
+--- a/drivers/regulator/gpio-regulator.c
++++ b/drivers/regulator/gpio-regulator.c
+@@ -172,11 +172,22 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ if (!config->gpios)
+ return ERR_PTR(-ENOMEM);
+
++ prop = of_find_property(np, "gpios-states", NULL);
++ if (prop) {
++ proplen = prop->length / sizeof(int);
++ if (proplen != config->nr_gpios) {
++ /* gpios <-> gpios-states mismatch */
++ prop = NULL;
++ }
++ }
++
+ for (i = 0; i < config->nr_gpios; i++) {
+ gpio = of_get_named_gpio(np, "gpios", i);
+ if (gpio < 0)
+ break;
+ config->gpios[i].gpio = gpio;
++ if (prop && be32_to_cpup((int *)prop->value + i))
++ config->gpios[i].flags = GPIOF_OUT_INIT_HIGH;
+ }
+
+ /* Fetch states. */
+--
+2.1.2
+
diff --git a/patches.renesas/0157-regulator-gpio-Document-regulator-type-property.patch b/patches.renesas/0157-regulator-gpio-Document-regulator-type-property.patch
new file mode 100644
index 00000000000000..b895bbdda102f1
--- /dev/null
+++ b/patches.renesas/0157-regulator-gpio-Document-regulator-type-property.patch
@@ -0,0 +1,29 @@
+From 1af393e5d993bbe2913c596f76be0a0948eee85d Mon Sep 17 00:00:00 2001
+From: Mark Brown <broonie@linaro.org>
+Date: Thu, 5 Dec 2013 19:08:55 +0000
+Subject: regulator: gpio: Document regulator-type property
+
+Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 7f196ec938967af7c3aa2506b8edcd7da5f5ebc6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+index 3ecb585e786c..5da9a66e6981 100644
+--- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
++++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+@@ -11,6 +11,8 @@ Optional properties:
+ - gpios-states : gpios pin's initial states. 1 means HIGH
+ - startup-delay-us : Startup time in microseconds.
+ - enable-active-high : Polarity of GPIO is active high (default is low).
++- regulator-type : Specifies what is being regulated, must be either
++ "voltage" or "current", defaults to current.
+
+ Any property defined as part of the core regulator binding defined in
+ regulator.txt can also be used.
+--
+2.1.2
+
diff --git a/patches.renesas/0158-regulator-gpio-print-warning-if-gpios-gpios-states-m.patch b/patches.renesas/0158-regulator-gpio-print-warning-if-gpios-gpios-states-m.patch
new file mode 100644
index 00000000000000..09a46b94306630
--- /dev/null
+++ b/patches.renesas/0158-regulator-gpio-print-warning-if-gpios-gpios-states-m.patch
@@ -0,0 +1,30 @@
+From 6c2dc14f9bfc3067723b3b99573c7f7fccd36b2d Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 17:27:08 -0800
+Subject: regulator: gpio: print warning if gpios <-> gpios-states mismatch on
+ DT
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 5676ddc5c62861467582b10b88aadb25ea9c3b52)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/gpio-regulator.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
+index ac3a8c732dd8..5491ceeb53cc 100644
+--- a/drivers/regulator/gpio-regulator.c
++++ b/drivers/regulator/gpio-regulator.c
+@@ -176,7 +176,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ if (prop) {
+ proplen = prop->length / sizeof(int);
+ if (proplen != config->nr_gpios) {
+- /* gpios <-> gpios-states mismatch */
++ dev_warn(dev, "gpios <-> gpios-states mismatch\n");
+ prop = NULL;
+ }
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0159-regulator-gpio-explain-detail-of-gpios-states.patch b/patches.renesas/0159-regulator-gpio-explain-detail-of-gpios-states.patch
new file mode 100644
index 00000000000000..1caf60bd142a2a
--- /dev/null
+++ b/patches.renesas/0159-regulator-gpio-explain-detail-of-gpios-states.patch
@@ -0,0 +1,32 @@
+From 705b3dd4d35c60ff13f5b749423b39fc22a5d85e Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 11 Feb 2014 17:27:27 -0800
+Subject: regulator: gpio: explain detail of gpios-states
+
+gpios-states is array, and default is 0
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 907339818ecd66c20f57bbf53d1160c3dc9d34a8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/regulator/gpio-regulator.txt | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+index 5da9a66e6981..e5cac1e0ca8a 100644
+--- a/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
++++ b/Documentation/devicetree/bindings/regulator/gpio-regulator.txt
+@@ -8,7 +8,8 @@ Required properties:
+ Optional properties:
+ - enable-gpio : GPIO to use to enable/disable the regulator.
+ - gpios : GPIO group used to control voltage.
+-- gpios-states : gpios pin's initial states. 1 means HIGH
++- gpios-states : gpios pin's initial states array. 0: LOW, 1: HIGH.
++ defualt is LOW if nothing is specified.
+ - startup-delay-us : Startup time in microseconds.
+ - enable-active-high : Polarity of GPIO is active high (default is low).
+ - regulator-type : Specifies what is being regulated, must be either
+--
+2.1.2
+
diff --git a/patches.renesas/0160-regulator-gpio-regulator-do-not-open-code-counting-a.patch b/patches.renesas/0160-regulator-gpio-regulator-do-not-open-code-counting-a.patch
new file mode 100644
index 00000000000000..6709c6e422cfc4
--- /dev/null
+++ b/patches.renesas/0160-regulator-gpio-regulator-do-not-open-code-counting-a.patch
@@ -0,0 +1,73 @@
+From 51aa410393648a2969fc7bbe5d23ea4009e782b2 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Date: Wed, 12 Feb 2014 01:01:08 +0100
+Subject: regulator: gpio-regulator: do not open-code counting and access of dt
+ array elements
+
+Open coding the counting of elements in a dt-property is abstracted by the newly
+introduced of_property_count_uXX_elems functions. Additionally the raw iteration
+over the states element exposes the endian conversion and dtb-format details,
+which according to Mark Rutland "would be nice to limit [...] to of_ helper
+functions".
+
+Thus change gpio-regulator to use the helper for element counting and
+of_property_read_u32_index for retrieval of individual values.
+
+This makes it possible to remove the raw access to the states property entirely.
+
+Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Acked-by: Mark Rutland <mark.rutland@arm.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 934624d6e9f0b3d41557c4105c286e8daeaadb4e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/gpio-regulator.c | 15 ++++++---------
+ 1 file changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
+index 5491ceeb53cc..9fd55611016c 100644
+--- a/drivers/regulator/gpio-regulator.c
++++ b/drivers/regulator/gpio-regulator.c
+@@ -136,7 +136,6 @@ static struct gpio_regulator_config *
+ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ {
+ struct gpio_regulator_config *config;
+- struct property *prop;
+ const char *regtype;
+ int proplen, gpio, i;
+ int ret;
+@@ -191,14 +190,12 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ }
+
+ /* Fetch states. */
+- prop = of_find_property(np, "states", NULL);
+- if (!prop) {
++ proplen = of_property_count_u32_elems(np, "states");
++ if (proplen < 0) {
+ dev_err(dev, "No 'states' property found\n");
+ return ERR_PTR(-EINVAL);
+ }
+
+- proplen = prop->length / sizeof(int);
+-
+ config->states = devm_kzalloc(dev,
+ sizeof(struct gpio_regulator_state)
+ * (proplen / 2),
+@@ -207,10 +204,10 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ return ERR_PTR(-ENOMEM);
+
+ for (i = 0; i < proplen / 2; i++) {
+- config->states[i].value =
+- be32_to_cpup((int *)prop->value + (i * 2));
+- config->states[i].gpios =
+- be32_to_cpup((int *)prop->value + (i * 2 + 1));
++ of_property_read_u32_index(np, "states", i * 2,
++ &config->states[i].value);
++ of_property_read_u32_index(np, "states", i * 2 + 1,
++ &config->states[i].gpios);
+ }
+ config->nr_states = i;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0161-regulator-gpio-regulator-fix-forgotten-gpios-states-.patch b/patches.renesas/0161-regulator-gpio-regulator-fix-forgotten-gpios-states-.patch
new file mode 100644
index 00000000000000..f275960676ef5d
--- /dev/null
+++ b/patches.renesas/0161-regulator-gpio-regulator-fix-forgotten-gpios-states-.patch
@@ -0,0 +1,62 @@
+From facd79f6c32c24f249898acc436f7d95dda23f13 Mon Sep 17 00:00:00 2001
+From: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Date: Thu, 13 Feb 2014 16:34:32 +0100
+Subject: regulator: gpio-regulator: fix forgotten gpios-states reading
+
+Commit 934624d6e9f0 ("regulator: gpio-regulator: do not open-code counting
+and access of dt array elements") forgot to convert the recently added
+gpios-states property using the same pattern.
+
+Convert this instance to use the of-helpers too, resolving the build error.
+
+Signed-off-by: Heiko Stuebner <heiko.stuebner@bqreaders.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 1f5a9623eb4300a722eab2f6c6a31a194c804cec)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/regulator/gpio-regulator.c | 22 +++++++++++++---------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
+index 9fd55611016c..989b23b377c0 100644
+--- a/drivers/regulator/gpio-regulator.c
++++ b/drivers/regulator/gpio-regulator.c
+@@ -171,13 +171,14 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ if (!config->gpios)
+ return ERR_PTR(-ENOMEM);
+
+- prop = of_find_property(np, "gpios-states", NULL);
+- if (prop) {
+- proplen = prop->length / sizeof(int);
+- if (proplen != config->nr_gpios) {
+- dev_warn(dev, "gpios <-> gpios-states mismatch\n");
+- prop = NULL;
+- }
++ proplen = of_property_count_u32_elems(np, "gpios-states");
++ /* optional property */
++ if (proplen < 0)
++ proplen = 0;
++
++ if (proplen > 0 && proplen != config->nr_gpios) {
++ dev_warn(dev, "gpios <-> gpios-states mismatch\n");
++ proplen = 0;
+ }
+
+ for (i = 0; i < config->nr_gpios; i++) {
+@@ -185,8 +186,11 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np)
+ if (gpio < 0)
+ break;
+ config->gpios[i].gpio = gpio;
+- if (prop && be32_to_cpup((int *)prop->value + i))
+- config->gpios[i].flags = GPIOF_OUT_INIT_HIGH;
++ if (proplen > 0) {
++ of_property_read_u32_index(np, "gpios-states", i, &ret);
++ if (ret)
++ config->gpios[i].flags = GPIOF_OUT_INIT_HIGH;
++ }
+ }
+
+ /* Fetch states. */
+--
+2.1.2
+
diff --git a/patches.renesas/0162-ASoC-simple-card-simplify-code.patch b/patches.renesas/0162-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..b2388a59f26918
--- /dev/null
+++ b/patches.renesas/0162-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,49 @@
+From 9ae721191b07d3c659d1c2a0dc8df9da6fa637fc Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:33 +0100
+Subject: ASoC: simple-card: simplify code
+
+The check of the mandatory fields is done for DT in its specific sequence.
+Move the global check to the non-DT sequence.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 7722f830a45f7fbb8f2f7b23265793980bdf3397)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 2a1b1b5b5221..f0784ca4d3c8 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -225,16 +225,16 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+
+ memcpy(cinfo, dev->platform_data, sizeof(*cinfo));
+ cinfo->snd_card.dev = dev;
+- }
+
+- if (!cinfo->name ||
+- !cinfo->card ||
+- !cinfo->codec_dai.name ||
+- !(cinfo->codec || of_codec) ||
+- !(cinfo->platform || of_platform) ||
+- !(cinfo->cpu_dai.name || of_cpu)) {
+- dev_err(dev, "insufficient asoc_simple_card_info settings\n");
+- return -EINVAL;
++ if (!cinfo->name ||
++ !cinfo->card ||
++ !cinfo->codec_dai.name ||
++ !cinfo->codec ||
++ !cinfo->platform ||
++ !cinfo->cpu_dai.name) {
++ dev_err(dev, "insufficient asoc_simple_card_info settings\n");
++ return -EINVAL;
++ }
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0163-ASoC-simple-card-simplify-code.patch b/patches.renesas/0163-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..22aefb9a13b2e0
--- /dev/null
+++ b/patches.renesas/0163-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,84 @@
+From 00000822b08bbb965096c3a6cb60b4e9ee10c24a Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:37 +0100
+Subject: ASoC: simple-card: simplify code
+
+The DT values are copied to the non-DT structure before being moved to
+the card structure.
+Set directly the DT values in the card and move the non-DT copy to the
+non-DT sequence.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 2bee991460a838ee3c8064a6d880c4e7bc41717a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 22 ++++++++++++----------
+ 1 file changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index f0784ca4d3c8..7c5dc7336c0b 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -169,12 +169,13 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ strlen(info->codec_dai.name) + 2,
+ GFP_KERNEL);
+ sprintf(name, "%s-%s", info->cpu_dai.name, info->codec_dai.name);
+- info->name = info->card = name;
++ info->snd_card.name = name;
++ info->snd_link.name = info->snd_link.stream_name = name;
+
+ /* simple-card assumes platform == cpu */
+ *of_platform = *of_cpu;
+
+- dev_dbg(dev, "card-name : %s\n", info->card);
++ dev_dbg(dev, "card-name : %s\n", name);
+ dev_dbg(dev, "platform : %04x\n", info->daifmt);
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+ info->cpu_dai.name,
+@@ -217,6 +218,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ dev_err(dev, "parse error %d\n", ret);
+ return ret;
+ }
++ cinfo->snd_link.cpu_of_node = of_cpu;
++ cinfo->snd_link.codec_of_node = of_codec;
++ cinfo->snd_link.platform_of_node = of_platform;
+ } else {
+ if (!dev->platform_data) {
+ dev_err(dev, "no info for asoc-simple-card\n");
+@@ -235,26 +239,24 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ dev_err(dev, "insufficient asoc_simple_card_info settings\n");
+ return -EINVAL;
+ }
++
++ cinfo->snd_card.name = cinfo->card;
++ cinfo->snd_link.name = cinfo->name;
++ cinfo->snd_link.stream_name = cinfo->name;
++ cinfo->snd_link.platform_name = cinfo->platform;
++ cinfo->snd_link.codec_name = cinfo->codec;
+ }
+
+ /*
+ * 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.name;
+- cinfo->snd_link.platform_name = cinfo->platform;
+- cinfo->snd_link.codec_name = cinfo->codec;
+ cinfo->snd_link.codec_dai_name = cinfo->codec_dai.name;
+- cinfo->snd_link.cpu_of_node = of_cpu;
+- cinfo->snd_link.codec_of_node = of_codec;
+- cinfo->snd_link.platform_of_node = of_platform;
+ 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;
+--
+2.1.2
+
diff --git a/patches.renesas/0164-ASoC-simple-card-simplify-code.patch b/patches.renesas/0164-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..627a5b527adb3a
--- /dev/null
+++ b/patches.renesas/0164-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,171 @@
+From ab179d3e5e79eec540dfccc8d5e3aaa857c180bf Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:41 +0100
+Subject: ASoC: simple-card: simplify code
+
+The OF pointers are put in the stack and then copied to the card
+descriptor.
+Put them directly at their right place.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 201a0eac7fe5e7a8fa33f0742304f885bc344d0d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 55 +++++++++++++++--------------------------
+ 1 file changed, 20 insertions(+), 35 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 7c5dc7336c0b..89f83b32d86d 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -60,8 +60,9 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ static int
+ asoc_simple_card_sub_parse_of(struct device_node *np,
+ struct asoc_simple_dai *dai,
+- struct device_node **node)
++ const struct device_node **p_node)
+ {
++ struct device_node *node;
+ struct clk *clk;
+ int ret;
+
+@@ -69,9 +70,10 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ * get node via "sound-dai = <&phandle port>"
+ * it will be used as xxx_of_node on soc_bind_dai_link()
+ */
+- *node = of_parse_phandle(np, "sound-dai", 0);
+- if (!*node)
++ node = of_parse_phandle(np, "sound-dai", 0);
++ if (!node)
+ return -ENODEV;
++ *p_node = node;
+
+ /* get dai->name */
+ ret = snd_soc_of_get_dai_name(np, &dai->name);
+@@ -104,7 +106,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ "system-clock-frequency",
+ &dai->sysclk);
+ } else {
+- clk = of_clk_get(*node, 0);
++ clk = of_clk_get(node, 0);
+ if (!IS_ERR(clk))
+ dai->sysclk = clk_get_rate(clk);
+ }
+@@ -112,17 +114,14 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ ret = 0;
+
+ parse_error:
+- of_node_put(*node);
++ of_node_put(node);
+
+ return ret;
+ }
+
+ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct asoc_simple_card_info *info,
+- struct device *dev,
+- struct device_node **of_cpu,
+- struct device_node **of_codec,
+- struct device_node **of_platform)
++ struct device *dev)
+ {
+ struct device_node *np;
+ char *name;
+@@ -146,7 +145,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->cpu_dai,
+- of_cpu);
++ &info->snd_link.cpu_of_node);
+ if (ret < 0)
+ return ret;
+
+@@ -156,7 +155,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->codec_dai,
+- of_codec);
++ &info->snd_link.codec_of_node);
+ if (ret < 0)
+ return ret;
+
+@@ -173,7 +172,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ info->snd_link.name = info->snd_link.stream_name = name;
+
+ /* simple-card assumes platform == cpu */
+- *of_platform = *of_cpu;
++ info->snd_link.platform_of_node = info->snd_link.cpu_of_node;
+
+ dev_dbg(dev, "card-name : %s\n", name);
+ dev_dbg(dev, "platform : %04x\n", info->daifmt);
+@@ -193,34 +192,29 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ {
+ struct asoc_simple_card_info *cinfo;
+ struct device_node *np = pdev->dev.of_node;
+- struct device_node *of_cpu, *of_codec, *of_platform;
+ struct device *dev = &pdev->dev;
+ int ret;
+
+- cinfo = NULL;
+- of_cpu = NULL;
+- of_codec = NULL;
+- of_platform = NULL;
+-
+ cinfo = devm_kzalloc(dev, sizeof(*cinfo), GFP_KERNEL);
+ if (!cinfo)
+ return -ENOMEM;
+
++ /*
++ * init snd_soc_card
++ */
++ cinfo->snd_card.owner = THIS_MODULE;
++ cinfo->snd_card.dev = dev;
++ cinfo->snd_card.dai_link = &cinfo->snd_link;
++ cinfo->snd_card.num_links = 1;
++
+ if (np && of_device_is_available(np)) {
+- cinfo->snd_card.dev = dev;
+
+- ret = asoc_simple_card_parse_of(np, cinfo, dev,
+- &of_cpu,
+- &of_codec,
+- &of_platform);
++ ret = asoc_simple_card_parse_of(np, cinfo, dev);
+ if (ret < 0) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "parse error %d\n", ret);
+ return ret;
+ }
+- cinfo->snd_link.cpu_of_node = of_cpu;
+- cinfo->snd_link.codec_of_node = of_codec;
+- cinfo->snd_link.platform_of_node = of_platform;
+ } else {
+ if (!dev->platform_data) {
+ dev_err(dev, "no info for asoc-simple-card\n");
+@@ -228,8 +222,6 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ }
+
+ memcpy(cinfo, dev->platform_data, sizeof(*cinfo));
+- cinfo->snd_card.dev = dev;
+-
+ if (!cinfo->name ||
+ !cinfo->card ||
+ !cinfo->codec_dai.name ||
+@@ -254,13 +246,6 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ cinfo->snd_link.codec_dai_name = cinfo->codec_dai.name;
+ cinfo->snd_link.init = asoc_simple_card_dai_init;
+
+- /*
+- * init snd_soc_card
+- */
+- cinfo->snd_card.owner = THIS_MODULE;
+- cinfo->snd_card.dai_link = &cinfo->snd_link;
+- cinfo->snd_card.num_links = 1;
+-
+ snd_soc_card_set_drvdata(&cinfo->snd_card, cinfo);
+
+ return devm_snd_soc_register_card(&pdev->dev, &cinfo->snd_card);
+--
+2.1.2
+
diff --git a/patches.renesas/0165-ASoC-simple-card-simplify-code.patch b/patches.renesas/0165-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..a7ac24cde8ca5c
--- /dev/null
+++ b/patches.renesas/0165-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,107 @@
+From f1c279a8a8f3e2222757ac866e6004aeaec4916e Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:45 +0100
+Subject: ASoC: simple-card: simplify code
+
+Have a cleaner code using a DAI link pointer.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 5ca8ba4180a6f629d51dba699b4a6428cc5eeba7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 29 ++++++++++++++++-------------
+ 1 file changed, 16 insertions(+), 13 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 89f83b32d86d..797696fc6f12 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -123,6 +123,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct asoc_simple_card_info *info,
+ struct device *dev)
+ {
++ struct snd_soc_dai_link *dai_link = info->snd_card.dai_link;
+ struct device_node *np;
+ char *name;
+ int ret;
+@@ -145,7 +146,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->cpu_dai,
+- &info->snd_link.cpu_of_node);
++ &dai_link->cpu_of_node);
+ if (ret < 0)
+ return ret;
+
+@@ -155,7 +156,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->codec_dai,
+- &info->snd_link.codec_of_node);
++ &dai_link->codec_of_node);
+ if (ret < 0)
+ return ret;
+
+@@ -169,10 +170,10 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ GFP_KERNEL);
+ sprintf(name, "%s-%s", info->cpu_dai.name, info->codec_dai.name);
+ info->snd_card.name = name;
+- info->snd_link.name = info->snd_link.stream_name = name;
++ dai_link->name = dai_link->stream_name = name;
+
+ /* simple-card assumes platform == cpu */
+- info->snd_link.platform_of_node = info->snd_link.cpu_of_node;
++ dai_link->platform_of_node = dai_link->cpu_of_node;
+
+ dev_dbg(dev, "card-name : %s\n", name);
+ dev_dbg(dev, "platform : %04x\n", info->daifmt);
+@@ -191,6 +192,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ static int asoc_simple_card_probe(struct platform_device *pdev)
+ {
+ struct asoc_simple_card_info *cinfo;
++ struct snd_soc_dai_link *dai_link;
+ struct device_node *np = pdev->dev.of_node;
+ struct device *dev = &pdev->dev;
+ int ret;
+@@ -204,8 +206,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ */
+ cinfo->snd_card.owner = THIS_MODULE;
+ cinfo->snd_card.dev = dev;
+- cinfo->snd_card.dai_link = &cinfo->snd_link;
+- cinfo->snd_card.num_links = 1;
++ dai_link = &cinfo->snd_link;
++ cinfo->snd_card.dai_link = dai_link;
++ cinfo->snd_card.num_links = 1;
+
+ if (np && of_device_is_available(np)) {
+
+@@ -233,18 +236,18 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ }
+
+ cinfo->snd_card.name = cinfo->card;
+- cinfo->snd_link.name = cinfo->name;
+- cinfo->snd_link.stream_name = cinfo->name;
+- cinfo->snd_link.platform_name = cinfo->platform;
+- cinfo->snd_link.codec_name = cinfo->codec;
++ dai_link->name = cinfo->name;
++ dai_link->stream_name = cinfo->name;
++ dai_link->platform_name = cinfo->platform;
++ dai_link->codec_name = cinfo->codec;
+ }
+
+ /*
+ * init snd_soc_dai_link
+ */
+- cinfo->snd_link.cpu_dai_name = cinfo->cpu_dai.name;
+- cinfo->snd_link.codec_dai_name = cinfo->codec_dai.name;
+- cinfo->snd_link.init = asoc_simple_card_dai_init;
++ dai_link->cpu_dai_name = cinfo->cpu_dai.name;
++ dai_link->codec_dai_name = cinfo->codec_dai.name;
++ dai_link->init = asoc_simple_card_dai_init;
+
+ snd_soc_card_set_drvdata(&cinfo->snd_card, cinfo);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0166-ASoC-simple-card-simplify-code.patch b/patches.renesas/0166-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..a96c1d5dfc1a13
--- /dev/null
+++ b/patches.renesas/0166-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,109 @@
+From 6689ffb95b3c8047e373d00505ecf7d2265a3a22 Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:48 +0100
+Subject: ASoC: simple-card: simplify code
+
+The CPU and CODEC DAI names are still copied to the user info structure.
+Put them directly in the DAI links.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 520084729267ac8df1651ad2f118a1d4a631a10a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 28 ++++++++++++++++------------
+ 1 file changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 797696fc6f12..9068ab474ab4 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -60,7 +60,8 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ static int
+ asoc_simple_card_sub_parse_of(struct device_node *np,
+ struct asoc_simple_dai *dai,
+- const struct device_node **p_node)
++ const struct device_node **p_node,
++ const char **name)
+ {
+ struct device_node *node;
+ struct clk *clk;
+@@ -76,7 +77,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ *p_node = node;
+
+ /* get dai->name */
+- ret = snd_soc_of_get_dai_name(np, &dai->name);
++ ret = snd_soc_of_get_dai_name(np, name);
+ if (ret < 0)
+ goto parse_error;
+
+@@ -146,7 +147,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->cpu_dai,
+- &dai_link->cpu_of_node);
++ &dai_link->cpu_of_node,
++ &dai_link->cpu_dai_name);
+ if (ret < 0)
+ return ret;
+
+@@ -156,19 +158,21 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+ &info->codec_dai,
+- &dai_link->codec_of_node);
++ &dai_link->codec_of_node,
++ &dai_link->codec_dai_name);
+ if (ret < 0)
+ return ret;
+
+- if (!info->cpu_dai.name || !info->codec_dai.name)
++ if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name)
+ return -EINVAL;
+
+ /* card name is created from CPU/CODEC dai name */
+ name = devm_kzalloc(dev,
+- strlen(info->cpu_dai.name) +
+- strlen(info->codec_dai.name) + 2,
++ strlen(dai_link->cpu_dai_name) +
++ strlen(dai_link->codec_dai_name) + 2,
+ GFP_KERNEL);
+- sprintf(name, "%s-%s", info->cpu_dai.name, info->codec_dai.name);
++ sprintf(name, "%s-%s", dai_link->cpu_dai_name,
++ dai_link->codec_dai_name);
+ info->snd_card.name = name;
+ dai_link->name = dai_link->stream_name = name;
+
+@@ -178,11 +182,11 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ dev_dbg(dev, "card-name : %s\n", name);
+ dev_dbg(dev, "platform : %04x\n", info->daifmt);
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+- info->cpu_dai.name,
++ dai_link->cpu_dai_name,
+ info->cpu_dai.fmt,
+ info->cpu_dai.sysclk);
+ dev_dbg(dev, "codec : %s / %04x / %d\n",
+- info->codec_dai.name,
++ dai_link->codec_dai_name,
+ info->codec_dai.fmt,
+ info->codec_dai.sysclk);
+
+@@ -240,13 +244,13 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ dai_link->stream_name = cinfo->name;
+ dai_link->platform_name = cinfo->platform;
+ dai_link->codec_name = cinfo->codec;
++ dai_link->cpu_dai_name = cinfo->cpu_dai.name;
++ dai_link->codec_dai_name = cinfo->codec_dai.name;
+ }
+
+ /*
+ * init snd_soc_dai_link
+ */
+- dai_link->cpu_dai_name = cinfo->cpu_dai.name;
+- dai_link->codec_dai_name = cinfo->codec_dai.name;
+ dai_link->init = asoc_simple_card_dai_init;
+
+ snd_soc_card_set_drvdata(&cinfo->snd_card, cinfo);
+--
+2.1.2
+
diff --git a/patches.renesas/0167-ASoC-simple-card-simplify-code.patch b/patches.renesas/0167-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..45fbbd6b7e69bc
--- /dev/null
+++ b/patches.renesas/0167-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,112 @@
+From 9308ee506aa7a68c8af387e9c94956cf8cc4fbd5 Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:52 +0100
+Subject: ASoC: simple-card: simplify code
+
+In the non-DT sequence, the platform data is copied as a whole to the
+dynamic card info and the same pointer 'cinfo' is used to copy the
+platform information to the card.
+
+Use 'priv' as the pointer to the dynamic card info and copy only the
+useful information from the platform data.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit ca65b492c7a265b220f763fd68bf87391213248f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 34 ++++++++++++++++++++--------------
+ 1 file changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 9068ab474ab4..90c6fd5c2c7e 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -195,40 +195,42 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+
+ static int asoc_simple_card_probe(struct platform_device *pdev)
+ {
+- struct asoc_simple_card_info *cinfo;
++ struct asoc_simple_card_info *priv;
+ struct snd_soc_dai_link *dai_link;
+ struct device_node *np = pdev->dev.of_node;
+ struct device *dev = &pdev->dev;
+ int ret;
+
+- cinfo = devm_kzalloc(dev, sizeof(*cinfo), GFP_KERNEL);
+- if (!cinfo)
++ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
++ if (!priv)
+ return -ENOMEM;
+
+ /*
+ * init snd_soc_card
+ */
+- cinfo->snd_card.owner = THIS_MODULE;
+- cinfo->snd_card.dev = dev;
+- dai_link = &cinfo->snd_link;
+- cinfo->snd_card.dai_link = dai_link;
+- cinfo->snd_card.num_links = 1;
++ priv->snd_card.owner = THIS_MODULE;
++ priv->snd_card.dev = dev;
++ dai_link = &priv->snd_link;
++ priv->snd_card.dai_link = dai_link;
++ priv->snd_card.num_links = 1;
+
+ if (np && of_device_is_available(np)) {
+
+- ret = asoc_simple_card_parse_of(np, cinfo, dev);
++ ret = asoc_simple_card_parse_of(np, priv, dev);
+ if (ret < 0) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "parse error %d\n", ret);
+ return ret;
+ }
+ } else {
+- if (!dev->platform_data) {
++ struct asoc_simple_card_info *cinfo;
++
++ cinfo = dev->platform_data;
++ if (!cinfo) {
+ dev_err(dev, "no info for asoc-simple-card\n");
+ return -EINVAL;
+ }
+
+- memcpy(cinfo, dev->platform_data, sizeof(*cinfo));
+ if (!cinfo->name ||
+ !cinfo->card ||
+ !cinfo->codec_dai.name ||
+@@ -239,13 +241,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ return -EINVAL;
+ }
+
+- cinfo->snd_card.name = cinfo->card;
++ priv->snd_card.name = cinfo->card;
+ dai_link->name = cinfo->name;
+ dai_link->stream_name = cinfo->name;
+ dai_link->platform_name = cinfo->platform;
+ dai_link->codec_name = cinfo->codec;
+ dai_link->cpu_dai_name = cinfo->cpu_dai.name;
+ dai_link->codec_dai_name = cinfo->codec_dai.name;
++ memcpy(&priv->cpu_dai, &cinfo->cpu_dai,
++ sizeof(priv->cpu_dai));
++ memcpy(&priv->codec_dai, &cinfo->codec_dai,
++ sizeof(priv->codec_dai));
+ }
+
+ /*
+@@ -253,9 +259,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ */
+ dai_link->init = asoc_simple_card_dai_init;
+
+- snd_soc_card_set_drvdata(&cinfo->snd_card, cinfo);
++ snd_soc_card_set_drvdata(&priv->snd_card, priv);
+
+- return devm_snd_soc_register_card(&pdev->dev, &cinfo->snd_card);
++ return devm_snd_soc_register_card(&pdev->dev, &priv->snd_card);
+ }
+
+ static const struct of_device_id asoc_simple_of_match[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0168-ASoC-simple-card-simplify-code.patch b/patches.renesas/0168-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..04692ad3923b82
--- /dev/null
+++ b/patches.renesas/0168-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,84 @@
+From 922158e47a1ed84669281b4b394010e620a58c5d Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:51:56 +0100
+Subject: ASoC: simple-card: simplify code
+
+The platform data structure contains information which is used only by
+the driver, and the driver allocates platform information fields which
+are of no use.
+Move the driver specific data to a new private structure and cleanup
+the platform data structure.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 45fce59496cbabd46761e6980c05c82d94d08eaa)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/sound/simple_card.h | 4 ----
+ sound/soc/generic/simple-card.c | 14 +++++++++++---
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
+index 6c74527d4926..e1ac996c8feb 100644
+--- a/include/sound/simple_card.h
++++ b/include/sound/simple_card.h
+@@ -29,10 +29,6 @@ struct asoc_simple_card_info {
+ unsigned int daifmt;
+ struct asoc_simple_dai cpu_dai;
+ struct asoc_simple_dai codec_dai;
+-
+- /* 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/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 90c6fd5c2c7e..0f11c2808437 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -15,6 +15,14 @@
+ #include <linux/string.h>
+ #include <sound/simple_card.h>
+
++struct simple_card_data {
++ struct snd_soc_card snd_card;
++ unsigned int daifmt;
++ struct asoc_simple_dai cpu_dai;
++ struct asoc_simple_dai codec_dai;
++ struct snd_soc_dai_link snd_link;
++};
++
+ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+ struct asoc_simple_dai *set,
+ unsigned int daifmt)
+@@ -39,7 +47,7 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+
+ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ {
+- struct asoc_simple_card_info *info =
++ struct simple_card_data *info =
+ snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *codec = rtd->codec_dai;
+ struct snd_soc_dai *cpu = rtd->cpu_dai;
+@@ -121,7 +129,7 @@ parse_error:
+ }
+
+ static int asoc_simple_card_parse_of(struct device_node *node,
+- struct asoc_simple_card_info *info,
++ struct simple_card_data *info,
+ struct device *dev)
+ {
+ struct snd_soc_dai_link *dai_link = info->snd_card.dai_link;
+@@ -195,7 +203,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+
+ static int asoc_simple_card_probe(struct platform_device *pdev)
+ {
+- struct asoc_simple_card_info *priv;
++ struct simple_card_data *priv;
+ struct snd_soc_dai_link *dai_link;
+ struct device_node *np = pdev->dev.of_node;
+ struct device *dev = &pdev->dev;
+--
+2.1.2
+
diff --git a/patches.renesas/0169-ASoC-simple-card-simplify-code.patch b/patches.renesas/0169-ASoC-simple-card-simplify-code.patch
new file mode 100644
index 00000000000000..e0ff4bf6bf4781
--- /dev/null
+++ b/patches.renesas/0169-ASoC-simple-card-simplify-code.patch
@@ -0,0 +1,118 @@
+From 9ee1e0f1085a7ddb1c55639eaf45c9a1ec65263b Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Wed, 15 Jan 2014 16:52:00 +0100
+Subject: ASoC: simple-card: simplify code
+
+Rename the pointer to the private data structure to 'priv' to avoid confusion with the platform data pointer.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit b367a3252b365fd545fc589a40cad3976e73d7d7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 0f11c2808437..6443c87e8625 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -47,18 +47,18 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+
+ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ {
+- struct simple_card_data *info =
++ struct simple_card_data *priv =
+ snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *codec = rtd->codec_dai;
+ struct snd_soc_dai *cpu = rtd->cpu_dai;
+- unsigned int daifmt = info->daifmt;
++ unsigned int daifmt = priv->daifmt;
+ int ret;
+
+- ret = __asoc_simple_card_dai_init(codec, &info->codec_dai, daifmt);
++ ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai, daifmt);
+ if (ret < 0)
+ return ret;
+
+- ret = __asoc_simple_card_dai_init(cpu, &info->cpu_dai, daifmt);
++ ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai, daifmt);
+ if (ret < 0)
+ return ret;
+
+@@ -129,21 +129,21 @@ parse_error:
+ }
+
+ static int asoc_simple_card_parse_of(struct device_node *node,
+- struct simple_card_data *info,
++ struct simple_card_data *priv,
+ struct device *dev)
+ {
+- struct snd_soc_dai_link *dai_link = info->snd_card.dai_link;
++ struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
+ struct device_node *np;
+ char *name;
+ int ret;
+
+ /* get CPU/CODEC common format via simple-audio-card,format */
+- info->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
++ priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
+ (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
+
+ /* DAPM routes */
+ if (of_property_read_bool(node, "simple-audio-card,routing")) {
+- ret = snd_soc_of_parse_audio_routing(&info->snd_card,
++ ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
+ "simple-audio-card,routing");
+ if (ret)
+ return ret;
+@@ -154,7 +154,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ np = of_get_child_by_name(node, "simple-audio-card,cpu");
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+- &info->cpu_dai,
++ &priv->cpu_dai,
+ &dai_link->cpu_of_node,
+ &dai_link->cpu_dai_name);
+ if (ret < 0)
+@@ -165,7 +165,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ np = of_get_child_by_name(node, "simple-audio-card,codec");
+ if (np)
+ ret = asoc_simple_card_sub_parse_of(np,
+- &info->codec_dai,
++ &priv->codec_dai,
+ &dai_link->codec_of_node,
+ &dai_link->codec_dai_name);
+ if (ret < 0)
+@@ -181,22 +181,22 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ GFP_KERNEL);
+ sprintf(name, "%s-%s", dai_link->cpu_dai_name,
+ dai_link->codec_dai_name);
+- info->snd_card.name = name;
++ priv->snd_card.name = name;
+ dai_link->name = dai_link->stream_name = name;
+
+ /* simple-card assumes platform == cpu */
+ dai_link->platform_of_node = dai_link->cpu_of_node;
+
+ dev_dbg(dev, "card-name : %s\n", name);
+- dev_dbg(dev, "platform : %04x\n", info->daifmt);
++ dev_dbg(dev, "platform : %04x\n", priv->daifmt);
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+ dai_link->cpu_dai_name,
+- info->cpu_dai.fmt,
+- info->cpu_dai.sysclk);
++ priv->cpu_dai.fmt,
++ priv->cpu_dai.sysclk);
+ dev_dbg(dev, "codec : %s / %04x / %d\n",
+ dai_link->codec_dai_name,
+- info->codec_dai.fmt,
+- info->codec_dai.sysclk);
++ priv->codec_dai.fmt,
++ priv->codec_dai.sysclk);
+
+ return 0;
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0170-ASoC-simple-card-fix-__asoc_simple_card_dai_init.patch b/patches.renesas/0170-ASoC-simple-card-fix-__asoc_simple_card_dai_init.patch
new file mode 100644
index 00000000000000..d6a23a65847bf9
--- /dev/null
+++ b/patches.renesas/0170-ASoC-simple-card-fix-__asoc_simple_card_dai_init.patch
@@ -0,0 +1,60 @@
+From 63a1b5c98152c812cc9d5ed4686e076d46eb86a1 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Fri, 24 Jan 2014 15:43:00 +0800
+Subject: ASoC: simple-card: fix __asoc_simple_card_dai_init
+
+If the CPU/CODEC DAI set_sysclk() is not support, the -ENOTSUPP will returnd.
+Here do the check like set_fmt().
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 4763ebe226156db985fe75bfe930c4069d1f4207)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 6443c87e8625..6366f3fa6a37 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -27,21 +27,29 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+ struct asoc_simple_dai *set,
+ unsigned int daifmt)
+ {
+- int ret = 0;
++ int ret;
+
+ daifmt |= set->fmt;
+
+- if (daifmt)
++ if (daifmt) {
+ ret = snd_soc_dai_set_fmt(dai, daifmt);
+-
+- if (ret == -ENOTSUPP) {
+- dev_dbg(dai->dev, "ASoC: set_fmt is not supported\n");
+- ret = 0;
++ if (ret && ret != -ENOTSUPP) {
++ dev_err(dai->dev, "simple-card: set_fmt error\n");
++ goto err;
++ }
+ }
+
+- if (!ret && set->sysclk)
++ if (set->sysclk) {
+ ret = snd_soc_dai_set_sysclk(dai, 0, set->sysclk, 0);
++ if (ret && ret != -ENOTSUPP) {
++ dev_err(dai->dev, "simple-card: set_sysclk error\n");
++ goto err;
++ }
++ }
++
++ ret = 0;
+
++err:
+ return ret;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0171-ASoC-simple-card-simplify-the-daifmt-code.patch b/patches.renesas/0171-ASoC-simple-card-simplify-the-daifmt-code.patch
new file mode 100644
index 00000000000000..cbc7b93f3e1337
--- /dev/null
+++ b/patches.renesas/0171-ASoC-simple-card-simplify-the-daifmt-code.patch
@@ -0,0 +1,99 @@
+From 6b2d2c734c95551123c40088d09e10524a7b1170 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Fri, 24 Jan 2014 15:43:01 +0800
+Subject: ASoC: simple-card: simplify the daifmt code
+
+In the asoc_simple_card_parse_of() will parse the device node's CPU/CODEC
+DAI commone fmts, and then in asoc_simple_card_sub_parse_of() will parse
+the CPU/CODEC DAI's sub-node fmts, so we can combine the info->daifmt and
+info->set.fmt in asoc_simple_card_sub_parse_of() not while just before
+_set_fmt().
+
+And this will be more easy to add new functions, such as supporting
+_set_tdm_slot(), etc.
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 30d0341e7da0c012f64fb290dd1153360fb49a8d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 6366f3fa6a37..65833feb995f 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -24,15 +24,12 @@ struct simple_card_data {
+ };
+
+ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+- struct asoc_simple_dai *set,
+- unsigned int daifmt)
++ struct asoc_simple_dai *set)
+ {
+ int ret;
+
+- daifmt |= set->fmt;
+-
+- if (daifmt) {
+- ret = snd_soc_dai_set_fmt(dai, daifmt);
++ if (set->fmt) {
++ ret = snd_soc_dai_set_fmt(dai, set->fmt);
+ if (ret && ret != -ENOTSUPP) {
+ dev_err(dai->dev, "simple-card: set_fmt error\n");
+ goto err;
+@@ -59,14 +56,13 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *codec = rtd->codec_dai;
+ struct snd_soc_dai *cpu = rtd->cpu_dai;
+- unsigned int daifmt = priv->daifmt;
+ int ret;
+
+- ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai, daifmt);
++ ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai);
+ if (ret < 0)
+ return ret;
+
+- ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai, daifmt);
++ ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai);
+ if (ret < 0)
+ return ret;
+
+@@ -75,6 +71,7 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+
+ static int
+ asoc_simple_card_sub_parse_of(struct device_node *np,
++ unsigned int daifmt,
+ struct asoc_simple_dai *dai,
+ const struct device_node **p_node,
+ const char **name)
+@@ -103,6 +100,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ * and specific "format" if it has
+ */
+ dai->fmt = snd_soc_of_parse_daifmt(np, NULL);
++ dai->fmt |= daifmt;
+
+ /*
+ * dai->sysclk come from
+@@ -161,7 +159,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,cpu");
+ if (np)
+- ret = asoc_simple_card_sub_parse_of(np,
++ ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
+ &priv->cpu_dai,
+ &dai_link->cpu_of_node,
+ &dai_link->cpu_dai_name);
+@@ -172,7 +170,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,codec");
+ if (np)
+- ret = asoc_simple_card_sub_parse_of(np,
++ ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
+ &priv->codec_dai,
+ &dai_link->codec_of_node,
+ &dai_link->codec_dai_name);
+--
+2.1.2
+
diff --git a/patches.renesas/0172-ASoC-simple-card-Add-snd_card-s-name-parsing-from-DT.patch b/patches.renesas/0172-ASoC-simple-card-Add-snd_card-s-name-parsing-from-DT.patch
new file mode 100644
index 00000000000000..5d81f625622199
--- /dev/null
+++ b/patches.renesas/0172-ASoC-simple-card-Add-snd_card-s-name-parsing-from-DT.patch
@@ -0,0 +1,49 @@
+From 695ec77ddc6580a80c38097ab9d269cedd8a3386 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Fri, 24 Jan 2014 15:43:02 +0800
+Subject: ASoC: simple-card: Add snd_card's name parsing from DT node support
+
+If the DT is used and the CPU DAI device has only one DAI, the card
+name will be like :
+
+ALSA device list:
+0: 40031000.sai-sgtl5000
+
+And this name maybe a little ugly to some customers, so here the
+card name parsing from DT node is supported.
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 2772555b6c5ba79783c04ea6c60549530d737e2e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 65833feb995f..0890fcdc9251 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -143,6 +143,9 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ char *name;
+ int ret;
+
++ /* parsing the card name from DT */
++ snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name");
++
+ /* get CPU/CODEC common format via simple-audio-card,format */
+ priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
+ (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
+@@ -187,7 +190,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ GFP_KERNEL);
+ sprintf(name, "%s-%s", dai_link->cpu_dai_name,
+ dai_link->codec_dai_name);
+- priv->snd_card.name = name;
++ if (!priv->snd_card.name)
++ priv->snd_card.name = name;
+ dai_link->name = dai_link->stream_name = name;
+
+ /* simple-card assumes platform == cpu */
+--
+2.1.2
+
diff --git a/patches.renesas/0173-ASoC-simple-card-add-off-codec-widgets-supports.patch b/patches.renesas/0173-ASoC-simple-card-add-off-codec-widgets-supports.patch
new file mode 100644
index 00000000000000..323940c4b04f4e
--- /dev/null
+++ b/patches.renesas/0173-ASoC-simple-card-add-off-codec-widgets-supports.patch
@@ -0,0 +1,35 @@
+From 5712429e5e3059094d59136cd111c5b5f97e3ca5 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Sat, 8 Feb 2014 15:59:53 +0800
+Subject: ASoC: simple-card: add off-codec widgets supports.
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 9d681f5bfc85515a7b4a4af09337ed5e74f39ad9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 0890fcdc9251..4fe8abc6e216 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -150,6 +150,14 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
+ (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
+
++ /* off-codec widgets */
++ if (of_property_read_bool(node, "simple-audio-card,widgets")) {
++ ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card,
++ "simple-audio-card,widgets");
++ if (ret)
++ return ret;
++ }
++
+ /* DAPM routes */
+ if (of_property_read_bool(node, "simple-audio-card,routing")) {
+ ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
+--
+2.1.2
+
diff --git a/patches.renesas/0174-ASoC-simple-card-for-new-properties-documenting-and-.patch b/patches.renesas/0174-ASoC-simple-card-for-new-properties-documenting-and-.patch
new file mode 100644
index 00000000000000..a448eac16a1637
--- /dev/null
+++ b/patches.renesas/0174-ASoC-simple-card-for-new-properties-documenting-and-.patch
@@ -0,0 +1,58 @@
+From 83733acc05d08f1455376dabf5a1c693d6f8d236 Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Sat, 8 Feb 2014 15:59:55 +0800
+Subject: ASoC: simple-card: for new properties documenting and usage
+
+This add the following three new properties documenting and usage
+for simple card:
+
+"simple-audio-card,name",
+"simple-audio-card,widgets",
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 66841345073b049c0c194486bac4d7f07266a57e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/sound/simple-card.txt | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
+index 19c84df5fffa..05273583490c 100644
+--- a/Documentation/devicetree/bindings/sound/simple-card.txt
++++ b/Documentation/devicetree/bindings/sound/simple-card.txt
+@@ -8,9 +8,12 @@ Required properties:
+
+ Optional properties:
+
++- simple-audio-card,name : User specified audio sound card name, one string
++ property.
+ - simple-audio-card,format : CPU/CODEC common audio format.
+ "i2s", "right_j", "left_j" , "dsp_a"
+ "dsp_b", "ac97", "pdm", "msb", "lsb"
++- simple-audio-card,widgets : Please refer to widgets.txt.
+ - simple-audio-card,routing : A list of the connections between audio components.
+ Each entry is a pair of strings, the first being the
+ connection's sink, the second being the connection's
+@@ -42,11 +45,16 @@ Example:
+
+ sound {
+ compatible = "simple-audio-card";
++ simple-audio-card,name = "VF610-Tower-Sound-Card";
+ simple-audio-card,format = "left_j";
++ simple-audio-card,widgets =
++ "Microphone", "Microphone Jack",
++ "Headphone", "Headphone Jack",
++ "Speaker", "External Speaker";
+ simple-audio-card,routing =
+- "MIC_IN", "Mic Jack",
++ "MIC_IN", "Microphone Jack",
+ "Headphone Jack", "HP_OUT",
+- "Ext Spk", "LINE_OUT";
++ "External Speaker", "LINE_OUT";
+
+ simple-audio-card,cpu {
+ sound-dai = <&sh_fsi2 0>;
+--
+2.1.2
+
diff --git a/patches.renesas/0175-ASoC-simple-card-add-slot-information-parsing-suppor.patch b/patches.renesas/0175-ASoC-simple-card-add-slot-information-parsing-suppor.patch
new file mode 100644
index 00000000000000..1c7c16a221ef81
--- /dev/null
+++ b/patches.renesas/0175-ASoC-simple-card-add-slot-information-parsing-suppor.patch
@@ -0,0 +1,105 @@
+From 990b46defa1032606071010a7890b64d81c5748c Mon Sep 17 00:00:00 2001
+From: Xiubo Li <Li.Xiubo@freescale.com>
+Date: Fri, 14 Feb 2014 09:34:36 +0800
+Subject: ASoC: simple-card: add slot information parsing supports
+
+For some CPU/CODEC DAI devices the slot information maybe needed. This
+patch adds the slot information parsing for simple-card driver.
+
+Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6ff62eedce4f7756b092d276165d8e11edab9f28)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/sound/simple-card.txt | 5 +++++
+ include/sound/simple_card.h | 2 ++
+ sound/soc/generic/simple-card.c | 18 ++++++++++++++++++
+ 3 files changed, 25 insertions(+)
+
+diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
+index 05273583490c..b30c222f9cd3 100644
+--- a/Documentation/devicetree/bindings/sound/simple-card.txt
++++ b/Documentation/devicetree/bindings/sound/simple-card.txt
+@@ -18,6 +18,8 @@ Optional properties:
+ Each entry is a pair of strings, the first being the
+ connection's sink, the second being the connection's
+ source.
++- dai-tdm-slot-num : Please refer to tdm-slot.txt.
++- dai-tdm-slot-width : Please refer to tdm-slot.txt.
+
+ Required subnodes:
+
+@@ -56,6 +58,9 @@ sound {
+ "Headphone Jack", "HP_OUT",
+ "External Speaker", "LINE_OUT";
+
++ dai-tdm-slot-num = <2>;
++ dai-tdm-slot-width = <8>;
++
+ simple-audio-card,cpu {
+ sound-dai = <&sh_fsi2 0>;
+ };
+diff --git a/include/sound/simple_card.h b/include/sound/simple_card.h
+index e1ac996c8feb..9b0ac77177b6 100644
+--- a/include/sound/simple_card.h
++++ b/include/sound/simple_card.h
+@@ -18,6 +18,8 @@ struct asoc_simple_dai {
+ const char *name;
+ unsigned int fmt;
+ unsigned int sysclk;
++ int slots;
++ int slot_width;
+ };
+
+ struct asoc_simple_card_info {
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 4fe8abc6e216..bdd176ddff07 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -9,11 +9,14 @@
+ * published by the Free Software Foundation.
+ */
+ #include <linux/clk.h>
++#include <linux/device.h>
+ #include <linux/module.h>
+ #include <linux/of.h>
+ #include <linux/platform_device.h>
+ #include <linux/string.h>
+ #include <sound/simple_card.h>
++#include <sound/soc-dai.h>
++#include <sound/soc.h>
+
+ struct simple_card_data {
+ struct snd_soc_card snd_card;
+@@ -44,6 +47,16 @@ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+ }
+ }
+
++ if (set->slots) {
++ ret = snd_soc_dai_set_tdm_slot(dai, 0, 0,
++ set->slots,
++ set->slot_width);
++ if (ret && ret != -ENOTSUPP) {
++ dev_err(dai->dev, "simple-card: set_tdm_slot error\n");
++ goto err;
++ }
++ }
++
+ ret = 0;
+
+ err:
+@@ -94,6 +107,11 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ if (ret < 0)
+ goto parse_error;
+
++ /* parse TDM slot */
++ ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width);
++ if (ret)
++ goto parse_error;
++
+ /*
+ * bitclock-inversion, frame-inversion
+ * bitclock-master, frame-master
+--
+2.1.2
+
diff --git a/patches.renesas/0176-ASoC-simple-card-cpu_dai_name-creates-confusion-when.patch b/patches.renesas/0176-ASoC-simple-card-cpu_dai_name-creates-confusion-when.patch
new file mode 100644
index 00000000000000..4aa5d4d487ddcb
--- /dev/null
+++ b/patches.renesas/0176-ASoC-simple-card-cpu_dai_name-creates-confusion-when.patch
@@ -0,0 +1,53 @@
+From 718a1e6e627eb549d62058cbd1ad55ef3d4fd90c Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 27 Feb 2014 18:25:24 -0800
+Subject: ASoC: simple-card: cpu_dai_name creates confusion when DT case
+
+Basically, soc_bind_dai_link() checks
+cpu_dai->dev->of_node and dai_link->cpu_of_node in DT case.
+But after that it will check
+cpu_dai->name and dai_link->cpu_dai_name too.
+
+On the other hand, snd_soc_dai :: name is created by
+fmt_single_name() or fmt_multiple_name().
+
+There is no confusion if dai name is created by fmt_multiple_name(),
+since cpu_dai->name is same as dai_link->cpu_dai_name.
+but, if dai name is created by fmt_single_name(), CPU DAI never match.
+
+Thus, simple-card not set dai_link->cpu_dai_name if DT case
+to skip naming match on soc_bind_dai_link()
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit f687d900d30a61dda38db2a99239f5284a86a309)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index bdd176ddff07..034a2b73f6c1 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -234,6 +234,17 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ priv->codec_dai.fmt,
+ priv->codec_dai.sysclk);
+
++ /*
++ * soc_bind_dai_link() will check cpu name
++ * after of_node matching if dai_link has cpu_dai_name.
++ * but, it will never match if name was created by fmt_single_name()
++ * remove cpu_dai_name to escape name matching.
++ * see
++ * fmt_single_name()
++ * fmt_multiple_name()
++ */
++ dai_link->cpu_dai_name = NULL;
++
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0177-ASoC-simple-card-tidyup-cpu-codec-dai_fmt-settings-f.patch b/patches.renesas/0177-ASoC-simple-card-tidyup-cpu-codec-dai_fmt-settings-f.patch
new file mode 100644
index 00000000000000..32b6ac7705be34
--- /dev/null
+++ b/patches.renesas/0177-ASoC-simple-card-tidyup-cpu-codec-dai_fmt-settings-f.patch
@@ -0,0 +1,37 @@
+From c0f6e1ee2b931622ad9940b79556917e46309db3 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 2 Mar 2014 20:32:43 -0800
+Subject: ASoC: simple-card: tidyup cpu/codec dai_fmt settings for non-DT
+
+30d0341e7da0c012f64fb290dd1153360fb49a8d
+(ASoC: simple-card: simplify the daifmt code)
+simplify cpu/codec dai_fmt which consists from
+dai specific format + common format.
+But, it didn't care about non-DT case.
+This patch fixes it
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 81985bd63f6f1711035aa8d97caf2fb203250a95)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 034a2b73f6c1..7cabcc5c8703 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -307,6 +307,9 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ sizeof(priv->cpu_dai));
+ memcpy(&priv->codec_dai, &cinfo->codec_dai,
+ sizeof(priv->codec_dai));
++
++ priv->cpu_dai.fmt |= cinfo->daifmt;
++ priv->codec_dai.fmt |= cinfo->daifmt;
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0178-ASoC-simple-card-card-name-can-be-option.patch b/patches.renesas/0178-ASoC-simple-card-card-name-can-be-option.patch
new file mode 100644
index 00000000000000..4398ae0b168a4f
--- /dev/null
+++ b/patches.renesas/0178-ASoC-simple-card-card-name-can-be-option.patch
@@ -0,0 +1,41 @@
+From 93ef9849ef6367b07e8d2a0fea35b8b1d9431054 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 9 Mar 2014 19:37:56 -0700
+Subject: ASoC: simple-card: card name can be option
+
+snd_card.name is now option on DT case.
+non-DT case can follow same style,
+and it is understandable from platform point of view.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 12ffa6fc1958879a81b6af1624c1a2edd83ec04a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 7cabcc5c8703..5dd47691ba41 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -287,7 +287,6 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ }
+
+ if (!cinfo->name ||
+- !cinfo->card ||
+ !cinfo->codec_dai.name ||
+ !cinfo->codec ||
+ !cinfo->platform ||
+@@ -296,7 +295,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ return -EINVAL;
+ }
+
+- priv->snd_card.name = cinfo->card;
++ priv->snd_card.name = (cinfo->card) ? cinfo->card : cinfo->name;
+ dai_link->name = cinfo->name;
+ dai_link->stream_name = cinfo->name;
+ dai_link->platform_name = cinfo->platform;
+--
+2.1.2
+
diff --git a/patches.renesas/0179-ASoC-simple-card-Fix-the-reference-count-of-device-n.patch b/patches.renesas/0179-ASoC-simple-card-Fix-the-reference-count-of-device-n.patch
new file mode 100644
index 00000000000000..98e99b093886e8
--- /dev/null
+++ b/patches.renesas/0179-ASoC-simple-card-Fix-the-reference-count-of-device-n.patch
@@ -0,0 +1,140 @@
+From c7fad9dbd74462c996d8ba651f8d65f7a5e24170 Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Tue, 11 Mar 2014 10:03:40 +0100
+Subject: ASoC: simple-card: Fix the reference count of device nodes
+
+The reference count of some device nodes is not correctly reset
+at end of card probe.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit e512e001dafa54e5ac7244416e340750a4356b41)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 50 ++++++++++++++++++++++++++++++-----------
+ 1 file changed, 37 insertions(+), 13 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 5dd47691ba41..dcf37fb69b35 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -105,12 +105,12 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ /* get dai->name */
+ ret = snd_soc_of_get_dai_name(np, name);
+ if (ret < 0)
+- goto parse_error;
++ return ret;
+
+ /* parse TDM slot */
+ ret = snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width);
+ if (ret)
+- goto parse_error;
++ return ret;
+
+ /*
+ * bitclock-inversion, frame-inversion
+@@ -130,7 +130,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ clk = of_clk_get(np, 0);
+ if (IS_ERR(clk)) {
+ ret = PTR_ERR(clk);
+- goto parse_error;
++ return ret;
+ }
+
+ dai->sysclk = clk_get_rate(clk);
+@@ -144,12 +144,7 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ dai->sysclk = clk_get_rate(clk);
+ }
+
+- ret = 0;
+-
+-parse_error:
+- of_node_put(node);
+-
+- return ret;
++ return 0;
+ }
+
+ static int asoc_simple_card_parse_of(struct device_node *node,
+@@ -187,22 +182,26 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ /* CPU sub-node */
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,cpu");
+- if (np)
++ if (np) {
+ ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
+ &priv->cpu_dai,
+ &dai_link->cpu_of_node,
+ &dai_link->cpu_dai_name);
++ of_node_put(np);
++ }
+ if (ret < 0)
+ return ret;
+
+ /* CODEC sub-node */
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,codec");
+- if (np)
++ if (np) {
+ ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
+ &priv->codec_dai,
+ &dai_link->codec_of_node,
+ &dai_link->codec_dai_name);
++ of_node_put(np);
++ }
+ if (ret < 0)
+ return ret;
+
+@@ -248,6 +247,27 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ return 0;
+ }
+
++/* update the reference count of the devices nodes at end of probe */
++static int asoc_simple_card_unref(struct platform_device *pdev)
++{
++ struct snd_soc_card *card = platform_get_drvdata(pdev);
++ struct snd_soc_dai_link *dai_link;
++ struct device_node *np;
++ int num_links;
++
++ for (num_links = 0, dai_link = card->dai_link;
++ num_links < card->num_links;
++ num_links++, dai_link++) {
++ np = (struct device_node *) dai_link->cpu_of_node;
++ if (np)
++ of_node_put(np);
++ np = (struct device_node *) dai_link->codec_of_node;
++ if (np)
++ of_node_put(np);
++ }
++ return 0;
++}
++
+ static int asoc_simple_card_probe(struct platform_device *pdev)
+ {
+ struct simple_card_data *priv;
+@@ -275,7 +295,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ if (ret < 0) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "parse error %d\n", ret);
+- return ret;
++ goto err;
+ }
+ } else {
+ struct asoc_simple_card_info *cinfo;
+@@ -318,7 +338,11 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+
+ snd_soc_card_set_drvdata(&priv->snd_card, priv);
+
+- return devm_snd_soc_register_card(&pdev->dev, &priv->snd_card);
++ ret = devm_snd_soc_register_card(&pdev->dev, &priv->snd_card);
++
++err:
++ asoc_simple_card_unref(pdev);
++ return ret;
+ }
+
+ static const struct of_device_id asoc_simple_of_match[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0180-ASoC-simple-card-Simplify-code.patch b/patches.renesas/0180-ASoC-simple-card-Simplify-code.patch
new file mode 100644
index 00000000000000..a7b1898aa1e59e
--- /dev/null
+++ b/patches.renesas/0180-ASoC-simple-card-Simplify-code.patch
@@ -0,0 +1,76 @@
+From 43bb142a3e38762de866fca588942385100a6903 Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Sat, 15 Mar 2014 11:32:42 +0100
+Subject: ASoC: simple-card: Simplify code
+
+The global DAI format is used only in the function
+asoc_simple_card_parse_of(). So, move it from the private data
+to the stack.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c56c4d74c6f96d0ff605d8948e127099cf5e6681)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index dcf37fb69b35..ca7e63ef858a 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -20,7 +20,6 @@
+
+ struct simple_card_data {
+ struct snd_soc_card snd_card;
+- unsigned int daifmt;
+ struct asoc_simple_dai cpu_dai;
+ struct asoc_simple_dai codec_dai;
+ struct snd_soc_dai_link snd_link;
+@@ -154,13 +153,14 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
+ struct device_node *np;
+ char *name;
++ unsigned int daifmt;
+ int ret;
+
+ /* parsing the card name from DT */
+ snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name");
+
+ /* get CPU/CODEC common format via simple-audio-card,format */
+- priv->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
++ daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
+ (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
+
+ /* off-codec widgets */
+@@ -183,7 +183,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,cpu");
+ if (np) {
+- ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
++ ret = asoc_simple_card_sub_parse_of(np, daifmt,
+ &priv->cpu_dai,
+ &dai_link->cpu_of_node,
+ &dai_link->cpu_dai_name);
+@@ -196,7 +196,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ ret = -EINVAL;
+ np = of_get_child_by_name(node, "simple-audio-card,codec");
+ if (np) {
+- ret = asoc_simple_card_sub_parse_of(np, priv->daifmt,
++ ret = asoc_simple_card_sub_parse_of(np, daifmt,
+ &priv->codec_dai,
+ &dai_link->codec_of_node,
+ &dai_link->codec_dai_name);
+@@ -223,7 +223,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ dai_link->platform_of_node = dai_link->cpu_of_node;
+
+ dev_dbg(dev, "card-name : %s\n", name);
+- dev_dbg(dev, "platform : %04x\n", priv->daifmt);
++ dev_dbg(dev, "platform : %04x\n", daifmt);
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+ dai_link->cpu_dai_name,
+ priv->cpu_dai.fmt,
+--
+2.1.2
+
diff --git a/patches.renesas/0181-ASoC-simple-card-overwrite-cpu_dai-fmt-with-codec_da.patch b/patches.renesas/0181-ASoC-simple-card-overwrite-cpu_dai-fmt-with-codec_da.patch
new file mode 100644
index 00000000000000..5e45bcf8713f31
--- /dev/null
+++ b/patches.renesas/0181-ASoC-simple-card-overwrite-cpu_dai-fmt-with-codec_da.patch
@@ -0,0 +1,109 @@
+From 2ee7150df5dc5a5652f483b97302640ab1273b15 Mon Sep 17 00:00:00 2001
+From: Nicolin Chen <Guangyu.Chen@freescale.com>
+Date: Wed, 12 Mar 2014 11:02:11 +0800
+Subject: ASoC: simple-card: overwrite cpu_dai->fmt with codec_dai->fmt
+
+The current simple-card driver separates the daimft for cpu_dai and codec_dai.
+So we might get different values for them (0x4003 and 0x1003 for example):
+
+asoc-simple-card sound-cs42888.12: cpu : 2024000.esai / 4003 / 132000000
+asoc-simple-card sound-cs42888.12: codec : cs42888 / 1003 / 24576000
+asoc-simple-card sound-cs42888.12: cs42888 <-> 2024000.esai mapping ok
+
+This is not allowed at all as we need to keep the DAIFMT settings identical
+for both the ends of the link.
+
+Thus this patch fixes it by overwriting the cpu_dai->fmt with codec_dai->fmt
+since we defined the DAIFMT_MASTER basing on CODEC at the first place while
+the other bits are same.
+
+Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 46c39cae292fd691f32e573e6c2c854e36614c93)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/sound/simple-card.txt | 6 ++++++
+ sound/soc/generic/simple-card.c | 20 ++++++++++++++------
+ 2 files changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
+index b30c222f9cd3..881914b139ca 100644
+--- a/Documentation/devicetree/bindings/sound/simple-card.txt
++++ b/Documentation/devicetree/bindings/sound/simple-card.txt
+@@ -43,6 +43,12 @@ Optional CPU/CODEC subnodes properties:
+ clock node (= common clock), or "system-clock-frequency"
+ (if system doens't support common clock)
+
++Note:
++ * For 'format', 'frame-master', 'bitclock-master', 'bitclock-inversion' and
++ 'frame-inversion', the simple card will use the settings of CODEC for both
++ CPU and CODEC sides as we need to keep the settings identical for both ends
++ of the link.
++
+ Example:
+
+ sound {
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index ca7e63ef858a..2ee8ed56bcf1 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -151,6 +151,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct device *dev)
+ {
+ struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
++ struct asoc_simple_dai *codec_dai = &priv->codec_dai;
++ struct asoc_simple_dai *cpu_dai = &priv->cpu_dai;
+ struct device_node *np;
+ char *name;
+ unsigned int daifmt;
+@@ -184,7 +186,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ np = of_get_child_by_name(node, "simple-audio-card,cpu");
+ if (np) {
+ ret = asoc_simple_card_sub_parse_of(np, daifmt,
+- &priv->cpu_dai,
++ cpu_dai,
+ &dai_link->cpu_of_node,
+ &dai_link->cpu_dai_name);
+ of_node_put(np);
+@@ -197,7 +199,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ np = of_get_child_by_name(node, "simple-audio-card,codec");
+ if (np) {
+ ret = asoc_simple_card_sub_parse_of(np, daifmt,
+- &priv->codec_dai,
++ codec_dai,
+ &dai_link->codec_of_node,
+ &dai_link->codec_dai_name);
+ of_node_put(np);
+@@ -205,6 +207,12 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ if (ret < 0)
+ return ret;
+
++ /*
++ * overwrite cpu_dai->fmt as its DAIFMT_MASTER bit is based on CODEC
++ * while the other bits should be identical unless buggy SW/HW design.
++ */
++ cpu_dai->fmt = codec_dai->fmt;
++
+ if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name)
+ return -EINVAL;
+
+@@ -226,12 +234,12 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ dev_dbg(dev, "platform : %04x\n", daifmt);
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+ dai_link->cpu_dai_name,
+- priv->cpu_dai.fmt,
+- priv->cpu_dai.sysclk);
++ cpu_dai->fmt,
++ cpu_dai->sysclk);
+ dev_dbg(dev, "codec : %s / %04x / %d\n",
+ dai_link->codec_dai_name,
+- priv->codec_dai.fmt,
+- priv->codec_dai.sysclk);
++ codec_dai->fmt,
++ codec_dai->sysclk);
+
+ /*
+ * soc_bind_dai_link() will check cpu name
+--
+2.1.2
+
diff --git a/patches.renesas/0182-ASoC-simple-card-dynamically-allocate-the-DAI-link-a.patch b/patches.renesas/0182-ASoC-simple-card-dynamically-allocate-the-DAI-link-a.patch
new file mode 100644
index 00000000000000..21aaa9a9b618ad
--- /dev/null
+++ b/patches.renesas/0182-ASoC-simple-card-dynamically-allocate-the-DAI-link-a.patch
@@ -0,0 +1,117 @@
+From 2ba1400d369b523229ae524e73160377e9a878bb Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Thu, 20 Mar 2014 10:52:41 +0100
+Subject: ASoC: simple-card: dynamically allocate the DAI link and properties
+
+The DAI link array and the properties (fmt, sysclk slots) are
+hard-coded for a single CPU / CODEC link.
+
+This patch dynamically allocates the DAI link array and the
+properties with the aim of supporting many DAI links.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit cf7dc23cbfd5c4c5ab2136f19522d9b3b41acf99)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 42 ++++++++++++++++++++++++++---------------
+ 1 file changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 2ee8ed56bcf1..1e865c5d377f 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -20,9 +20,11 @@
+
+ struct simple_card_data {
+ struct snd_soc_card snd_card;
+- struct asoc_simple_dai cpu_dai;
+- struct asoc_simple_dai codec_dai;
+- struct snd_soc_dai_link snd_link;
++ struct simple_dai_props {
++ struct asoc_simple_dai cpu_dai;
++ struct asoc_simple_dai codec_dai;
++ } *dai_props;
++ struct snd_soc_dai_link dai_link[]; /* dynamically allocated */
+ };
+
+ static int __asoc_simple_card_dai_init(struct snd_soc_dai *dai,
+@@ -70,11 +72,11 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ struct snd_soc_dai *cpu = rtd->cpu_dai;
+ int ret;
+
+- ret = __asoc_simple_card_dai_init(codec, &priv->codec_dai);
++ ret = __asoc_simple_card_dai_init(codec, &priv->dai_props->codec_dai);
+ if (ret < 0)
+ return ret;
+
+- ret = __asoc_simple_card_dai_init(cpu, &priv->cpu_dai);
++ ret = __asoc_simple_card_dai_init(cpu, &priv->dai_props->cpu_dai);
+ if (ret < 0)
+ return ret;
+
+@@ -151,8 +153,8 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct device *dev)
+ {
+ struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
+- struct asoc_simple_dai *codec_dai = &priv->codec_dai;
+- struct asoc_simple_dai *cpu_dai = &priv->cpu_dai;
++ struct asoc_simple_dai *codec_dai = &priv->dai_props->codec_dai;
++ struct asoc_simple_dai *cpu_dai = &priv->dai_props->cpu_dai;
+ struct device_node *np;
+ char *name;
+ unsigned int daifmt;
+@@ -284,7 +286,10 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ struct device *dev = &pdev->dev;
+ int ret;
+
+- priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
++ /* allocate the private data and the DAI link array */
++ priv = devm_kzalloc(dev,
++ sizeof(*priv) + sizeof(*dai_link),
++ GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+@@ -293,10 +298,17 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ */
+ priv->snd_card.owner = THIS_MODULE;
+ priv->snd_card.dev = dev;
+- dai_link = &priv->snd_link;
++ dai_link = priv->dai_link;
+ priv->snd_card.dai_link = dai_link;
+ priv->snd_card.num_links = 1;
+
++ /* get room for the other properties */
++ priv->dai_props = devm_kzalloc(dev,
++ sizeof(*priv->dai_props),
++ GFP_KERNEL);
++ if (!priv->dai_props)
++ return -ENOMEM;
++
+ if (np && of_device_is_available(np)) {
+
+ ret = asoc_simple_card_parse_of(np, priv, dev);
+@@ -330,13 +342,13 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ dai_link->codec_name = cinfo->codec;
+ dai_link->cpu_dai_name = cinfo->cpu_dai.name;
+ dai_link->codec_dai_name = cinfo->codec_dai.name;
+- memcpy(&priv->cpu_dai, &cinfo->cpu_dai,
+- sizeof(priv->cpu_dai));
+- memcpy(&priv->codec_dai, &cinfo->codec_dai,
+- sizeof(priv->codec_dai));
++ memcpy(&priv->dai_props->cpu_dai, &cinfo->cpu_dai,
++ sizeof(priv->dai_props->cpu_dai));
++ memcpy(&priv->dai_props->codec_dai, &cinfo->codec_dai,
++ sizeof(priv->dai_props->codec_dai));
+
+- priv->cpu_dai.fmt |= cinfo->daifmt;
+- priv->codec_dai.fmt |= cinfo->daifmt;
++ priv->dai_props->cpu_dai.fmt |= cinfo->daifmt;
++ priv->dai_props->codec_dai.fmt |= cinfo->daifmt;
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0183-ASoC-simple-card-Add-DT-documentation-for-multi-DAI-.patch b/patches.renesas/0183-ASoC-simple-card-Add-DT-documentation-for-multi-DAI-.patch
new file mode 100644
index 00000000000000..b66ac51f4b2eac
--- /dev/null
+++ b/patches.renesas/0183-ASoC-simple-card-Add-DT-documentation-for-multi-DAI-.patch
@@ -0,0 +1,83 @@
+From 1cf5ea91c65ef200e19cdd7ffa3176768e8d9fee Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Thu, 20 Mar 2014 11:04:16 +0100
+Subject: ASoC: simple-card: Add DT documentation for multi-DAI links
+
+Many couples of CPU/CODEC DAI links may be described in the DT
+thanks to 'simple-audio-card,dai-link' containers.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 015f630de86c8a79df45c475c34087d3e96b882a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ .../devicetree/bindings/sound/simple-card.txt | 42 +++++++++++++++++++++-
+ 1 file changed, 41 insertions(+), 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/sound/simple-card.txt b/Documentation/devicetree/bindings/sound/simple-card.txt
+index 881914b139ca..131aa2ad7f1a 100644
+--- a/Documentation/devicetree/bindings/sound/simple-card.txt
++++ b/Documentation/devicetree/bindings/sound/simple-card.txt
+@@ -23,6 +23,11 @@ Optional properties:
+
+ Required subnodes:
+
++- simple-audio-card,dai-link : container for the CPU and CODEC sub-nodes
++ This container may be omitted when the
++ card has only one DAI link.
++ See the examples.
++
+ - simple-audio-card,cpu : CPU sub-node
+ - simple-audio-card,codec : CODEC sub-node
+
+@@ -49,7 +54,7 @@ Note:
+ CPU and CODEC sides as we need to keep the settings identical for both ends
+ of the link.
+
+-Example:
++Example 1 - single DAI link:
+
+ sound {
+ compatible = "simple-audio-card";
+@@ -94,3 +99,38 @@ sh_fsi2: sh_fsi2@ec230000 {
+ interrupt-parent = <&gic>;
+ interrupts = <0 146 0x4>;
+ };
++
++Example 2 - many DAI links:
++
++sound {
++ compatible = "simple-audio-card";
++ simple-audio-card,name = "Cubox Audio";
++ simple-audio-card,format = "i2s";
++
++ simple-audio-card,dai-link@0 { /* I2S - HDMI */
++ simple-audio-card,cpu {
++ sound-dai = <&audio1 0>;
++ };
++ simple-audio-card,codec {
++ sound-dai = <&tda998x 0>;
++ };
++ };
++
++ simple-audio-card,dai-link@1 { /* S/PDIF - HDMI */
++ simple-audio-card,cpu {
++ sound-dai = <&audio1 1>;
++ };
++ simple-audio-card,codec {
++ sound-dai = <&tda998x 1>;
++ };
++ };
++
++ simple-audio-card,dai-link@2 { /* S/PDIF - S/PDIF */
++ simple-audio-card,cpu {
++ sound-dai = <&audio1 1>;
++ };
++ simple-audio-card,codec {
++ sound-dai = <&spdif_codec>;
++ };
++ };
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0184-ASoC-simple-card-Handle-many-DAI-links.patch b/patches.renesas/0184-ASoC-simple-card-Handle-many-DAI-links.patch
new file mode 100644
index 00000000000000..1807ed0104e134
--- /dev/null
+++ b/patches.renesas/0184-ASoC-simple-card-Handle-many-DAI-links.patch
@@ -0,0 +1,287 @@
+From f0c379cb595d7e31fa6784f29470e433e6dbb287 Mon Sep 17 00:00:00 2001
+From: Jean-Francois Moine <moinejf@free.fr>
+Date: Thu, 20 Mar 2014 11:49:55 +0100
+Subject: ASoC: simple-card: Handle many DAI links
+
+Some simple audio cards may have many DAI links.
+This patch extends the simple-card driver for handling such cards.
+
+Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6a91a17bd7b92b2d2aa9ece85457f52a62fd7708)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ sound/soc/generic/simple-card.c | 190 +++++++++++++++++++++++++---------------
+ 1 file changed, 121 insertions(+), 69 deletions(-)
+
+diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
+index 1e865c5d377f..21f1ccbdf582 100644
+--- a/sound/soc/generic/simple-card.c
++++ b/sound/soc/generic/simple-card.c
+@@ -70,13 +70,16 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
+ snd_soc_card_get_drvdata(rtd->card);
+ struct snd_soc_dai *codec = rtd->codec_dai;
+ struct snd_soc_dai *cpu = rtd->cpu_dai;
+- int ret;
++ struct simple_dai_props *dai_props;
++ int num, ret;
+
+- ret = __asoc_simple_card_dai_init(codec, &priv->dai_props->codec_dai);
++ num = rtd - rtd->card->rtd;
++ dai_props = &priv->dai_props[num];
++ ret = __asoc_simple_card_dai_init(codec, &dai_props->codec_dai);
+ if (ret < 0)
+ return ret;
+
+- ret = __asoc_simple_card_dai_init(cpu, &priv->dai_props->cpu_dai);
++ ret = __asoc_simple_card_dai_init(cpu, &dai_props->cpu_dai);
+ if (ret < 0)
+ return ret;
+
+@@ -148,13 +151,47 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
+ return 0;
+ }
+
++static int simple_card_cpu_codec_of(struct device_node *node,
++ int daifmt,
++ struct snd_soc_dai_link *dai_link,
++ struct simple_dai_props *dai_props)
++{
++ struct device_node *np;
++ int ret;
++
++ /* CPU sub-node */
++ ret = -EINVAL;
++ np = of_get_child_by_name(node, "simple-audio-card,cpu");
++ if (np) {
++ ret = asoc_simple_card_sub_parse_of(np, daifmt,
++ &dai_props->cpu_dai,
++ &dai_link->cpu_of_node,
++ &dai_link->cpu_dai_name);
++ of_node_put(np);
++ }
++ if (ret < 0)
++ return ret;
++
++ /* CODEC sub-node */
++ ret = -EINVAL;
++ np = of_get_child_by_name(node, "simple-audio-card,codec");
++ if (np) {
++ ret = asoc_simple_card_sub_parse_of(np, daifmt,
++ &dai_props->codec_dai,
++ &dai_link->codec_of_node,
++ &dai_link->codec_dai_name);
++ of_node_put(np);
++ }
++ return ret;
++}
++
+ static int asoc_simple_card_parse_of(struct device_node *node,
+ struct simple_card_data *priv,
+- struct device *dev)
++ struct device *dev,
++ int multi)
+ {
+ struct snd_soc_dai_link *dai_link = priv->snd_card.dai_link;
+- struct asoc_simple_dai *codec_dai = &priv->dai_props->codec_dai;
+- struct asoc_simple_dai *cpu_dai = &priv->dai_props->cpu_dai;
++ struct simple_dai_props *dai_props = priv->dai_props;
+ struct device_node *np;
+ char *name;
+ unsigned int daifmt;
+@@ -183,78 +220,71 @@ static int asoc_simple_card_parse_of(struct device_node *node,
+ return ret;
+ }
+
+- /* CPU sub-node */
+- ret = -EINVAL;
+- np = of_get_child_by_name(node, "simple-audio-card,cpu");
+- if (np) {
+- ret = asoc_simple_card_sub_parse_of(np, daifmt,
+- cpu_dai,
+- &dai_link->cpu_of_node,
+- &dai_link->cpu_dai_name);
+- of_node_put(np);
+- }
+- if (ret < 0)
+- return ret;
++ /* loop on the DAI links */
++ np = NULL;
++ for (;;) {
++ if (multi) {
++ np = of_get_next_child(node, np);
++ if (!np)
++ break;
++ }
+
+- /* CODEC sub-node */
+- ret = -EINVAL;
+- np = of_get_child_by_name(node, "simple-audio-card,codec");
+- if (np) {
+- ret = asoc_simple_card_sub_parse_of(np, daifmt,
+- codec_dai,
+- &dai_link->codec_of_node,
+- &dai_link->codec_dai_name);
+- of_node_put(np);
+- }
+- if (ret < 0)
+- return ret;
++ ret = simple_card_cpu_codec_of(multi ? np : node,
++ daifmt, dai_link, dai_props);
++ if (ret < 0)
++ goto err;
+
+- /*
+- * overwrite cpu_dai->fmt as its DAIFMT_MASTER bit is based on CODEC
+- * while the other bits should be identical unless buggy SW/HW design.
+- */
+- cpu_dai->fmt = codec_dai->fmt;
++ /*
++ * overwrite cpu_dai->fmt as its DAIFMT_MASTER bit is based on CODEC
++ * while the other bits should be identical unless buggy SW/HW design.
++ */
++ dai_props->cpu_dai.fmt = dai_props->codec_dai.fmt;
++
++ if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) {
++ ret = -EINVAL;
++ goto err;
++ }
++
++ /* simple-card assumes platform == cpu */
++ dai_link->platform_of_node = dai_link->cpu_of_node;
+
+- if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name)
+- return -EINVAL;
++ name = devm_kzalloc(dev,
++ strlen(dai_link->cpu_dai_name) +
++ strlen(dai_link->codec_dai_name) + 2,
++ GFP_KERNEL);
++ sprintf(name, "%s-%s", dai_link->cpu_dai_name,
++ dai_link->codec_dai_name);
++ dai_link->name = dai_link->stream_name = name;
++
++ if (!multi)
++ break;
++
++ dai_link++;
++ dai_props++;
++ }
+
+ /* card name is created from CPU/CODEC dai name */
+- name = devm_kzalloc(dev,
+- strlen(dai_link->cpu_dai_name) +
+- strlen(dai_link->codec_dai_name) + 2,
+- GFP_KERNEL);
+- sprintf(name, "%s-%s", dai_link->cpu_dai_name,
+- dai_link->codec_dai_name);
++ dai_link = priv->snd_card.dai_link;
+ if (!priv->snd_card.name)
+- priv->snd_card.name = name;
+- dai_link->name = dai_link->stream_name = name;
+-
+- /* simple-card assumes platform == cpu */
+- dai_link->platform_of_node = dai_link->cpu_of_node;
++ priv->snd_card.name = dai_link->name;
+
+- dev_dbg(dev, "card-name : %s\n", name);
++ dev_dbg(dev, "card-name : %s\n", priv->snd_card.name);
+ dev_dbg(dev, "platform : %04x\n", daifmt);
++ dai_props = priv->dai_props;
+ dev_dbg(dev, "cpu : %s / %04x / %d\n",
+ dai_link->cpu_dai_name,
+- cpu_dai->fmt,
+- cpu_dai->sysclk);
++ dai_props->cpu_dai.fmt,
++ dai_props->cpu_dai.sysclk);
+ dev_dbg(dev, "codec : %s / %04x / %d\n",
+ dai_link->codec_dai_name,
+- codec_dai->fmt,
+- codec_dai->sysclk);
+-
+- /*
+- * soc_bind_dai_link() will check cpu name
+- * after of_node matching if dai_link has cpu_dai_name.
+- * but, it will never match if name was created by fmt_single_name()
+- * remove cpu_dai_name to escape name matching.
+- * see
+- * fmt_single_name()
+- * fmt_multiple_name()
+- */
+- dai_link->cpu_dai_name = NULL;
++ dai_props->codec_dai.fmt,
++ dai_props->codec_dai.sysclk);
+
+ return 0;
++
++err:
++ of_node_put(np);
++ return ret;
+ }
+
+ /* update the reference count of the devices nodes at end of probe */
+@@ -284,11 +314,20 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ struct snd_soc_dai_link *dai_link;
+ struct device_node *np = pdev->dev.of_node;
+ struct device *dev = &pdev->dev;
+- int ret;
++ int num_links, multi, ret;
++
++ /* get the number of DAI links */
++ if (np && of_get_child_by_name(np, "simple-audio-card,dai-link")) {
++ num_links = of_get_child_count(np);
++ multi = 1;
++ } else {
++ num_links = 1;
++ multi = 0;
++ }
+
+ /* allocate the private data and the DAI link array */
+ priv = devm_kzalloc(dev,
+- sizeof(*priv) + sizeof(*dai_link),
++ sizeof(*priv) + sizeof(*dai_link) * num_links,
+ GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+@@ -300,23 +339,36 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
+ priv->snd_card.dev = dev;
+ dai_link = priv->dai_link;
+ priv->snd_card.dai_link = dai_link;
+- priv->snd_card.num_links = 1;
++ priv->snd_card.num_links = num_links;
+
+ /* get room for the other properties */
+ priv->dai_props = devm_kzalloc(dev,
+- sizeof(*priv->dai_props),
++ sizeof(*priv->dai_props) * num_links,
+ GFP_KERNEL);
+ if (!priv->dai_props)
+ return -ENOMEM;
+
+ if (np && of_device_is_available(np)) {
+
+- ret = asoc_simple_card_parse_of(np, priv, dev);
++ ret = asoc_simple_card_parse_of(np, priv, dev, multi);
+ if (ret < 0) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "parse error %d\n", ret);
+ goto err;
+ }
++
++ /*
++ * soc_bind_dai_link() will check cpu name
++ * after of_node matching if dai_link has cpu_dai_name.
++ * but, it will never match if name was created by fmt_single_name()
++ * remove cpu_dai_name to escape name matching.
++ * see
++ * fmt_single_name()
++ * fmt_multiple_name()
++ */
++ if (num_links == 1)
++ dai_link->cpu_dai_name = NULL;
++
+ } else {
+ struct asoc_simple_card_info *cinfo;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0185-spi-delete-non-required-instances-of-include-linux-i.patch b/patches.renesas/0185-spi-delete-non-required-instances-of-include-linux-i.patch
new file mode 100644
index 00000000000000..7c258a0232ab0b
--- /dev/null
+++ b/patches.renesas/0185-spi-delete-non-required-instances-of-include-linux-i.patch
@@ -0,0 +1,397 @@
+From db415ed6fbe8adfb1e2ae191166c0a0cd883ed2d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 21 Jan 2014 16:22:47 -0500
+Subject: spi: delete non-required instances of include <linux/init.h>
+
+None of these files are actually using any __init type directives
+and hence don't need to include <linux/init.h>. Most are just a
+left over from __devinit and __cpuinit removal, or simply due to
+code getting copied from one driver to the next.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 3a44623d5e1404b29786f1afd225d1aa04a4ae90)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-altera.c | 1 -
+ drivers/spi/spi-ath79.c | 1 -
+ drivers/spi/spi-atmel.c | 1 -
+ drivers/spi/spi-bcm63xx.c | 1 -
+ drivers/spi/spi-bfin-sport.c | 1 -
+ drivers/spi/spi-bitbang.c | 1 -
+ drivers/spi/spi-clps711x.c | 1 -
+ drivers/spi/spi-gpio.c | 1 -
+ drivers/spi/spi-imx.c | 1 -
+ drivers/spi/spi-mpc512x-psc.c | 1 -
+ drivers/spi/spi-mpc52xx-psc.c | 1 -
+ drivers/spi/spi-mpc52xx.c | 1 -
+ drivers/spi/spi-mxs.c | 1 -
+ drivers/spi/spi-nuc900.c | 1 -
+ drivers/spi/spi-oc-tiny.c | 1 -
+ drivers/spi/spi-octeon.c | 1 -
+ drivers/spi/spi-omap2-mcspi.c | 1 -
+ drivers/spi/spi-orion.c | 1 -
+ drivers/spi/spi-ppc4xx.c | 1 -
+ drivers/spi/spi-pxa2xx-dma.c | 1 -
+ drivers/spi/spi-pxa2xx-pxadma.c | 1 -
+ drivers/spi/spi-s3c24xx.c | 1 -
+ drivers/spi/spi-sh-msiof.c | 1 -
+ drivers/spi/spi-sh-sci.c | 1 -
+ drivers/spi/spi-tegra114.c | 1 -
+ drivers/spi/spi-tegra20-sflash.c | 1 -
+ drivers/spi/spi-tegra20-slink.c | 1 -
+ drivers/spi/spi-xcomm.c | 1 -
+ drivers/spi/spi-xilinx.c | 1 -
+ 29 files changed, 29 deletions(-)
+
+diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
+index 5d7deaf62867..1928b835e870 100644
+--- a/drivers/spi/spi-altera.c
++++ b/drivers/spi/spi-altera.c
+@@ -13,7 +13,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c
+index c3b2fb9b6713..3898b0b9ee77 100644
+--- a/drivers/spi/spi-ath79.c
++++ b/drivers/spi/spi-ath79.c
+@@ -14,7 +14,6 @@
+
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/delay.h>
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
+index 5d7b07f08326..af8a3361970c 100644
+--- a/drivers/spi/spi-atmel.c
++++ b/drivers/spi/spi-atmel.c
+@@ -9,7 +9,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/clk.h>
+ #include <linux/module.h>
+ #include <linux/platform_device.h>
+diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
+index 77286aef2adf..9e9ee5f08647 100644
+--- a/drivers/spi/spi-bcm63xx.c
++++ b/drivers/spi/spi-bcm63xx.c
+@@ -20,7 +20,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/module.h>
+diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c
+index 38941e5920b5..f515c5e9db57 100644
+--- a/drivers/spi/spi-bfin-sport.c
++++ b/drivers/spi/spi-bfin-sport.c
+@@ -8,7 +8,6 @@
+ * Licensed under the GPL-2 or later.
+ */
+
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/delay.h>
+ #include <linux/device.h>
+diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c
+index bd222f6b677d..3bfdb851960b 100644
+--- a/drivers/spi/spi-bitbang.c
++++ b/drivers/spi/spi-bitbang.c
+@@ -16,7 +16,6 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+-#include <linux/init.h>
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c
+index 374ba4a48a9e..bee864de5305 100644
+--- a/drivers/spi/spi-clps711x.c
++++ b/drivers/spi/spi-clps711x.c
+@@ -11,7 +11,6 @@
+
+ #include <linux/io.h>
+ #include <linux/clk.h>
+-#include <linux/init.h>
+ #include <linux/gpio.h>
+ #include <linux/delay.h>
+ #include <linux/module.h>
+diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
+index 7beeb29472ac..cfc9fb3048d8 100644
+--- a/drivers/spi/spi-gpio.c
++++ b/drivers/spi/spi-gpio.c
+@@ -19,7 +19,6 @@
+ */
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/platform_device.h>
+ #include <linux/gpio.h>
+ #include <linux/of.h>
+diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
+index 47f15d97e7fa..3af247c71dbd 100644
+--- a/drivers/spi/spi-imx.c
++++ b/drivers/spi/spi-imx.c
+@@ -23,7 +23,6 @@
+ #include <linux/delay.h>
+ #include <linux/err.h>
+ #include <linux/gpio.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/irq.h>
+diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
+index 5032141eeeec..56cead98e7a5 100644
+--- a/drivers/spi/spi-mpc512x-psc.c
++++ b/drivers/spi/spi-mpc512x-psc.c
+@@ -16,7 +16,6 @@
+
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/errno.h>
+ #include <linux/interrupt.h>
+ #include <linux/of_address.h>
+diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
+index 00ba910ab302..3d18d9351185 100644
+--- a/drivers/spi/spi-mpc52xx-psc.c
++++ b/drivers/spi/spi-mpc52xx-psc.c
+@@ -12,7 +12,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/types.h>
+ #include <linux/errno.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c
+index 7c675fe83101..f573c3c09968 100644
+--- a/drivers/spi/spi-mpc52xx.c
++++ b/drivers/spi/spi-mpc52xx.c
+@@ -12,7 +12,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/errno.h>
+ #include <linux/of_platform.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
+index 79e5aa2250c8..17bb9a9285ab 100644
+--- a/drivers/spi/spi-mxs.c
++++ b/drivers/spi/spi-mxs.c
+@@ -29,7 +29,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/ioport.h>
+ #include <linux/of.h>
+ #include <linux/of_device.h>
+diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c
+index bae97ffec4b9..d8d55c7f7075 100644
+--- a/drivers/spi/spi-nuc900.c
++++ b/drivers/spi/spi-nuc900.c
+@@ -9,7 +9,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c
+index f7c896e2981e..022774e158f1 100644
+--- a/drivers/spi/spi-oc-tiny.c
++++ b/drivers/spi/spi-oc-tiny.c
+@@ -15,7 +15,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+diff --git a/drivers/spi/spi-octeon.c b/drivers/spi/spi-octeon.c
+index 67249a48b391..5665ae9ed92f 100644
+--- a/drivers/spi/spi-octeon.c
++++ b/drivers/spi/spi-octeon.c
+@@ -11,7 +11,6 @@
+ #include <linux/spi/spi.h>
+ #include <linux/module.h>
+ #include <linux/delay.h>
+-#include <linux/init.h>
+ #include <linux/io.h>
+ #include <linux/of.h>
+
+diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
+index a72127f08e39..94f133cb2770 100644
+--- a/drivers/spi/spi-omap2-mcspi.c
++++ b/drivers/spi/spi-omap2-mcspi.c
+@@ -22,7 +22,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/module.h>
+ #include <linux/device.h>
+diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
+index 7f2121fe2622..a362425400ea 100644
+--- a/drivers/spi/spi-orion.c
++++ b/drivers/spi/spi-orion.c
+@@ -9,7 +9,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/delay.h>
+ #include <linux/platform_device.h>
+diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
+index 5ee56726f8d0..80b8408ac3e3 100644
+--- a/drivers/spi/spi-ppc4xx.c
++++ b/drivers/spi/spi-ppc4xx.c
+@@ -24,7 +24,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/sched.h>
+ #include <linux/slab.h>
+ #include <linux/errno.h>
+diff --git a/drivers/spi/spi-pxa2xx-dma.c b/drivers/spi/spi-pxa2xx-dma.c
+index 3c0b55125f1e..713af4806f26 100644
+--- a/drivers/spi/spi-pxa2xx-dma.c
++++ b/drivers/spi/spi-pxa2xx-dma.c
+@@ -9,7 +9,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/init.h>
+ #include <linux/device.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/dmaengine.h>
+diff --git a/drivers/spi/spi-pxa2xx-pxadma.c b/drivers/spi/spi-pxa2xx-pxadma.c
+index 2916efc7cfe5..e8a26f25d5c0 100644
+--- a/drivers/spi/spi-pxa2xx-pxadma.c
++++ b/drivers/spi/spi-pxa2xx-pxadma.c
+@@ -18,7 +18,6 @@
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+-#include <linux/init.h>
+ #include <linux/delay.h>
+ #include <linux/device.h>
+ #include <linux/dma-mapping.h>
+diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
+index 746424aa5353..c20df45204e2 100644
+--- a/drivers/spi/spi-s3c24xx.c
++++ b/drivers/spi/spi-s3c24xx.c
+@@ -9,7 +9,6 @@
+ *
+ */
+
+-#include <linux/init.h>
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+ #include <linux/interrupt.h>
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 81cc02f5f9b0..33474061b742 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -15,7 +15,6 @@
+ #include <linux/delay.h>
+ #include <linux/err.h>
+ #include <linux/gpio.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
+diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c
+index 38eb24df796c..85c2efd57c80 100644
+--- a/drivers/spi/spi-sh-sci.c
++++ b/drivers/spi/spi-sh-sci.c
+@@ -14,7 +14,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/delay.h>
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
+index 413c71843492..3f61bbf643e2 100644
+--- a/drivers/spi/spi-tegra114.c
++++ b/drivers/spi/spi-tegra114.c
+@@ -23,7 +23,6 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/dmapool.h>
+ #include <linux/err.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
+diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c
+index 08794977f21a..18037ab646d6 100644
+--- a/drivers/spi/spi-tegra20-sflash.c
++++ b/drivers/spi/spi-tegra20-sflash.c
+@@ -22,7 +22,6 @@
+ #include <linux/completion.h>
+ #include <linux/delay.h>
+ #include <linux/err.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
+diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
+index be3a069879c3..8d62710d587e 100644
+--- a/drivers/spi/spi-tegra20-slink.c
++++ b/drivers/spi/spi-tegra20-slink.c
+@@ -23,7 +23,6 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/dmapool.h>
+ #include <linux/err.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
+diff --git a/drivers/spi/spi-xcomm.c b/drivers/spi/spi-xcomm.c
+index 24c40b13dab1..350a76b7e8d4 100644
+--- a/drivers/spi/spi-xcomm.c
++++ b/drivers/spi/spi-xcomm.c
+@@ -8,7 +8,6 @@
+ */
+
+ #include <linux/kernel.h>
+-#include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/delay.h>
+ #include <linux/i2c.h>
+diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
+index 6d4ce4615163..e6cd1112ae40 100644
+--- a/drivers/spi/spi-xilinx.c
++++ b/drivers/spi/spi-xilinx.c
+@@ -14,7 +14,6 @@
+ */
+
+ #include <linux/module.h>
+-#include <linux/init.h>
+ #include <linux/interrupt.h>
+ #include <linux/of.h>
+ #include <linux/platform_device.h>
+--
+2.1.2
+
diff --git a/patches.renesas/0186-spi-sh-msiof-Fix-SPI-bus-population-from-DT.patch b/patches.renesas/0186-spi-sh-msiof-Fix-SPI-bus-population-from-DT.patch
new file mode 100644
index 00000000000000..b95225d9c731d5
--- /dev/null
+++ b/patches.renesas/0186-spi-sh-msiof-Fix-SPI-bus-population-from-DT.patch
@@ -0,0 +1,31 @@
+From 4c1aed6f26cac18e43786211ab888bb38b7a7b41 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:43:00 +0100
+Subject: spi: sh-msiof: Fix SPI bus population from DT
+
+DT doesn't instantiate SPI children if spi_master.dev.of_node is not set up
+properly.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit f7c05e837df794d2aaf19174269a270c93a52eca)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 33474061b742..e6f79b2f2616 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -710,6 +710,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE;
+ master->flags = 0;
+ master->bus_num = pdev->id;
++ master->dev.of_node = pdev->dev.of_node;
+ master->num_chipselect = p->info->num_chipselect;
+ master->setup = spi_bitbang_setup;
+ master->cleanup = spi_bitbang_cleanup;
+--
+2.1.2
+
diff --git a/patches.renesas/0187-spi-sh-msiof-Typo-in-comment-s-tx-rx.patch b/patches.renesas/0187-spi-sh-msiof-Typo-in-comment-s-tx-rx.patch
new file mode 100644
index 00000000000000..ecb9908e5ad43b
--- /dev/null
+++ b/patches.renesas/0187-spi-sh-msiof-Typo-in-comment-s-tx-rx.patch
@@ -0,0 +1,29 @@
+From 69c74785dc7cd2b3b7f1b15eca00549f8d5eca08 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:43:01 +0100
+Subject: spi: sh-msiof: Typo in comment s/tx/rx/
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit a669c11a0df07477afbfeb53bc9d8fc989d1ed59)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index e6f79b2f2616..cc12e755131d 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -486,7 +486,7 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
+ /* clear status bits */
+ sh_msiof_reset_str(p);
+
+- /* shut down frame, tx/tx and clock signals */
++ /* shut down frame, rx/tx and clock signals */
+ ret = sh_msiof_modify_ctr_wait(p, CTR_TFSE, 0);
+ ret = ret ? ret : sh_msiof_modify_ctr_wait(p, CTR_TXE, 0);
+ if (rx_buf)
+--
+2.1.2
+
diff --git a/patches.renesas/0188-spi-sh-msiof-Change-hz-from-unsigned-long-to-u32.patch b/patches.renesas/0188-spi-sh-msiof-Change-hz-from-unsigned-long-to-u32.patch
new file mode 100644
index 00000000000000..e402192d5dbf86
--- /dev/null
+++ b/patches.renesas/0188-spi-sh-msiof-Change-hz-from-unsigned-long-to-u32.patch
@@ -0,0 +1,45 @@
+From 81ed312fbb994257d636e6857849c4e5b0cdc4b0 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:43:02 +0100
+Subject: spi: sh-msiof: Change hz from unsigned long to u32
+
+Both spi_transfer.speed_hz and spi_master.max_speed_hz are u32
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6a85fc5af1f09982e50abe56efc70eda9ad24632)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index cc12e755131d..af9f2db41b16 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -144,8 +144,7 @@ static struct {
+ };
+
+ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p,
+- unsigned long parent_rate,
+- unsigned long spi_hz)
++ unsigned long parent_rate, u32 spi_hz)
+ {
+ unsigned long div = 1024;
+ size_t k;
+@@ -372,10 +371,9 @@ static int sh_msiof_spi_bits(struct spi_device *spi, struct spi_transfer *t)
+ return bits;
+ }
+
+-static unsigned long sh_msiof_spi_hz(struct spi_device *spi,
+- struct spi_transfer *t)
++static u32 sh_msiof_spi_hz(struct spi_device *spi, struct spi_transfer *t)
+ {
+- unsigned long hz;
++ u32 hz;
+
+ hz = t ? t->speed_hz : 0;
+ if (!hz)
+--
+2.1.2
+
diff --git a/patches.renesas/0189-spi-sh-msiof-Add-more-register-documentation.patch b/patches.renesas/0189-spi-sh-msiof-Add-more-register-documentation.patch
new file mode 100644
index 00000000000000..31cbb57bc7f836
--- /dev/null
+++ b/patches.renesas/0189-spi-sh-msiof-Add-more-register-documentation.patch
@@ -0,0 +1,215 @@
+From 2733d8ec32c4e3ebc6aef2e46e68435488203cd4 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:43:03 +0100
+Subject: spi: sh-msiof: Add more register documentation
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 01cfef57efe9c8ef445d4a5ad3bf26770fd5942a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 152 +++++++++++++++++++++++++++++----------------
+ 1 file changed, 100 insertions(+), 52 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index af9f2db41b16..79e14586049b 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -41,32 +41,80 @@ struct sh_msiof_spi_priv {
+ int rx_fifo_size;
+ };
+
+-#define TMDR1 0x00
+-#define TMDR2 0x04
+-#define TMDR3 0x08
+-#define RMDR1 0x10
+-#define RMDR2 0x14
+-#define RMDR3 0x18
+-#define TSCR 0x20
+-#define RSCR 0x22
+-#define CTR 0x28
+-#define FCTR 0x30
+-#define STR 0x40
+-#define IER 0x44
+-#define TDR1 0x48
+-#define TDR2 0x4c
+-#define TFDR 0x50
+-#define RDR1 0x58
+-#define RDR2 0x5c
+-#define RFDR 0x60
+-
+-#define CTR_TSCKE (1 << 15)
+-#define CTR_TFSE (1 << 14)
+-#define CTR_TXE (1 << 9)
+-#define CTR_RXE (1 << 8)
+-
+-#define STR_TEOF (1 << 23)
+-#define STR_REOF (1 << 7)
++#define TMDR1 0x00 /* Transmit Mode Register 1 */
++#define TMDR2 0x04 /* Transmit Mode Register 2 */
++#define TMDR3 0x08 /* Transmit Mode Register 3 */
++#define RMDR1 0x10 /* Receive Mode Register 1 */
++#define RMDR2 0x14 /* Receive Mode Register 2 */
++#define RMDR3 0x18 /* Receive Mode Register 3 */
++#define TSCR 0x20 /* Transmit Clock Select Register */
++#define RSCR 0x22 /* Receive Clock Select Register (SH, A1, APE6) */
++#define CTR 0x28 /* Control Register */
++#define FCTR 0x30 /* FIFO Control Register */
++#define STR 0x40 /* Status Register */
++#define IER 0x44 /* Interrupt Enable Register */
++#define TDR1 0x48 /* Transmit Control Data Register 1 (SH, A1) */
++#define TDR2 0x4c /* Transmit Control Data Register 2 (SH, A1) */
++#define TFDR 0x50 /* Transmit FIFO Data Register */
++#define RDR1 0x58 /* Receive Control Data Register 1 (SH, A1) */
++#define RDR2 0x5c /* Receive Control Data Register 2 (SH, A1) */
++#define RFDR 0x60 /* Receive FIFO Data Register */
++
++/* TMDR1 and RMDR1 */
++#define MDR1_TRMD 0x80000000 /* Transfer Mode (1 = Master mode) */
++#define MDR1_SYNCMD_MASK 0x30000000 /* SYNC Mode */
++#define MDR1_SYNCMD_SPI 0x20000000 /* Level mode/SPI */
++#define MDR1_SYNCMD_LR 0x30000000 /* L/R mode */
++#define MDR1_SYNCAC_SHIFT 25 /* Sync Polarity (1 = Active-low) */
++#define MDR1_BITLSB_SHIFT 24 /* MSB/LSB First (1 = LSB first) */
++#define MDR1_FLD_MASK 0x000000c0 /* Frame Sync Signal Interval (0-3) */
++#define MDR1_FLD_SHIFT 2
++#define MDR1_XXSTP 0x00000001 /* Transmission/Reception Stop on FIFO */
++/* TMDR1 */
++#define TMDR1_PCON 0x40000000 /* Transfer Signal Connection */
++
++/* TMDR2 and RMDR2 */
++#define MDR2_BITLEN1(i) (((i) - 1) << 24) /* Data Size (8-32 bits) */
++#define MDR2_WDLEN1(i) (((i) - 1) << 16) /* Word Count (1-64/256 (SH, A1))) */
++#define MDR2_GRPMASK1 0x00000001 /* Group Output Mask 1 (SH, A1) */
++
++/* TSCR and RSCR */
++#define SCR_BRPS_MASK 0x1f00 /* Prescaler Setting (1-32) */
++#define SCR_BRPS(i) (((i) - 1) << 8)
++#define SCR_BRDV_MASK 0x0007 /* Baud Rate Generator's Division Ratio */
++#define SCR_BRDV_DIV_2 0x0000
++#define SCR_BRDV_DIV_4 0x0001
++#define SCR_BRDV_DIV_8 0x0002
++#define SCR_BRDV_DIV_16 0x0003
++#define SCR_BRDV_DIV_32 0x0004
++#define SCR_BRDV_DIV_1 0x0007
++
++/* CTR */
++#define CTR_TSCKIZ_MASK 0xc0000000 /* Transmit Clock I/O Polarity Select */
++#define CTR_TSCKIZ_SCK 0x80000000 /* Disable SCK when TX disabled */
++#define CTR_TSCKIZ_POL_SHIFT 30 /* Transmit Clock Polarity */
++#define CTR_RSCKIZ_MASK 0x30000000 /* Receive Clock Polarity Select */
++#define CTR_RSCKIZ_SCK 0x20000000 /* Must match CTR_TSCKIZ_SCK */
++#define CTR_RSCKIZ_POL_SHIFT 28 /* Receive Clock Polarity */
++#define CTR_TEDG_SHIFT 27 /* Transmit Timing (1 = falling edge) */
++#define CTR_REDG_SHIFT 26 /* Receive Timing (1 = falling edge) */
++#define CTR_TXDIZ_MASK 0x00c00000 /* Pin Output When TX is Disabled */
++#define CTR_TXDIZ_LOW 0x00000000 /* 0 */
++#define CTR_TXDIZ_HIGH 0x00400000 /* 1 */
++#define CTR_TXDIZ_HIZ 0x00800000 /* High-impedance */
++#define CTR_TSCKE 0x00008000 /* Transmit Serial Clock Output Enable */
++#define CTR_TFSE 0x00004000 /* Transmit Frame Sync Signal Output Enable */
++#define CTR_TXE 0x00000200 /* Transmit Enable */
++#define CTR_RXE 0x00000100 /* Receive Enable */
++
++/* STR and IER */
++#define STR_TEOF 0x00800000 /* Frame Transmission End */
++#define STR_REOF 0x00000080 /* Frame Reception End */
++
++
++#define DEFAULT_TX_FIFO_SIZE 64
++#define DEFAULT_RX_FIFO_SIZE 64
++
+
+ static u32 sh_msiof_read(struct sh_msiof_spi_priv *p, int reg_offs)
+ {
+@@ -130,17 +178,17 @@ static struct {
+ unsigned short div;
+ unsigned short scr;
+ } const sh_msiof_spi_clk_table[] = {
+- { 1, 0x0007 },
+- { 2, 0x0000 },
+- { 4, 0x0001 },
+- { 8, 0x0002 },
+- { 16, 0x0003 },
+- { 32, 0x0004 },
+- { 64, 0x1f00 },
+- { 128, 0x1f01 },
+- { 256, 0x1f02 },
+- { 512, 0x1f03 },
+- { 1024, 0x1f04 },
++ { 1, SCR_BRPS( 1) | SCR_BRDV_DIV_1 },
++ { 2, SCR_BRPS( 1) | SCR_BRDV_DIV_2 },
++ { 4, SCR_BRPS( 1) | SCR_BRDV_DIV_4 },
++ { 8, SCR_BRPS( 1) | SCR_BRDV_DIV_8 },
++ { 16, SCR_BRPS( 1) | SCR_BRDV_DIV_16 },
++ { 32, SCR_BRPS( 1) | SCR_BRDV_DIV_32 },
++ { 64, SCR_BRPS(32) | SCR_BRDV_DIV_2 },
++ { 128, SCR_BRPS(32) | SCR_BRDV_DIV_4 },
++ { 256, SCR_BRPS(32) | SCR_BRDV_DIV_8 },
++ { 512, SCR_BRPS(32) | SCR_BRDV_DIV_16 },
++ { 1024, SCR_BRPS(32) | SCR_BRDV_DIV_32 },
+ };
+
+ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p,
+@@ -181,21 +229,21 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
+ */
+ sh_msiof_write(p, FCTR, 0);
+
+- tmp = 0;
+- tmp |= !cs_high << 25;
+- tmp |= lsb_first << 24;
+- sh_msiof_write(p, TMDR1, 0xe0000005 | tmp);
+- sh_msiof_write(p, RMDR1, 0x20000005 | tmp);
++ tmp = MDR1_SYNCMD_SPI | 1 << MDR1_FLD_SHIFT | MDR1_XXSTP;
++ tmp |= !cs_high << MDR1_SYNCAC_SHIFT;
++ tmp |= lsb_first << MDR1_BITLSB_SHIFT;
++ sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON);
++ sh_msiof_write(p, RMDR1, tmp);
+
+- tmp = 0xa0000000;
+- tmp |= cpol << 30; /* TSCKIZ */
+- tmp |= cpol << 28; /* RSCKIZ */
++ tmp = 0;
++ tmp |= CTR_TSCKIZ_SCK | cpol << CTR_TSCKIZ_POL_SHIFT;
++ tmp |= CTR_RSCKIZ_SCK | cpol << CTR_RSCKIZ_POL_SHIFT;
+
+ edge = cpol ^ !cpha;
+
+- tmp |= edge << 27; /* TEDG */
+- tmp |= edge << 26; /* REDG */
+- tmp |= (tx_hi_z ? 2 : 0) << 22; /* TXDIZ */
++ tmp |= edge << CTR_TEDG_SHIFT;
++ tmp |= edge << CTR_REDG_SHIFT;
++ tmp |= tx_hi_z ? CTR_TXDIZ_HIZ : CTR_TXDIZ_LOW;
+ sh_msiof_write(p, CTR, tmp);
+ }
+
+@@ -203,12 +251,12 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p,
+ const void *tx_buf, void *rx_buf,
+ u32 bits, u32 words)
+ {
+- u32 dr2 = ((bits - 1) << 24) | ((words - 1) << 16);
++ u32 dr2 = MDR2_BITLEN1(bits) | MDR2_WDLEN1(words);
+
+ if (tx_buf)
+ sh_msiof_write(p, TMDR2, dr2);
+ else
+- sh_msiof_write(p, TMDR2, dr2 | 1);
++ sh_msiof_write(p, TMDR2, dr2 | MDR2_GRPMASK1);
+
+ if (rx_buf)
+ sh_msiof_write(p, RMDR2, dr2);
+@@ -694,8 +742,8 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ pm_runtime_enable(&pdev->dev);
+
+ /* The standard version of MSIOF use 64 word FIFOs */
+- p->tx_fifo_size = 64;
+- p->rx_fifo_size = 64;
++ p->tx_fifo_size = DEFAULT_TX_FIFO_SIZE;
++ p->rx_fifo_size = DEFAULT_RX_FIFO_SIZE;
+
+ /* Platform data may override FIFO sizes */
+ if (p->info->tx_fifo_override)
+--
+2.1.2
+
diff --git a/patches.renesas/0190-spi-sh-msiof-Use-the-core-cs_gpio-field-and-make-it-.patch b/patches.renesas/0190-spi-sh-msiof-Use-the-core-cs_gpio-field-and-make-it-.patch
new file mode 100644
index 00000000000000..87b95545414ecd
--- /dev/null
+++ b/patches.renesas/0190-spi-sh-msiof-Use-the-core-cs_gpio-field-and-make-it-.patch
@@ -0,0 +1,72 @@
+From 4ae0982e5e5fced013fd175b7947e965bfffcc1a Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:43:04 +0100
+Subject: spi: sh-msiof: Use the core cs_gpio field, and make it optional
+
+In current implementation, CS is controlled by GPIO, which is passed
+through spi->controller_data. However, the MSIOF HW module has a function
+to output CS by itself, which is already enabled and actual switch will be
+done by pinmux.
+
+Store the GPIO number in the core cs_gpio field, and ignore it if it is
+an invalid (negative) GPIO number.
+
+Loosely based on a patch from Takashi Yoshii <takasi-y@ops.dti.ne.jp>.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 8d19534a8d539bb2e598e56e017a423f205e909e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 79e14586049b..92515c1ececa 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -445,6 +445,21 @@ static int sh_msiof_spi_setup_transfer(struct spi_device *spi,
+ return spi_bitbang_setup_transfer(spi, t);
+ }
+
++static int sh_msiof_spi_setup(struct spi_device *spi)
++{
++ struct device_node *np = spi->master->dev.of_node;
++
++ if (!np) {
++ /*
++ * Use spi->controller_data for CS (same strategy as spi_gpio),
++ * if any. otherwise let HW control CS
++ */
++ spi->cs_gpio = (uintptr_t)spi->controller_data;
++ }
++
++ return spi_bitbang_setup(spi);
++}
++
+ static void sh_msiof_spi_chipselect(struct spi_device *spi, int is_on)
+ {
+ struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
+@@ -470,8 +485,8 @@ static void sh_msiof_spi_chipselect(struct spi_device *spi, int is_on)
+ !!(spi->mode & SPI_CS_HIGH));
+ }
+
+- /* use spi->controller data for CS (same strategy as spi_gpio) */
+- gpio_set_value((uintptr_t)spi->controller_data, value);
++ if (spi->cs_gpio >= 0)
++ gpio_set_value(spi->cs_gpio, value);
+
+ if (is_on == BITBANG_CS_INACTIVE) {
+ if (test_and_clear_bit(0, &p->flags)) {
+@@ -758,7 +773,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->bus_num = pdev->id;
+ master->dev.of_node = pdev->dev.of_node;
+ master->num_chipselect = p->info->num_chipselect;
+- master->setup = spi_bitbang_setup;
++ master->setup = sh_msiof_spi_setup;
+ master->cleanup = spi_bitbang_cleanup;
+
+ p->bitbang.master = master;
+--
+2.1.2
+
diff --git a/patches.renesas/0191-spi-sh-msiof-Improve-bindings.patch b/patches.renesas/0191-spi-sh-msiof-Improve-bindings.patch
new file mode 100644
index 00000000000000..7824bd3fcd923c
--- /dev/null
+++ b/patches.renesas/0191-spi-sh-msiof-Improve-bindings.patch
@@ -0,0 +1,75 @@
+From 68c878089cde013cc27e0746257851bad51351d5 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:08 +0100
+Subject: spi: sh-msiof: Improve bindings
+
+Documentation:
+ - Add missing "interrupt-parent", "#address-cells", "#size-cells", and
+ "clocks" properties,
+ - Add missing default values for "num-cs", "renesas,tx-fifo-size" and
+ "renesas,rx-fifo-size",
+ - Add a reference to the pinctrl documentation.
+
+Implementation:
+ - As "num-cs" is marked optional, provide a sensible default.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 32d3b2d1ddeafe105ab6f738fba427242141194e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/spi/sh-msiof.txt | 24 +++++++++++++++-------
+ drivers/spi/spi-sh-msiof.c | 2 +-
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+index e6222106ca36..eae3c8c9300e 100644
+--- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
++++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+@@ -1,12 +1,22 @@
+ Renesas MSIOF spi controller
+
+ Required properties:
+-- compatible : "renesas,sh-msiof" for SuperH or
+- "renesas,sh-mobile-msiof" for SH Mobile series
+-- reg : Offset and length of the register set for the device
+-- interrupts : interrupt line used by MSIOF
++- compatible : "renesas,sh-msiof" for SuperH, or
++ "renesas,sh-mobile-msiof" for SH Mobile series.
++- reg : Offset and length of the register set for the device
++- interrupt-parent : The phandle for the interrupt controller that
++ services interrupts for this device
++- interrupts : Interrupt specifier
++- #address-cells : Must be <1>
++- #size-cells : Must be <0>
+
+ Optional properties:
+-- num-cs : total number of chip-selects
+-- renesas,tx-fifo-size : Overrides the default tx fifo size given in words
+-- renesas,rx-fifo-size : Overrides the default rx fifo size given in words
++- clocks : Must contain a reference to the functional clock.
++- num-cs : Total number of chip-selects (default is 1)
++- renesas,tx-fifo-size : Overrides the default tx fifo size given in words
++ (default is 64)
++- renesas,rx-fifo-size : Overrides the default rx fifo size given in words
++ (default is 64)
++
++Pinctrl properties might be needed, too. See
++Documentation/devicetree/bindings/pinctrl/renesas,*.
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 92515c1ececa..bbe963018e1a 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -663,7 +663,7 @@ static struct sh_msiof_spi_info *sh_msiof_spi_parse_dt(struct device *dev)
+ {
+ struct sh_msiof_spi_info *info;
+ struct device_node *np = dev->of_node;
+- u32 num_cs = 0;
++ u32 num_cs = 1;
+
+ info = devm_kzalloc(dev, sizeof(struct sh_msiof_spi_info), GFP_KERNEL);
+ if (!info) {
+--
+2.1.2
+
diff --git a/patches.renesas/0192-spi-sh-msiof-Move-default-FIFO-sizes-to-device-ID-da.patch b/patches.renesas/0192-spi-sh-msiof-Move-default-FIFO-sizes-to-device-ID-da.patch
new file mode 100644
index 00000000000000..00e0c8dc4174db
--- /dev/null
+++ b/patches.renesas/0192-spi-sh-msiof-Move-default-FIFO-sizes-to-device-ID-da.patch
@@ -0,0 +1,147 @@
+From db842577457f6a542fcfb6f106c1b6c81fcb6014 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:09 +0100
+Subject: spi: sh-msiof: Move default FIFO sizes to device ID data
+
+As different variants of MSIOF have different FIFO sizes, move the default
+FIFO sizes to a new struct sh_msiof_chipdata, pointed to from the device
+ID data.
+
+[Moved ifdef to fix build -- broonie]
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 50a7e23f53677918bf521b09ce9bb20fb87cd175)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 50 +++++++++++++++++++++++++++++++---------------
+ 1 file changed, 34 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index bbe963018e1a..42bcb95f03dc 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -20,6 +20,7 @@
+ #include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/of.h>
++#include <linux/of_device.h>
+ #include <linux/platform_device.h>
+ #include <linux/pm_runtime.h>
+
+@@ -29,11 +30,18 @@
+
+ #include <asm/unaligned.h>
+
++
++struct sh_msiof_chipdata {
++ u16 tx_fifo_size;
++ u16 rx_fifo_size;
++};
++
+ struct sh_msiof_spi_priv {
+ struct spi_bitbang bitbang; /* must be first for spi_bitbang.c */
+ void __iomem *mapbase;
+ struct clk *clk;
+ struct platform_device *pdev;
++ const struct sh_msiof_chipdata *chipdata;
+ struct sh_msiof_spi_info *info;
+ struct completion done;
+ unsigned long flags;
+@@ -112,10 +120,6 @@ struct sh_msiof_spi_priv {
+ #define STR_REOF 0x00000080 /* Frame Reception End */
+
+
+-#define DEFAULT_TX_FIFO_SIZE 64
+-#define DEFAULT_RX_FIFO_SIZE 64
+-
+-
+ static u32 sh_msiof_read(struct sh_msiof_spi_priv *p, int reg_offs)
+ {
+ switch (reg_offs) {
+@@ -658,6 +662,18 @@ static u32 sh_msiof_spi_txrx_word(struct spi_device *spi, unsigned nsecs,
+ return 0;
+ }
+
++static const struct sh_msiof_chipdata sh_data = {
++ .tx_fifo_size = 64,
++ .rx_fifo_size = 64,
++};
++
++static const struct of_device_id sh_msiof_match[] = {
++ { .compatible = "renesas,sh-msiof", .data = &sh_data },
++ { .compatible = "renesas,sh-mobile-msiof", .data = &sh_data },
++ {},
++};
++MODULE_DEVICE_TABLE(of, sh_msiof_match);
++
+ #ifdef CONFIG_OF
+ static struct sh_msiof_spi_info *sh_msiof_spi_parse_dt(struct device *dev)
+ {
+@@ -693,6 +709,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ {
+ struct resource *r;
+ struct spi_master *master;
++ const struct of_device_id *of_id;
+ struct sh_msiof_spi_priv *p;
+ int i;
+ int ret;
+@@ -706,10 +723,15 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ p = spi_master_get_devdata(master);
+
+ platform_set_drvdata(pdev, p);
+- if (pdev->dev.of_node)
++
++ of_id = of_match_device(sh_msiof_match, &pdev->dev);
++ if (of_id) {
++ p->chipdata = of_id->data;
+ p->info = sh_msiof_spi_parse_dt(&pdev->dev);
+- else
++ } else {
++ p->chipdata = (const void *)pdev->id_entry->driver_data;
+ p->info = dev_get_platdata(&pdev->dev);
++ }
+
+ if (!p->info) {
+ dev_err(&pdev->dev, "failed to obtain device info\n");
+@@ -756,11 +778,9 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ p->pdev = pdev;
+ pm_runtime_enable(&pdev->dev);
+
+- /* The standard version of MSIOF use 64 word FIFOs */
+- p->tx_fifo_size = DEFAULT_TX_FIFO_SIZE;
+- p->rx_fifo_size = DEFAULT_RX_FIFO_SIZE;
+-
+ /* Platform data may override FIFO sizes */
++ p->tx_fifo_size = p->chipdata->tx_fifo_size;
++ p->rx_fifo_size = p->chipdata->rx_fifo_size;
+ if (p->info->tx_fifo_override)
+ p->tx_fifo_size = p->info->tx_fifo_override;
+ if (p->info->rx_fifo_override)
+@@ -810,18 +830,16 @@ static int sh_msiof_spi_remove(struct platform_device *pdev)
+ return ret;
+ }
+
+-#ifdef CONFIG_OF
+-static const struct of_device_id sh_msiof_match[] = {
+- { .compatible = "renesas,sh-msiof", },
+- { .compatible = "renesas,sh-mobile-msiof", },
++static struct platform_device_id spi_driver_ids[] = {
++ { "spi_sh_msiof", (kernel_ulong_t)&sh_data },
+ {},
+ };
+-MODULE_DEVICE_TABLE(of, sh_msiof_match);
+-#endif
++MODULE_DEVICE_TABLE(platform, spi_driver_ids);
+
+ static struct platform_driver sh_msiof_spi_drv = {
+ .probe = sh_msiof_spi_probe,
+ .remove = sh_msiof_spi_remove,
++ .id_table = spi_driver_ids,
+ .driver = {
+ .name = "spi_sh_msiof",
+ .owner = THIS_MODULE,
+--
+2.1.2
+
diff --git a/patches.renesas/0193-spi-sh-msiof-Add-support-for-R-Car-H2-and-M2.patch b/patches.renesas/0193-spi-sh-msiof-Add-support-for-R-Car-H2-and-M2.patch
new file mode 100644
index 00000000000000..c9952de7237fe4
--- /dev/null
+++ b/patches.renesas/0193-spi-sh-msiof-Add-support-for-R-Car-H2-and-M2.patch
@@ -0,0 +1,174 @@
+From 9710d9e170cb1d3955613e43619feca1ff43c389 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:10 +0100
+Subject: spi: sh-msiof: Add support for R-Car H2 and M2
+
+Add support for the MSIOF variant in the R-Car H2 (r8a7790) and M2
+(r8a7791) SoCs.
+
+Binding documentation:
+ - Add future-proof "renesas,msiof-<soctype>" compatible values,
+ - The default for "renesas,rx-fifo-size" is 256 on R-Car H2 and M2,
+ - "renesas,tx-fifo-size" and "renesas,rx-fifo-size" are deprecated for
+ soctype-specific bindings,
+ - Add example bindings.
+
+Implementation:
+ - MSIOF on R-Car H2 and M2 requires the transmission of dummy data if
+ data is being received only (cfr. "Set SICTR.TSCKE to 1" and "Write
+ dummy transmission data to SITFDR" in paragraph "Transmit and Receive
+ Procedures" of the Hardware User's Manual).
+ - As RX depends on TX, MSIOF on R-Car H2 and M2 also lacks the RSCR
+ register (Receive Clock Select Register), and some bits in the RMDR1
+ (Receive Mode Register 1) and TMDR2 (Transmit Mode Register 2)
+ registers.
+ - Use the recently introduced SPI_MASTER_MUST_TX flag to enable support
+ for dummy transmission in the SPI core, and to differentiate from other
+ MSIOF implementations in code paths that need this.
+ - New DT compatible values ("renesas,msiof-r8a7790" and
+ "renesas,msiof-r8a7791") are added, as well as new platform device
+ names ("spi_r8a7790_msiof" and "spi_r8a7791_msiof").
+ - The default RX FIFO size is 256 words on R-Car H2 and M2.
+
+This is loosely based on a set of patches from Takashi Yoshii
+<takasi-y@ops.dti.ne.jp>.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit beb74bb0875579c409778d853b8a050c124b3c79)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/spi/sh-msiof.txt | 23 ++++++++++++++++++++--
+ drivers/spi/spi-sh-msiof.c | 23 +++++++++++++++++++---
+ 2 files changed, 41 insertions(+), 5 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+index eae3c8c9300e..1f0cb33763a1 100644
+--- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
++++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+@@ -1,8 +1,13 @@
+ Renesas MSIOF spi controller
+
+ Required properties:
+-- compatible : "renesas,sh-msiof" for SuperH, or
++- compatible : "renesas,msiof-<soctype>" for SoCs,
++ "renesas,sh-msiof" for SuperH, or
+ "renesas,sh-mobile-msiof" for SH Mobile series.
++ Examples with soctypes are:
++ "renesas,msiof-sh7724" (SH)
++ "renesas,msiof-r8a7790" (R-Car H2)
++ "renesas,msiof-r8a7791" (R-Car M2)
+ - reg : Offset and length of the register set for the device
+ - interrupt-parent : The phandle for the interrupt controller that
+ services interrupts for this device
+@@ -13,10 +18,24 @@ Required properties:
+ Optional properties:
+ - clocks : Must contain a reference to the functional clock.
+ - num-cs : Total number of chip-selects (default is 1)
++
++Optional properties, deprecated for soctype-specific bindings:
+ - renesas,tx-fifo-size : Overrides the default tx fifo size given in words
+ (default is 64)
+ - renesas,rx-fifo-size : Overrides the default rx fifo size given in words
+- (default is 64)
++ (default is 64, or 256 on R-Car H2 and M2)
+
+ Pinctrl properties might be needed, too. See
+ Documentation/devicetree/bindings/pinctrl/renesas,*.
++
++Example:
++
++ msiof0: spi@e6e20000 {
++ compatible = "renesas,msiof-r8a7791";
++ reg = <0 0xe6e20000 0 0x0064>;
++ interrupts = <0 156 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp0_clks R8A7791_CLK_MSIOF0>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 42bcb95f03dc..aa609551ba84 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -34,6 +34,7 @@
+ struct sh_msiof_chipdata {
+ u16 tx_fifo_size;
+ u16 rx_fifo_size;
++ u16 master_flags;
+ };
+
+ struct sh_msiof_spi_priv {
+@@ -214,7 +215,8 @@ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p,
+ k = min_t(int, k, ARRAY_SIZE(sh_msiof_spi_clk_table) - 1);
+
+ sh_msiof_write(p, TSCR, sh_msiof_spi_clk_table[k].scr);
+- sh_msiof_write(p, RSCR, sh_msiof_spi_clk_table[k].scr);
++ if (!(p->chipdata->master_flags & SPI_MASTER_MUST_TX))
++ sh_msiof_write(p, RSCR, sh_msiof_spi_clk_table[k].scr);
+ }
+
+ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
+@@ -237,6 +239,10 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p,
+ tmp |= !cs_high << MDR1_SYNCAC_SHIFT;
+ tmp |= lsb_first << MDR1_BITLSB_SHIFT;
+ sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON);
++ if (p->chipdata->master_flags & SPI_MASTER_MUST_TX) {
++ /* These bits are reserved if RX needs TX */
++ tmp &= ~0x0000ffff;
++ }
+ sh_msiof_write(p, RMDR1, tmp);
+
+ tmp = 0;
+@@ -257,7 +263,7 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p,
+ {
+ u32 dr2 = MDR2_BITLEN1(bits) | MDR2_WDLEN1(words);
+
+- if (tx_buf)
++ if (tx_buf || (p->chipdata->master_flags & SPI_MASTER_MUST_TX))
+ sh_msiof_write(p, TMDR2, dr2);
+ else
+ sh_msiof_write(p, TMDR2, dr2 | MDR2_GRPMASK1);
+@@ -665,11 +671,20 @@ static u32 sh_msiof_spi_txrx_word(struct spi_device *spi, unsigned nsecs,
+ static const struct sh_msiof_chipdata sh_data = {
+ .tx_fifo_size = 64,
+ .rx_fifo_size = 64,
++ .master_flags = 0,
++};
++
++static const struct sh_msiof_chipdata r8a779x_data = {
++ .tx_fifo_size = 64,
++ .rx_fifo_size = 256,
++ .master_flags = SPI_MASTER_MUST_TX,
+ };
+
+ static const struct of_device_id sh_msiof_match[] = {
+ { .compatible = "renesas,sh-msiof", .data = &sh_data },
+ { .compatible = "renesas,sh-mobile-msiof", .data = &sh_data },
++ { .compatible = "renesas,msiof-r8a7790", .data = &r8a779x_data },
++ { .compatible = "renesas,msiof-r8a7791", .data = &r8a779x_data },
+ {},
+ };
+ MODULE_DEVICE_TABLE(of, sh_msiof_match);
+@@ -789,7 +804,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ /* init master and bitbang code */
+ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+ master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE;
+- master->flags = 0;
++ master->flags = p->chipdata->master_flags;
+ master->bus_num = pdev->id;
+ master->dev.of_node = pdev->dev.of_node;
+ master->num_chipselect = p->info->num_chipselect;
+@@ -832,6 +847,8 @@ static int sh_msiof_spi_remove(struct platform_device *pdev)
+
+ static struct platform_device_id spi_driver_ids[] = {
+ { "spi_sh_msiof", (kernel_ulong_t)&sh_data },
++ { "spi_r8a7790_msiof", (kernel_ulong_t)&r8a779x_data },
++ { "spi_r8a7791_msiof", (kernel_ulong_t)&r8a779x_data },
+ {},
+ };
+ MODULE_DEVICE_TABLE(platform, spi_driver_ids);
+--
+2.1.2
+
diff --git a/patches.renesas/0194-spi-sh-msiof-Move-clock-management-to-un-prepare_mes.patch b/patches.renesas/0194-spi-sh-msiof-Move-clock-management-to-un-prepare_mes.patch
new file mode 100644
index 00000000000000..8c6521efd9fd7f
--- /dev/null
+++ b/patches.renesas/0194-spi-sh-msiof-Move-clock-management-to-un-prepare_mes.patch
@@ -0,0 +1,134 @@
+From 7b51bccda1cc5aaf48247b7b0799fdcfb2e2e415 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:11 +0100
+Subject: spi: sh-msiof: Move clock management to (un)prepare_message()
+
+Move clock management and pin configuration from the bitbang chipselect()
+method to the SPI core prepare_message() and unprepare_message() methods.
+
+As spi_master.{,un}prepare_message() is guaranteed to be called in
+matching pairs, the clock management synchronization is no longer needed.
+
+As sh_msiof_spi_set_pin_regs() is no longer called at spi_master.setup()
+time (through spi_bitbang_setup() and the spi_bitbang.chipselect()
+callback), we now have to take care of that ourselves.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c833ff7304511805ce5a3378d1637e39e00e00ea)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 61 +++++++++++++++++++++++++++++-----------------
+ 1 file changed, 38 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index aa609551ba84..9e891c3c8642 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -45,7 +45,6 @@ struct sh_msiof_spi_priv {
+ const struct sh_msiof_chipdata *chipdata;
+ struct sh_msiof_spi_info *info;
+ struct completion done;
+- unsigned long flags;
+ int tx_fifo_size;
+ int rx_fifo_size;
+ };
+@@ -458,6 +457,7 @@ static int sh_msiof_spi_setup_transfer(struct spi_device *spi,
+ static int sh_msiof_spi_setup(struct spi_device *spi)
+ {
+ struct device_node *np = spi->master->dev.of_node;
++ struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
+
+ if (!np) {
+ /*
+@@ -467,12 +467,46 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
+ spi->cs_gpio = (uintptr_t)spi->controller_data;
+ }
+
++ /* Configure pins before deasserting CS */
++ sh_msiof_spi_set_pin_regs(p, !!(spi->mode & SPI_CPOL),
++ !!(spi->mode & SPI_CPHA),
++ !!(spi->mode & SPI_3WIRE),
++ !!(spi->mode & SPI_LSB_FIRST),
++ !!(spi->mode & SPI_CS_HIGH));
++
+ return spi_bitbang_setup(spi);
+ }
+
++static int sh_msiof_prepare_message(struct spi_master *master,
++ struct spi_message *msg)
++{
++ struct sh_msiof_spi_priv *p = spi_master_get_devdata(master);
++ const struct spi_device *spi = msg->spi;
++
++ pm_runtime_get_sync(&p->pdev->dev);
++ clk_enable(p->clk);
++
++ /* Configure pins before asserting CS */
++ sh_msiof_spi_set_pin_regs(p, !!(spi->mode & SPI_CPOL),
++ !!(spi->mode & SPI_CPHA),
++ !!(spi->mode & SPI_3WIRE),
++ !!(spi->mode & SPI_LSB_FIRST),
++ !!(spi->mode & SPI_CS_HIGH));
++ return 0;
++}
++
++static int sh_msiof_unprepare_message(struct spi_master *master,
++ struct spi_message *msg)
++{
++ struct sh_msiof_spi_priv *p = spi_master_get_devdata(master);
++
++ clk_disable(p->clk);
++ pm_runtime_put(&p->pdev->dev);
++ return 0;
++}
++
+ static void sh_msiof_spi_chipselect(struct spi_device *spi, int is_on)
+ {
+- struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
+ int value;
+
+ /* chip select is active low unless SPI_CS_HIGH is set */
+@@ -481,29 +515,8 @@ static void sh_msiof_spi_chipselect(struct spi_device *spi, int is_on)
+ else
+ value = (is_on == BITBANG_CS_ACTIVE) ? 0 : 1;
+
+- if (is_on == BITBANG_CS_ACTIVE) {
+- if (!test_and_set_bit(0, &p->flags)) {
+- pm_runtime_get_sync(&p->pdev->dev);
+- clk_enable(p->clk);
+- }
+-
+- /* Configure pins before asserting CS */
+- sh_msiof_spi_set_pin_regs(p, !!(spi->mode & SPI_CPOL),
+- !!(spi->mode & SPI_CPHA),
+- !!(spi->mode & SPI_3WIRE),
+- !!(spi->mode & SPI_LSB_FIRST),
+- !!(spi->mode & SPI_CS_HIGH));
+- }
+-
+ if (spi->cs_gpio >= 0)
+ gpio_set_value(spi->cs_gpio, value);
+-
+- if (is_on == BITBANG_CS_INACTIVE) {
+- if (test_and_clear_bit(0, &p->flags)) {
+- clk_disable(p->clk);
+- pm_runtime_put(&p->pdev->dev);
+- }
+- }
+ }
+
+ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
+@@ -810,6 +823,8 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->num_chipselect = p->info->num_chipselect;
+ master->setup = sh_msiof_spi_setup;
+ master->cleanup = spi_bitbang_cleanup;
++ master->prepare_message = sh_msiof_prepare_message;
++ master->unprepare_message = sh_msiof_unprepare_message;
+
+ p->bitbang.master = master;
+ p->bitbang.chipselect = sh_msiof_spi_chipselect;
+--
+2.1.2
+
diff --git a/patches.renesas/0195-spi-sh-msiof-Convert-to-let-spi-core-validate-xfer-b.patch b/patches.renesas/0195-spi-sh-msiof-Convert-to-let-spi-core-validate-xfer-b.patch
new file mode 100644
index 00000000000000..2762f22ea356ad
--- /dev/null
+++ b/patches.renesas/0195-spi-sh-msiof-Convert-to-let-spi-core-validate-xfer-b.patch
@@ -0,0 +1,60 @@
+From 99ed7507c9464d099df0f5704b691fe4147aadf2 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:12 +0100
+Subject: spi: sh-msiof: Convert to let spi core validate xfer->bits_per_word
+
+Set bits_per_word_mask so the spi core will reject transfers that attempt
+to use an unsupported bits_per_word value.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 2416289c714343ea855e725d59d42668a9ab3cf6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 19 ++-----------------
+ 1 file changed, 2 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 9e891c3c8642..e41e78abc4d7 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -438,22 +438,6 @@ static u32 sh_msiof_spi_hz(struct spi_device *spi, struct spi_transfer *t)
+ return hz;
+ }
+
+-static int sh_msiof_spi_setup_transfer(struct spi_device *spi,
+- struct spi_transfer *t)
+-{
+- int bits;
+-
+- /* noting to check hz values against since parent clock is disabled */
+-
+- bits = sh_msiof_spi_bits(spi, t);
+- if (bits < 8)
+- return -EINVAL;
+- if (bits > 32)
+- return -EINVAL;
+-
+- return spi_bitbang_setup_transfer(spi, t);
+-}
+-
+ static int sh_msiof_spi_setup(struct spi_device *spi)
+ {
+ struct device_node *np = spi->master->dev.of_node;
+@@ -825,10 +809,11 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->cleanup = spi_bitbang_cleanup;
+ master->prepare_message = sh_msiof_prepare_message;
+ master->unprepare_message = sh_msiof_unprepare_message;
++ master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32);
+
+ p->bitbang.master = master;
+ p->bitbang.chipselect = sh_msiof_spi_chipselect;
+- p->bitbang.setup_transfer = sh_msiof_spi_setup_transfer;
++ p->bitbang.setup_transfer = spi_bitbang_setup_transfer;
+ p->bitbang.txrx_bufs = sh_msiof_spi_txrx;
+ p->bitbang.txrx_word[SPI_MODE_0] = sh_msiof_spi_txrx_word;
+ p->bitbang.txrx_word[SPI_MODE_1] = sh_msiof_spi_txrx_word;
+--
+2.1.2
+
diff --git a/patches.renesas/0196-spi-sh-msiof-Use-core-message-handling-instead-of-sp.patch b/patches.renesas/0196-spi-sh-msiof-Use-core-message-handling-instead-of-sp.patch
new file mode 100644
index 00000000000000..cc817088b7506e
--- /dev/null
+++ b/patches.renesas/0196-spi-sh-msiof-Use-core-message-handling-instead-of-sp.patch
@@ -0,0 +1,186 @@
+From 636c9b22e1b2b86399ba6c3c73b12e995558d648 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 25 Feb 2014 11:21:13 +0100
+Subject: spi: sh-msiof: Use core message handling instead of spi-bitbang
+
+The only remaining feature of spi-bitbang used by this driver is the
+chipselect() callback, which just does conditional GPIO.
+This is handled fine by the SPI core's spi_set_cs(), hence switch the
+driver to use the core message handling through our own transfer_one()
+method.
+
+As the (optional) GPIO CS is no longer deasserted at spi_master.setup()
+time (through spi_bitbang_setup() and the spi_bitbang.chipselect()
+callback), we now have to take care of that ourselves.
+
+Remove the call to spi_master_put() in sh_msiof_spi_remove(), as our SPI
+master is now registered using devm_spi_register_master()
+(spi_bitbang_start() uses the non-managed version).
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 1bd6363bc0c69ff6120b53daa35cf9459c3628ad)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/Kconfig | 1 -
+ drivers/spi/spi-sh-msiof.c | 67 ++++++++++++++--------------------------------
+ 2 files changed, 20 insertions(+), 48 deletions(-)
+
+diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
+index 581ee2a8856b..90c623116ec8 100644
+--- a/drivers/spi/Kconfig
++++ b/drivers/spi/Kconfig
+@@ -416,7 +416,6 @@ config SPI_SH_MSIOF
+ tristate "SuperH MSIOF SPI controller"
+ depends on HAVE_CLK
+ depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
+- select SPI_BITBANG
+ help
+ SPI driver for SuperH and SH Mobile MSIOF blocks.
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index e41e78abc4d7..1b59804b43ad 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -26,7 +26,6 @@
+
+ #include <linux/spi/sh_msiof.h>
+ #include <linux/spi/spi.h>
+-#include <linux/spi/spi_bitbang.h>
+
+ #include <asm/unaligned.h>
+
+@@ -38,7 +37,6 @@ struct sh_msiof_chipdata {
+ };
+
+ struct sh_msiof_spi_priv {
+- struct spi_bitbang bitbang; /* must be first for spi_bitbang.c */
+ void __iomem *mapbase;
+ struct clk *clk;
+ struct platform_device *pdev;
+@@ -458,7 +456,10 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
+ !!(spi->mode & SPI_LSB_FIRST),
+ !!(spi->mode & SPI_CS_HIGH));
+
+- return spi_bitbang_setup(spi);
++ if (spi->cs_gpio >= 0)
++ gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
++
++ return 0;
+ }
+
+ static int sh_msiof_prepare_message(struct spi_master *master,
+@@ -489,20 +490,6 @@ static int sh_msiof_unprepare_message(struct spi_master *master,
+ return 0;
+ }
+
+-static void sh_msiof_spi_chipselect(struct spi_device *spi, int is_on)
+-{
+- int value;
+-
+- /* chip select is active low unless SPI_CS_HIGH is set */
+- if (spi->mode & SPI_CS_HIGH)
+- value = (is_on == BITBANG_CS_ACTIVE) ? 1 : 0;
+- else
+- value = (is_on == BITBANG_CS_ACTIVE) ? 0 : 1;
+-
+- if (spi->cs_gpio >= 0)
+- gpio_set_value(spi->cs_gpio, value);
+-}
+-
+ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
+ void (*tx_fifo)(struct sh_msiof_spi_priv *,
+ const void *, int, int),
+@@ -572,9 +559,11 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
+ return ret;
+ }
+
+-static int sh_msiof_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
++static int sh_msiof_transfer_one(struct spi_master *master,
++ struct spi_device *spi,
++ struct spi_transfer *t)
+ {
+- struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
++ struct sh_msiof_spi_priv *p = spi_master_get_devdata(master);
+ void (*tx_fifo)(struct sh_msiof_spi_priv *, const void *, int, int);
+ void (*rx_fifo)(struct sh_msiof_spi_priv *, void *, int, int);
+ int bits;
+@@ -655,13 +644,6 @@ static int sh_msiof_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
+ words -= n;
+ }
+
+- return bytes_done;
+-}
+-
+-static u32 sh_msiof_spi_txrx_word(struct spi_device *spi, unsigned nsecs,
+- u32 word, u8 bits)
+-{
+- BUG(); /* unused but needed by bitbang code */
+ return 0;
+ }
+
+@@ -798,7 +780,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ if (p->info->rx_fifo_override)
+ p->rx_fifo_size = p->info->rx_fifo_override;
+
+- /* init master and bitbang code */
++ /* init master code */
+ master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+ master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE;
+ master->flags = p->chipdata->master_flags;
+@@ -806,24 +788,20 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->dev.of_node = pdev->dev.of_node;
+ master->num_chipselect = p->info->num_chipselect;
+ master->setup = sh_msiof_spi_setup;
+- master->cleanup = spi_bitbang_cleanup;
+ master->prepare_message = sh_msiof_prepare_message;
+ master->unprepare_message = sh_msiof_unprepare_message;
+ master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32);
++ master->transfer_one = sh_msiof_transfer_one;
+
+- p->bitbang.master = master;
+- p->bitbang.chipselect = sh_msiof_spi_chipselect;
+- p->bitbang.setup_transfer = spi_bitbang_setup_transfer;
+- p->bitbang.txrx_bufs = sh_msiof_spi_txrx;
+- p->bitbang.txrx_word[SPI_MODE_0] = sh_msiof_spi_txrx_word;
+- p->bitbang.txrx_word[SPI_MODE_1] = sh_msiof_spi_txrx_word;
+- p->bitbang.txrx_word[SPI_MODE_2] = sh_msiof_spi_txrx_word;
+- p->bitbang.txrx_word[SPI_MODE_3] = sh_msiof_spi_txrx_word;
++ ret = devm_spi_register_master(&pdev->dev, master);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "spi_register_master error.\n");
++ goto err2;
++ }
+
+- ret = spi_bitbang_start(&p->bitbang);
+- if (ret == 0)
+- return 0;
++ return 0;
+
++ err2:
+ pm_runtime_disable(&pdev->dev);
+ clk_unprepare(p->clk);
+ err1:
+@@ -834,15 +812,10 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ static int sh_msiof_spi_remove(struct platform_device *pdev)
+ {
+ struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+- int ret;
+
+- ret = spi_bitbang_stop(&p->bitbang);
+- if (!ret) {
+- pm_runtime_disable(&pdev->dev);
+- clk_unprepare(p->clk);
+- spi_master_put(p->bitbang.master);
+- }
+- return ret;
++ pm_runtime_disable(&pdev->dev);
++ clk_unprepare(p->clk);
++ return 0;
+ }
+
+ static struct platform_device_id spi_driver_ids[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0197-spi-sh-msiof-Kill-sh_msiof_spi_bits-and-sh_msiof_spi.patch b/patches.renesas/0197-spi-sh-msiof-Kill-sh_msiof_spi_bits-and-sh_msiof_spi.patch
new file mode 100644
index 00000000000000..f83ab8a7d2c659
--- /dev/null
+++ b/patches.renesas/0197-spi-sh-msiof-Kill-sh_msiof_spi_bits-and-sh_msiof_spi.patch
@@ -0,0 +1,71 @@
+From 78adfee5b79ef12d2cf9c189984028d4484aa31a Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Sun, 2 Mar 2014 22:30:32 +0800
+Subject: spi: sh-msiof: Kill sh_msiof_spi_bits and sh_msiof_spi_hz functions
+
+In the implementation of __spi_validate(), spi core will set transfer
+bits_per_word and max speed as spi device default if it is not set for
+this transfer. So we can remove the same implementation in this driver.
+
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit b14158603288b9d898716b41f2f0acb7d49dad2c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 25 ++-----------------------
+ 1 file changed, 2 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 1b59804b43ad..739eb2f12ecc 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -416,26 +416,6 @@ static void sh_msiof_spi_read_fifo_s32u(struct sh_msiof_spi_priv *p,
+ put_unaligned(swab32(sh_msiof_read(p, RFDR) >> fs), &buf_32[k]);
+ }
+
+-static int sh_msiof_spi_bits(struct spi_device *spi, struct spi_transfer *t)
+-{
+- int bits;
+-
+- bits = t ? t->bits_per_word : 0;
+- if (!bits)
+- bits = spi->bits_per_word;
+- return bits;
+-}
+-
+-static u32 sh_msiof_spi_hz(struct spi_device *spi, struct spi_transfer *t)
+-{
+- u32 hz;
+-
+- hz = t ? t->speed_hz : 0;
+- if (!hz)
+- hz = spi->max_speed_hz;
+- return hz;
+-}
+-
+ static int sh_msiof_spi_setup(struct spi_device *spi)
+ {
+ struct device_node *np = spi->master->dev.of_node;
+@@ -573,7 +553,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
+ int n;
+ bool swab;
+
+- bits = sh_msiof_spi_bits(spi, t);
++ bits = t->bits_per_word;
+
+ if (bits <= 8 && t->len > 15 && !(t->len & 3)) {
+ bits = 32;
+@@ -623,8 +603,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
+ }
+
+ /* setup clocks (clock already enabled in chipselect()) */
+- sh_msiof_spi_set_clk_regs(p, clk_get_rate(p->clk),
+- sh_msiof_spi_hz(spi, t));
++ sh_msiof_spi_set_clk_regs(p, clk_get_rate(p->clk), t->speed_hz);
+
+ /* transfer in fifo sized chunks */
+ words = t->len / bytes_per_word;
+--
+2.1.2
+
diff --git a/patches.renesas/0198-spi-sh-msiof-Remove-renesas-msiof-sh7724-from-bindin.patch b/patches.renesas/0198-spi-sh-msiof-Remove-renesas-msiof-sh7724-from-bindin.patch
new file mode 100644
index 00000000000000..1cae4790984a1a
--- /dev/null
+++ b/patches.renesas/0198-spi-sh-msiof-Remove-renesas-msiof-sh7724-from-bindin.patch
@@ -0,0 +1,31 @@
+From 9b94596a82a90f71cc942225fdbccc293471cccc Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 10:43:26 +0100
+Subject: spi: sh-msiof: Remove "renesas,msiof-sh7724" from bindings
+
+It's not implemented in the driver, so it's a bad example.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit f9ee821ebc5e58ff5da08d625ea4e2d74b221317)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/spi/sh-msiof.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Documentation/devicetree/bindings/spi/sh-msiof.txt b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+index 1f0cb33763a1..f24baf3b6cc1 100644
+--- a/Documentation/devicetree/bindings/spi/sh-msiof.txt
++++ b/Documentation/devicetree/bindings/spi/sh-msiof.txt
+@@ -5,7 +5,6 @@ Required properties:
+ "renesas,sh-msiof" for SuperH, or
+ "renesas,sh-mobile-msiof" for SH Mobile series.
+ Examples with soctypes are:
+- "renesas,msiof-sh7724" (SH)
+ "renesas,msiof-r8a7790" (R-Car H2)
+ "renesas,msiof-r8a7791" (R-Car M2)
+ - reg : Offset and length of the register set for the device
+--
+2.1.2
+
diff --git a/patches.renesas/0199-spi-sh-msiof-Convert-to-spi-core-auto_runtime_pm-fra.patch b/patches.renesas/0199-spi-sh-msiof-Convert-to-spi-core-auto_runtime_pm-fra.patch
new file mode 100644
index 00000000000000..d954c94dc3813e
--- /dev/null
+++ b/patches.renesas/0199-spi-sh-msiof-Convert-to-spi-core-auto_runtime_pm-fra.patch
@@ -0,0 +1,89 @@
+From e617ec74615934ac2d23ae18d14fe82cbcec39d7 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 11 Mar 2014 10:59:11 +0100
+Subject: spi: sh-msiof: Convert to spi core auto_runtime_pm framework
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit e2a0ba547ba31cd7b217cc948d93e4edc78cbcb1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ drivers/spi/spi-sh-msiof.c | 25 +------------------------
+ 1 file changed, 1 insertion(+), 24 deletions(-)
+
+diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
+index 739eb2f12ecc..e850d03e7190 100644
+--- a/drivers/spi/spi-sh-msiof.c
++++ b/drivers/spi/spi-sh-msiof.c
+@@ -448,9 +448,6 @@ static int sh_msiof_prepare_message(struct spi_master *master,
+ struct sh_msiof_spi_priv *p = spi_master_get_devdata(master);
+ const struct spi_device *spi = msg->spi;
+
+- pm_runtime_get_sync(&p->pdev->dev);
+- clk_enable(p->clk);
+-
+ /* Configure pins before asserting CS */
+ sh_msiof_spi_set_pin_regs(p, !!(spi->mode & SPI_CPOL),
+ !!(spi->mode & SPI_CPHA),
+@@ -460,16 +457,6 @@ static int sh_msiof_prepare_message(struct spi_master *master,
+ return 0;
+ }
+
+-static int sh_msiof_unprepare_message(struct spi_master *master,
+- struct spi_message *msg)
+-{
+- struct sh_msiof_spi_priv *p = spi_master_get_devdata(master);
+-
+- clk_disable(p->clk);
+- pm_runtime_put(&p->pdev->dev);
+- return 0;
+-}
+-
+ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
+ void (*tx_fifo)(struct sh_msiof_spi_priv *,
+ const void *, int, int),
+@@ -742,12 +729,6 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ goto err1;
+ }
+
+- ret = clk_prepare(p->clk);
+- if (ret < 0) {
+- dev_err(&pdev->dev, "unable to prepare clock\n");
+- goto err1;
+- }
+-
+ p->pdev = pdev;
+ pm_runtime_enable(&pdev->dev);
+
+@@ -768,8 +749,8 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+ master->num_chipselect = p->info->num_chipselect;
+ master->setup = sh_msiof_spi_setup;
+ master->prepare_message = sh_msiof_prepare_message;
+- master->unprepare_message = sh_msiof_unprepare_message;
+ master->bits_per_word_mask = SPI_BPW_RANGE_MASK(8, 32);
++ master->auto_runtime_pm = true;
+ master->transfer_one = sh_msiof_transfer_one;
+
+ ret = devm_spi_register_master(&pdev->dev, master);
+@@ -782,7 +763,6 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+
+ err2:
+ pm_runtime_disable(&pdev->dev);
+- clk_unprepare(p->clk);
+ err1:
+ spi_master_put(master);
+ return ret;
+@@ -790,10 +770,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
+
+ static int sh_msiof_spi_remove(struct platform_device *pdev)
+ {
+- struct sh_msiof_spi_priv *p = platform_get_drvdata(pdev);
+-
+ pm_runtime_disable(&pdev->dev);
+- clk_unprepare(p->clk);
+ return 0;
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0200-ARM-shmobile-dts-Remove-r8a7791-koelsch-reference.dt.patch b/patches.renesas/0200-ARM-shmobile-dts-Remove-r8a7791-koelsch-reference.dt.patch
new file mode 100644
index 00000000000000..2842764c07fcbe
--- /dev/null
+++ b/patches.renesas/0200-ARM-shmobile-dts-Remove-r8a7791-koelsch-reference.dt.patch
@@ -0,0 +1,141 @@
+From 0ee5347bde9524dc0301713cfbf173e68a4331c1 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 29 Dec 2013 22:41:56 +0100
+Subject: ARM: shmobile: dts: Remove r8a7791-koelsch-reference.dts
+
+The dts file has been superseded by r8a7791-koelsch.dts and been removed
+from the ARCH_SHMOBILE_LEGACY dtb target. Remove it.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 52e62f7f4b25d4f087395f805768e985e9d91bd0)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch-reference.dts | 115 ------------------------
+ 1 file changed, 115 deletions(-)
+ delete mode 100644 arch/arm/boot/dts/r8a7791-koelsch-reference.dts
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch-reference.dts b/arch/arm/boot/dts/r8a7791-koelsch-reference.dts
+deleted file mode 100644
+index 588ca17ea1f0..000000000000
+--- a/arch/arm/boot/dts/r8a7791-koelsch-reference.dts
++++ /dev/null
+@@ -1,115 +0,0 @@
+-/*
+- * Device Tree Source for the Koelsch board
+- *
+- * Copyright (C) 2013 Renesas Electronics Corporation
+- * Copyright (C) 2013 Renesas Solutions Corp.
+- *
+- * This file is licensed under the terms of the GNU General Public License
+- * version 2. This program is licensed "as is" without any warranty of any
+- * kind, whether express or implied.
+- */
+-
+-/dts-v1/;
+-#include "r8a7791.dtsi"
+-#include <dt-bindings/gpio/gpio.h>
+-
+-/ {
+- model = "Koelsch";
+- compatible = "renesas,koelsch-reference", "renesas,r8a7791";
+-
+- chosen {
+- bootargs = "console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp";
+- };
+-
+- memory@40000000 {
+- device_type = "memory";
+- reg = <0 0x40000000 0 0x80000000>;
+- };
+-
+- lbsc {
+- #address-cells = <1>;
+- #size-cells = <1>;
+- };
+-
+- gpio-keys {
+- compatible = "gpio-keys";
+-
+- key-a {
+- gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
+- linux,code = <30>;
+- label = "SW30";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-b {
+- gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
+- linux,code = <48>;
+- label = "SW31";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-c {
+- gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
+- linux,code = <46>;
+- label = "SW32";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-d {
+- gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
+- linux,code = <32>;
+- label = "SW33";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-e {
+- gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
+- linux,code = <18>;
+- label = "SW34";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-f {
+- gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
+- linux,code = <33>;
+- label = "SW35";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- key-g {
+- gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
+- linux,code = <34>;
+- label = "SW36";
+- gpio-key,wakeup;
+- debounce-interval = <20>;
+- };
+- };
+-
+- leds {
+- compatible = "gpio-leds";
+- led6 {
+- gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
+- };
+- led7 {
+- gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
+- };
+- led8 {
+- gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
+- };
+- };
+-};
+-
+-&pfc {
+- pinctrl-0 = <&scif0_pins &scif1_pins>;
+- pinctrl-names = "default";
+-
+- scif0_pins: serial0 {
+- renesas,groups = "scif0_data_d";
+- renesas,function = "scif0";
+- };
+-
+- scif1_pins: serial1 {
+- renesas,groups = "scif1_data_d";
+- renesas,function = "scif1";
+- };
+-};
+--
+2.1.2
+
diff --git a/patches.renesas/0201-ARM-shmobile-Add-GPIO-keys-to-Koelsch-DTS.patch b/patches.renesas/0201-ARM-shmobile-Add-GPIO-keys-to-Koelsch-DTS.patch
new file mode 100644
index 00000000000000..29315cd757d6db
--- /dev/null
+++ b/patches.renesas/0201-ARM-shmobile-Add-GPIO-keys-to-Koelsch-DTS.patch
@@ -0,0 +1,84 @@
+From 1f3c536042861ef87270356bb361d3a4f5cea83a Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Thu, 19 Dec 2013 16:28:42 +0100
+Subject: ARM: shmobile: Add GPIO keys to Koelsch DTS
+
+The Koelsh reference device tree is going away, copy the missing GPIO
+keys device node to the Koeslch device tree file.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit aff5274fdc5b53a44d906c39a834efa6ba9c30ef)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 54 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 54 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index fd556c3483e3..c6f5de385940 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -31,6 +31,60 @@
+ #size-cells = <1>;
+ };
+
++ gpio-keys {
++ compatible = "gpio-keys";
++
++ key-a {
++ gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
++ linux,code = <30>;
++ label = "SW30";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-b {
++ gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
++ linux,code = <48>;
++ label = "SW31";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-c {
++ gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
++ linux,code = <46>;
++ label = "SW32";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-d {
++ gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
++ linux,code = <32>;
++ label = "SW33";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-e {
++ gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
++ linux,code = <18>;
++ label = "SW34";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-f {
++ gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
++ linux,code = <33>;
++ label = "SW35";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ key-g {
++ gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
++ linux,code = <34>;
++ label = "SW36";
++ gpio-key,wakeup;
++ debounce-interval = <20>;
++ };
++ };
++
+ leds {
+ compatible = "gpio-leds";
+ led6 {
+--
+2.1.2
+
diff --git a/patches.renesas/0202-ARM-shmobile-koelsch-1-1-GiB-memory-in-DT.patch b/patches.renesas/0202-ARM-shmobile-koelsch-1-1-GiB-memory-in-DT.patch
new file mode 100644
index 00000000000000..de6744a96c4c7b
--- /dev/null
+++ b/patches.renesas/0202-ARM-shmobile-koelsch-1-1-GiB-memory-in-DT.patch
@@ -0,0 +1,37 @@
+From ce2284e7a95cd52dbf62e37cdf3fef8ea21a09a1 Mon Sep 17 00:00:00 2001
+From: Takashi Yoshii <takasi-y@ops.dti.ne.jp>
+Date: Sun, 22 Dec 2013 18:27:23 +0900
+Subject: ARM: shmobile: koelsch: (1+1)GiB memory in DT
+
+Fix dts to have memory 1GiB @ 0_4000_0000 + 1GiB @ 2_0000_0000
+according to Koelsch's hardware manual.
+
+Signed-off-by: Takashi Yoshii <takasi-y@ops.dti.ne.jp>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4cd1bad45182c7f1426353d73a481e0260d236b1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index c6f5de385940..d30527dee0c9 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -23,7 +23,12 @@
+
+ memory@40000000 {
+ device_type = "memory";
+- reg = <0 0x40000000 0 0x80000000>;
++ reg = <0 0x40000000 0 0x40000000>;
++ };
++
++ memory@200000000 {
++ device_type = "memory";
++ reg = <2 0x00000000 0 0x40000000>;
+ };
+
+ lbsc {
+--
+2.1.2
+
diff --git a/patches.renesas/0203-ARM-shmobile-r8a7791-Add-thermal-clock-in-device-tre.patch b/patches.renesas/0203-ARM-shmobile-r8a7791-Add-thermal-clock-in-device-tre.patch
new file mode 100644
index 00000000000000..9b45b1bef33e7e
--- /dev/null
+++ b/patches.renesas/0203-ARM-shmobile-r8a7791-Add-thermal-clock-in-device-tre.patch
@@ -0,0 +1,31 @@
+From 70839422c4fec0da1aacd39eb4cf401386b82796 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 7 Jan 2014 19:57:13 +0100
+Subject: ARM: shmobile: r8a7791: Add thermal clock in device tree
+
+Add the missing thermal MSTP clock to the thermal device node.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 563bc8eb0243783afd7a71204ad696e8bdf44391)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 19c65509a22d..34f5d39220e3 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -151,6 +151,7 @@
+ reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
+ };
+
+ timer {
+--
+2.1.2
+
diff --git a/patches.renesas/0204-ARM-shmobile-r8a7790-Add-thermal-clock-in-device-tre.patch b/patches.renesas/0204-ARM-shmobile-r8a7790-Add-thermal-clock-in-device-tre.patch
new file mode 100644
index 00000000000000..4976707e8fe271
--- /dev/null
+++ b/patches.renesas/0204-ARM-shmobile-r8a7790-Add-thermal-clock-in-device-tre.patch
@@ -0,0 +1,31 @@
+From 8ca4c5e9193e9934af3b5f76086a8ba65691958d Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 7 Jan 2014 19:57:14 +0100
+Subject: ARM: shmobile: r8a7790: Add thermal clock in device tree
+
+Add the missing thermal MSTP clock to the thermal device node.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d3a439dbe3ff1610156c39cdffcc2c3257fadd62)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 71b1251f79c7..96fc7313149c 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -168,6 +168,7 @@
+ reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
+ };
+
+ timer {
+--
+2.1.2
+
diff --git a/patches.renesas/0205-ARM-shmobile-r8a7791-Add-serial-ports-to-the-device-.patch b/patches.renesas/0205-ARM-shmobile-r8a7791-Add-serial-ports-to-the-device-.patch
new file mode 100644
index 00000000000000..4786240e1b5c87
--- /dev/null
+++ b/patches.renesas/0205-ARM-shmobile-r8a7791-Add-serial-ports-to-the-device-.patch
@@ -0,0 +1,209 @@
+From 9b5c5af0b9dda9225120b6039bec3e7b94f20f78 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Wed, 11 Dec 2013 14:14:22 +0100
+Subject: ARM: shmobile: r8a7791: Add serial ports to the device tree
+
+Add all serial ports marked as disabled.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9640cf259c9496d56bf44df8ae86f00f7b417ecc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 180 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 180 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 34f5d39220e3..00ed0e0a9bcb 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -186,6 +186,186 @@
+ #gpio-range-cells = <3>;
+ };
+
++ scifa0: serial@e6c40000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ reg = <0 0xe6c40000 0 64>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFA0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa1: serial@e6c50000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c50000 0 64>;
++ interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFA1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa2: serial@e6c60000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c60000 0 64>;
++ interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFA2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa3: serial@e6c70000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c70000 0 64>;
++ interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp11_clks R8A7791_CLK_SCIFA3>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa4: serial@e6c78000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c78000 0 64>;
++ interrupts = <0 30 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp11_clks R8A7791_CLK_SCIFA4>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa5: serial@e6c80000 {
++ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c80000 0 64>;
++ interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp11_clks R8A7791_CLK_SCIFA5>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb0: serial@e6c20000 {
++ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c20000 0 64>;
++ interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFB0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb1: serial@e6c30000 {
++ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c30000 0 64>;
++ interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFB1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb2: serial@e6ce0000 {
++ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6ce0000 0 64>;
++ interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp2_clks R8A7791_CLK_SCIFB2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif0: serial@e6e60000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6e60000 0 64>;
++ interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif1: serial@e6e68000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6e68000 0 64>;
++ interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif2: serial@e6e58000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6e58000 0 64>;
++ interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif3: serial@e6ea8000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6ea8000 0 64>;
++ interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF3>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif4: serial@e6ee0000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6ee0000 0 64>;
++ interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF4>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif5: serial@e6ee8000 {
++ compatible = "renesas,scif-r8a7791", "renesas,scif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6ee8000 0 64>;
++ interrupts = <0 25 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_SCIF5>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ hscif0: serial@e62c0000 {
++ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe62c0000 0 96>;
++ interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_HSCIF0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ hscif1: serial@e62c8000 {
++ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe62c8000 0 96>;
++ interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_HSCIF1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ hscif2: serial@e62d0000 {
++ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe62d0000 0 96>;
++ interrupts = <0 21 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp7_clks R8A7791_CLK_HSCIF2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
+ clocks {
+ #address-cells = <2>;
+ #size-cells = <2>;
+--
+2.1.2
+
diff --git a/patches.renesas/0206-ARM-shmobile-r8a7790-Add-serial-ports-to-the-device-.patch b/patches.renesas/0206-ARM-shmobile-r8a7790-Add-serial-ports-to-the-device-.patch
new file mode 100644
index 00000000000000..c14c80ad70c1e9
--- /dev/null
+++ b/patches.renesas/0206-ARM-shmobile-r8a7790-Add-serial-ports-to-the-device-.patch
@@ -0,0 +1,130 @@
+From ee1276e604c375c33fecb0a6b30e71da9b4bcd18 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 29 Oct 2013 16:23:12 +0100
+Subject: ARM: shmobile: r8a7790: Add serial ports to the device tree
+
+The platform code serial port instantiation mechanism is kept for the
+non-DT platforms only.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 597af20fa8f810a26c84179a8ac58cb3fce6c102)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 100 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 100 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 96fc7313149c..15e2a97e5bdf 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -300,6 +300,106 @@
+ status = "disabled";
+ };
+
++ scifa0: serial@e6c40000 {
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ reg = <0 0xe6c40000 0 64>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 144 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa1: serial@e6c50000 {
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c50000 0 64>;
++ interrupts = <0 145 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFA1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifa2: serial@e6c60000 {
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c60000 0 64>;
++ interrupts = <0 151 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFA2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb0: serial@e6c20000 {
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c20000 0 64>;
++ interrupts = <0 148 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFB0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb1: serial@e6c30000 {
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6c30000 0 64>;
++ interrupts = <0 149 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFB1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scifb2: serial@e6ce0000 {
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6ce0000 0 64>;
++ interrupts = <0 150 4>;
++ clocks = <&mstp2_clks R8A7790_CLK_SCIFB2>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif0: serial@e6e60000 {
++ compatible = "renesas,scif-r8a7790", "renesas,scif-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6e60000 0 64>;
++ interrupts = <0 152 4>;
++ clocks = <&mstp7_clks R8A7790_CLK_SCIF0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ scif1: serial@e6e68000 {
++ compatible = "renesas,scif-r8a7790", "renesas,scif-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe6e68000 0 64>;
++ interrupts = <0 153 4>;
++ clocks = <&mstp7_clks R8A7790_CLK_SCIF1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ hscif0: serial@e62c0000 {
++ compatible = "renesas,hscif-r8a7790", "renesas,hscif-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe62c0000 0 96>;
++ interrupts = <0 154 4>;
++ clocks = <&mstp7_clks R8A7790_CLK_HSCIF0>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
++ hscif1: serial@e62c8000 {
++ compatible = "renesas,hscif-r8a7790", "renesas,hscif-generic";
++ interrupt-parent = <&gic>;
++ reg = <0 0xe62c8000 0 96>;
++ interrupts = <0 155 4>;
++ clocks = <&mstp7_clks R8A7790_CLK_HSCIF1>;
++ clock-names = "sci_ick";
++ status = "disabled";
++ };
++
+ clocks {
+ #address-cells = <2>;
+ #size-cells = <2>;
+--
+2.1.2
+
diff --git a/patches.renesas/0207-ARM-shmobile-r8a7790-Add-VIN-clocks-to-device-tree.patch b/patches.renesas/0207-ARM-shmobile-r8a7790-Add-VIN-clocks-to-device-tree.patch
new file mode 100644
index 00000000000000..9d43d418accbc0
--- /dev/null
+++ b/patches.renesas/0207-ARM-shmobile-r8a7790-Add-VIN-clocks-to-device-tree.patch
@@ -0,0 +1,37 @@
+From 1a21796cf22fa65df85aab413b649869b22de54c Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 7 Jan 2014 09:22:53 +0100
+Subject: ARM: shmobile: r8a7790: Add VIN clocks to device tree
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 3f2beaa9f2d7229c041975e40868dee2e3c4a598)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 15e2a97e5bdf..9e4202c92819 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -708,10 +708,13 @@
+ mstp8_clks: mstp8_clks@e6150990 {
+ compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
+ reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
+- clocks = <&p_clk>;
++ clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>;
+ #clock-cells = <1>;
+- renesas,clock-indices = <R8A7790_CLK_ETHER>;
+- clock-output-names = "ether";
++ renesas,clock-indices = <
++ R8A7790_CLK_VIN3 R8A7790_CLK_VIN2 R8A7790_CLK_VIN1
++ R8A7790_CLK_VIN0 R8A7790_CLK_ETHER
++ >;
++ clock-output-names = "vin3", "vin2", "vin1", "vin0", "ether";
+ };
+ mstp9_clks: mstp9_clks@e6150994 {
+ compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
+--
+2.1.2
+
diff --git a/patches.renesas/0208-ARM-shmobile-r8a7791-Add-VIN-clocks-to-device-tree.patch b/patches.renesas/0208-ARM-shmobile-r8a7791-Add-VIN-clocks-to-device-tree.patch
new file mode 100644
index 00000000000000..5279ea6e836393
--- /dev/null
+++ b/patches.renesas/0208-ARM-shmobile-r8a7791-Add-VIN-clocks-to-device-tree.patch
@@ -0,0 +1,37 @@
+From d19d848bd0b51d8daa810f41f38dcdbd9daa2457 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 7 Jan 2014 09:22:54 +0100
+Subject: ARM: shmobile: r8a7791: Add VIN clocks to device tree
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 09c983463dd576d005c95dfdc0997f064629d321)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 00ed0e0a9bcb..93c6f4d2866c 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -655,10 +655,13 @@
+ mstp8_clks: mstp8_clks@e6150990 {
+ compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
+ reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
+- clocks = <&p_clk>;
++ clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>;
+ #clock-cells = <1>;
+- renesas,clock-indices = <R8A7791_CLK_ETHER>;
+- clock-output-names = "ether";
++ renesas,clock-indices = <
++ R8A7791_CLK_VIN2 R8A7791_CLK_VIN1 R8A7791_CLK_VIN0
++ R8A7791_CLK_ETHER
++ >;
++ clock-output-names = "vin2", "vin1", "vin0", "ether";
+ };
+ mstp9_clks: mstp9_clks@e6150994 {
+ compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
+--
+2.1.2
+
diff --git a/patches.renesas/0209-ARM-shmobile-r8a7790-Add-SATA-clocks-to-device-tree.patch b/patches.renesas/0209-ARM-shmobile-r8a7790-Add-SATA-clocks-to-device-tree.patch
new file mode 100644
index 00000000000000..7f79e5789bf891
--- /dev/null
+++ b/patches.renesas/0209-ARM-shmobile-r8a7790-Add-SATA-clocks-to-device-tree.patch
@@ -0,0 +1,41 @@
+From bba2a70bad22477b7d1cd7f294d551ff0a190b17 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 7 Jan 2014 09:22:55 +0100
+Subject: ARM: shmobile: r8a7790: Add SATA clocks to device tree
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Tested-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit bccccc3d861567876a87441bc92f2e3b46cb38a9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 9e4202c92819..8cc68f78cd24 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -708,13 +708,16 @@
+ mstp8_clks: mstp8_clks@e6150990 {
+ compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
+ reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
+- clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>;
++ clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>,
++ <&zs_clk>, <&zs_clk>;
+ #clock-cells = <1>;
+ renesas,clock-indices = <
+ R8A7790_CLK_VIN3 R8A7790_CLK_VIN2 R8A7790_CLK_VIN1
+- R8A7790_CLK_VIN0 R8A7790_CLK_ETHER
++ R8A7790_CLK_VIN0 R8A7790_CLK_ETHER R8A7790_CLK_SATA1
++ R8A7790_CLK_SATA0
+ >;
+- clock-output-names = "vin3", "vin2", "vin1", "vin0", "ether";
++ clock-output-names =
++ "vin3", "vin2", "vin1", "vin0", "ether", "sata1", "sata0";
+ };
+ mstp9_clks: mstp9_clks@e6150994 {
+ compatible = "renesas,r8a7790-mstp-clocks", "renesas,cpg-mstp-clocks";
+--
+2.1.2
+
diff --git a/patches.renesas/0210-ARM-shmobile-r8a7791-Add-SATA-clocks-to-device-tree.patch b/patches.renesas/0210-ARM-shmobile-r8a7791-Add-SATA-clocks-to-device-tree.patch
new file mode 100644
index 00000000000000..d601856c88f5fd
--- /dev/null
+++ b/patches.renesas/0210-ARM-shmobile-r8a7791-Add-SATA-clocks-to-device-tree.patch
@@ -0,0 +1,40 @@
+From c9e8be6a5319a3b533926055650659f872e0b200 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 7 Jan 2014 09:22:56 +0100
+Subject: ARM: shmobile: r8a7791: Add SATA clocks to device tree
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Tested-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 65f05c38749f393f775c360b9b247fa4d63b72de)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 93c6f4d2866c..94e3cc17448c 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -655,13 +655,15 @@
+ mstp8_clks: mstp8_clks@e6150990 {
+ compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
+ reg = <0 0xe6150990 0 4>, <0 0xe61509a0 0 4>;
+- clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>;
++ clocks = <&zg_clk>, <&zg_clk>, <&zg_clk>, <&p_clk>, <&zs_clk>,
++ <&zs_clk>;
+ #clock-cells = <1>;
+ renesas,clock-indices = <
+ R8A7791_CLK_VIN2 R8A7791_CLK_VIN1 R8A7791_CLK_VIN0
+- R8A7791_CLK_ETHER
++ R8A7791_CLK_ETHER R8A7791_CLK_SATA1 R8A7791_CLK_SATA0
+ >;
+- clock-output-names = "vin2", "vin1", "vin0", "ether";
++ clock-output-names =
++ "vin2", "vin1", "vin0", "ether", "sata1", "sata0";
+ };
+ mstp9_clks: mstp9_clks@e6150994 {
+ compatible = "renesas,r8a7791-mstp-clocks", "renesas,cpg-mstp-clocks";
+--
+2.1.2
+
diff --git a/patches.renesas/0211-ARM-shmobile-r8a7791-Add-SATA-nodes-to-r8a7791.dtsi.patch b/patches.renesas/0211-ARM-shmobile-r8a7791-Add-SATA-nodes-to-r8a7791.dtsi.patch
new file mode 100644
index 00000000000000..ac53d1caabd2fc
--- /dev/null
+++ b/patches.renesas/0211-ARM-shmobile-r8a7791-Add-SATA-nodes-to-r8a7791.dtsi.patch
@@ -0,0 +1,48 @@
+From f862aa85ecb9a04e39b68258a97c88bb063d9b90 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 14 Jan 2014 21:05:40 +0400
+Subject: ARM: shmobile: r8a7791: Add SATA nodes to r8a7791.dtsi
+
+This adds SATA[01] device nodes to r8a7791.dtsi.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit b8532c699a163702bfcadaaa4c23c4ff71b67eec)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 94e3cc17448c..d5cc3626dd60 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -366,6 +366,24 @@
+ status = "disabled";
+ };
+
++ sata0: sata@ee300000 {
++ compatible = "renesas,sata-r8a7791";
++ reg = <0 0xee300000 0 0x2000>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7791_CLK_SATA0>;
++ status = "disabled";
++ };
++
++ sata1: sata@ee500000 {
++ compatible = "renesas,sata-r8a7791";
++ reg = <0 0xee500000 0 0x2000>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7791_CLK_SATA1>;
++ status = "disabled";
++ };
++
+ clocks {
+ #address-cells = <2>;
+ #size-cells = <2>;
+--
+2.1.2
+
diff --git a/patches.renesas/0212-ARM-shmobile-koelsch-Enable-SATA0-in-r8a7791-koelsch.patch b/patches.renesas/0212-ARM-shmobile-koelsch-Enable-SATA0-in-r8a7791-koelsch.patch
new file mode 100644
index 00000000000000..9c6e3fc3d80953
--- /dev/null
+++ b/patches.renesas/0212-ARM-shmobile-koelsch-Enable-SATA0-in-r8a7791-koelsch.patch
@@ -0,0 +1,33 @@
+From 4d5054b6386393bead91ef01ea84fda19a11d42b Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 14 Jan 2014 21:05:41 +0400
+Subject: ARM: shmobile: koelsch: Enable SATA0 in r8a7791-koelsch.dts
+
+This enables SATA0 in Koelsch device tree.
+SATA1 is not available on Koelsch since
+its pinmux configuration is fixed to PCIe.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 760c277b23973a3db181b2ae98d9a87f6e8f843e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index d30527dee0c9..74f098596b5c 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -122,3 +122,7 @@
+ renesas,function = "scif1";
+ };
+ };
++
++&sata0 {
++ status = "okay";
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0213-ARM-shmobile-r8a7790-Add-SATA-nodes-to-r8a7790.dtsi.patch b/patches.renesas/0213-ARM-shmobile-r8a7790-Add-SATA-nodes-to-r8a7790.dtsi.patch
new file mode 100644
index 00000000000000..4b7d1735eca496
--- /dev/null
+++ b/patches.renesas/0213-ARM-shmobile-r8a7790-Add-SATA-nodes-to-r8a7790.dtsi.patch
@@ -0,0 +1,48 @@
+From cfd82740c79944acabec2bb8041b2e95fd43c069 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 14 Jan 2014 21:05:30 +0400
+Subject: ARM: shmobile: r8a7790: Add SATA nodes to r8a7790.dtsi
+
+This adds SATA[01] device nodes to r8a7790.dtsi
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit cde630f763b07ff5d8ff7d34969f9dd05a2a4001)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 8cc68f78cd24..091492152911 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -400,6 +400,24 @@
+ status = "disabled";
+ };
+
++ sata0: sata@ee300000 {
++ compatible = "renesas,sata-r8a7790";
++ reg = <0 0xee300000 0 0x2000>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7790_CLK_SATA0>;
++ status = "disabled";
++ };
++
++ sata1: sata@ee500000 {
++ compatible = "renesas,sata-r8a7790";
++ reg = <0 0xee500000 0 0x2000>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7790_CLK_SATA1>;
++ status = "disabled";
++ };
++
+ clocks {
+ #address-cells = <2>;
+ #size-cells = <2>;
+--
+2.1.2
+
diff --git a/patches.renesas/0214-ARM-shmobile-lager-Enable-SATA1-in-r8a7790-lager.dts.patch b/patches.renesas/0214-ARM-shmobile-lager-Enable-SATA1-in-r8a7790-lager.dts.patch
new file mode 100644
index 00000000000000..9a518a113ab03b
--- /dev/null
+++ b/patches.renesas/0214-ARM-shmobile-lager-Enable-SATA1-in-r8a7790-lager.dts.patch
@@ -0,0 +1,33 @@
+From 7aca02f9622035a1f9b9e311170574f191ac3679 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 14 Jan 2014 21:05:31 +0400
+Subject: ARM: shmobile: lager: Enable SATA1 in r8a7790-lager.dts
+
+This enables SATA1 in Lager device tree.
+SATA0 is not available on Lager since its
+pinmux is fixed to USB3.0.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c6181b9f06b0821e8d34e47174e044801f03edce)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index 57569cba1528..1081c5e91ac4 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -91,3 +91,7 @@
+ non-removable;
+ status = "okay";
+ };
++
++&sata1 {
++ status = "okay";
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0215-ARM-shmobile-r8a7790-Fix-serial-ports-DT-compatible-.patch b/patches.renesas/0215-ARM-shmobile-r8a7790-Fix-serial-ports-DT-compatible-.patch
new file mode 100644
index 00000000000000..597703286ea5b5
--- /dev/null
+++ b/patches.renesas/0215-ARM-shmobile-r8a7790-Fix-serial-ports-DT-compatible-.patch
@@ -0,0 +1,113 @@
+From 5d8c893ffe8363ca4094fe4070279f4a465efb06 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 21 Jan 2014 13:48:38 +0100
+Subject: ARM: shmobile: r8a7790: Fix serial ports DT compatible strings
+
+Remove the -generic suffix that has been added by mistake from the
+serial port compatible strings.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 59d2b5173bbe8dbc324e34263ceae4d6131058f2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 091492152911..51c897835628 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -301,7 +301,7 @@
+ };
+
+ scifa0: serial@e6c40000 {
+- compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 144 4>;
+@@ -311,7 +311,7 @@
+ };
+
+ scifa1: serial@e6c50000 {
+- compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c50000 0 64>;
+ interrupts = <0 145 4>;
+@@ -321,7 +321,7 @@
+ };
+
+ scifa2: serial@e6c60000 {
+- compatible = "renesas,scifa-r8a7790", "renesas,scifa-generic";
++ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c60000 0 64>;
+ interrupts = <0 151 4>;
+@@ -331,7 +331,7 @@
+ };
+
+ scifb0: serial@e6c20000 {
+- compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c20000 0 64>;
+ interrupts = <0 148 4>;
+@@ -341,7 +341,7 @@
+ };
+
+ scifb1: serial@e6c30000 {
+- compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c30000 0 64>;
+ interrupts = <0 149 4>;
+@@ -351,7 +351,7 @@
+ };
+
+ scifb2: serial@e6ce0000 {
+- compatible = "renesas,scifb-r8a7790", "renesas,scifb-generic";
++ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6ce0000 0 64>;
+ interrupts = <0 150 4>;
+@@ -361,7 +361,7 @@
+ };
+
+ scif0: serial@e6e60000 {
+- compatible = "renesas,scif-r8a7790", "renesas,scif-generic";
++ compatible = "renesas,scif-r8a7790", "renesas,scif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6e60000 0 64>;
+ interrupts = <0 152 4>;
+@@ -371,7 +371,7 @@
+ };
+
+ scif1: serial@e6e68000 {
+- compatible = "renesas,scif-r8a7790", "renesas,scif-generic";
++ compatible = "renesas,scif-r8a7790", "renesas,scif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6e68000 0 64>;
+ interrupts = <0 153 4>;
+@@ -381,7 +381,7 @@
+ };
+
+ hscif0: serial@e62c0000 {
+- compatible = "renesas,hscif-r8a7790", "renesas,hscif-generic";
++ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe62c0000 0 96>;
+ interrupts = <0 154 4>;
+@@ -391,7 +391,7 @@
+ };
+
+ hscif1: serial@e62c8000 {
+- compatible = "renesas,hscif-r8a7790", "renesas,hscif-generic";
++ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe62c8000 0 96>;
+ interrupts = <0 155 4>;
+--
+2.1.2
+
diff --git a/patches.renesas/0216-ARM-shmobile-r8a7790-Replace-IRQ-type-numerical-valu.patch b/patches.renesas/0216-ARM-shmobile-r8a7790-Replace-IRQ-type-numerical-valu.patch
new file mode 100644
index 00000000000000..6215fd06b51521
--- /dev/null
+++ b/patches.renesas/0216-ARM-shmobile-r8a7790-Replace-IRQ-type-numerical-valu.patch
@@ -0,0 +1,112 @@
+From d395353d60021ede96a57c3f195ac8ede98fc430 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 21 Jan 2014 13:48:39 +0100
+Subject: ARM: shmobile: r8a7790: Replace IRQ type numerical values with macros
+
+Replace the hardcoded value 4 with IRQ_TYPE_LEVEL_HIGH.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 1f4c745b2c5a083c49dc11d2f0827d9a381f1ee1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 51c897835628..ba0ef9a864c8 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -304,7 +304,7 @@
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+ interrupt-parent = <&gic>;
+- interrupts = <0 144 4>;
++ interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -314,7 +314,7 @@
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c50000 0 64>;
+- interrupts = <0 145 4>;
++ interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA1>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -324,7 +324,7 @@
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c60000 0 64>;
+- interrupts = <0 151 4>;
++ interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA2>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -334,7 +334,7 @@
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c20000 0 64>;
+- interrupts = <0 148 4>;
++ interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB0>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -344,7 +344,7 @@
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6c30000 0 64>;
+- interrupts = <0 149 4>;
++ interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB1>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -354,7 +354,7 @@
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6ce0000 0 64>;
+- interrupts = <0 150 4>;
++ interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB2>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -364,7 +364,7 @@
+ compatible = "renesas,scif-r8a7790", "renesas,scif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6e60000 0 64>;
+- interrupts = <0 152 4>;
++ interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_SCIF0>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -374,7 +374,7 @@
+ compatible = "renesas,scif-r8a7790", "renesas,scif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe6e68000 0 64>;
+- interrupts = <0 153 4>;
++ interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_SCIF1>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -384,7 +384,7 @@
+ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe62c0000 0 96>;
+- interrupts = <0 154 4>;
++ interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_HSCIF0>;
+ clock-names = "sci_ick";
+ status = "disabled";
+@@ -394,7 +394,7 @@
+ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+ interrupt-parent = <&gic>;
+ reg = <0 0xe62c8000 0 96>;
+- interrupts = <0 155 4>;
++ interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_HSCIF1>;
+ clock-names = "sci_ick";
+ status = "disabled";
+--
+2.1.2
+
diff --git a/patches.renesas/0217-ARM-shmobile-Lager-conditionally-select-CONFIG_MICRE.patch b/patches.renesas/0217-ARM-shmobile-Lager-conditionally-select-CONFIG_MICRE.patch
new file mode 100644
index 00000000000000..1b1c334b8249f9
--- /dev/null
+++ b/patches.renesas/0217-ARM-shmobile-Lager-conditionally-select-CONFIG_MICRE.patch
@@ -0,0 +1,40 @@
+From 209ee92c33331a4ec858ece05e158b24363f9f47 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Fri, 20 Dec 2013 02:20:54 +0300
+Subject: ARM: shmobile: Lager: conditionally select CONFIG_MICREL_PHY
+
+Now that support for KSZ8041RNLI is added to the Micrel PHY driver and we intend
+to support PHY IRQs on the Lager board, we have to enable the Micrel driver.
+Do this by selecting CONFIG_MICREL_PHY for Lager if CONFIG_SH_ETH is enabled.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a2a4759b5262979cbe4bc1f681ec5a6ab064fce3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 05fa505df585..d99a952cfb11 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -54,6 +54,7 @@ config MACH_KZM9D
+ config MACH_LAGER
+ bool "Lager board"
+ depends on ARCH_R8A7790
++ select MICREL_PHY if SH_ETH
+
+ comment "Renesas ARM SoCs System Configuration"
+ endif
+@@ -261,6 +262,7 @@ config MACH_LAGER
+ bool "Lager board"
+ depends on ARCH_R8A7790
+ select USE_OF
++ select MICREL_PHY if SH_ETH
+
+ config MACH_KOELSCH
+ bool "Koelsch board"
+--
+2.1.2
+
diff --git a/patches.renesas/0218-ARM-shmobile-bockw-use-SSI-DMAEngine-for-sound.patch b/patches.renesas/0218-ARM-shmobile-bockw-use-SSI-DMAEngine-for-sound.patch
new file mode 100644
index 00000000000000..f9b1924e90ca18
--- /dev/null
+++ b/patches.renesas/0218-ARM-shmobile-bockw-use-SSI-DMAEngine-for-sound.patch
@@ -0,0 +1,45 @@
+From f089d31632617d1a1c35561be7716aee07c9be65 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 23 Dec 2013 20:44:15 -0800
+Subject: ARM: shmobile: bockw: use SSI DMAEngine for sound
+
+R-Car sound driver is supporting Mem <-> SSI
+direct transfer via DMAEngine.
+Current HPB-DMA is using double plane transfer,
+but the sound may have noise since SSI doesn't have FIFO.
+This patch supports it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 6d0ef79743abd39c1867a7fb9eaccdda0b2136db)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-bockw.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
+index c475220545f2..bdb78a77e78f 100644
+--- a/arch/arm/mach-shmobile/board-bockw.c
++++ b/arch/arm/mach-shmobile/board-bockw.c
+@@ -332,12 +332,12 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
+ RSND_SSI_UNUSED, /* SSI 0 */
+ RSND_SSI_UNUSED, /* SSI 1 */
+ RSND_SSI_UNUSED, /* SSI 2 */
+- RSND_SSI_SET(1, 0, gic_iid(0x85), RSND_SSI_PLAY),
+- RSND_SSI_SET(2, 0, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
+- RSND_SSI_SET(0, 0, gic_iid(0x86), RSND_SSI_PLAY),
+- RSND_SSI_SET(0, 0, gic_iid(0x86), 0),
+- RSND_SSI_SET(3, 0, gic_iid(0x86), RSND_SSI_PLAY),
+- RSND_SSI_SET(4, 0, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
++ RSND_SSI_SET(1, HPBDMA_SLAVE_SSI3_TX, gic_iid(0x85), RSND_SSI_PLAY),
++ RSND_SSI_SET(2, HPBDMA_SLAVE_SSI4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
++ RSND_SSI_SET(0, HPBDMA_SLAVE_SSI5_TX, gic_iid(0x86), RSND_SSI_PLAY),
++ RSND_SSI_SET(0, HPBDMA_SLAVE_SSI6_RX, gic_iid(0x86), 0),
++ RSND_SSI_SET(3, HPBDMA_SLAVE_SSI7_TX, gic_iid(0x86), RSND_SSI_PLAY),
++ RSND_SSI_SET(4, HPBDMA_SLAVE_SSI8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
+ };
+
+ static struct rsnd_scu_platform_info rsnd_scu[9] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0219-ARM-shmobile-bockw-use-HPBIF-DMAEngine-for-sound.patch b/patches.renesas/0219-ARM-shmobile-bockw-use-HPBIF-DMAEngine-for-sound.patch
new file mode 100644
index 00000000000000..ab155c61ac3f26
--- /dev/null
+++ b/patches.renesas/0219-ARM-shmobile-bockw-use-HPBIF-DMAEngine-for-sound.patch
@@ -0,0 +1,58 @@
+From bd361810671d2919f205f34bf74fe7df91af6314 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 23 Dec 2013 20:44:23 -0800
+Subject: ARM: shmobile: bockw: use HPBIF DMAEngine for sound
+
+R-Car sound driver is supporting Mem <-> SRU <-> SSI
+transfer via DMAEngine.
+The sound will be less noise if it uses SRU path
+since it has FIFO.
+This patch supports it.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 88bf7f6846dea22bd50f8abf4c30530bbe2b6424)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-bockw.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
+index bdb78a77e78f..24b41613eabe 100644
+--- a/arch/arm/mach-shmobile/board-bockw.c
++++ b/arch/arm/mach-shmobile/board-bockw.c
+@@ -332,16 +332,24 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
+ RSND_SSI_UNUSED, /* SSI 0 */
+ RSND_SSI_UNUSED, /* SSI 1 */
+ RSND_SSI_UNUSED, /* SSI 2 */
+- RSND_SSI_SET(1, HPBDMA_SLAVE_SSI3_TX, gic_iid(0x85), RSND_SSI_PLAY),
+- RSND_SSI_SET(2, HPBDMA_SLAVE_SSI4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
+- RSND_SSI_SET(0, HPBDMA_SLAVE_SSI5_TX, gic_iid(0x86), RSND_SSI_PLAY),
+- RSND_SSI_SET(0, HPBDMA_SLAVE_SSI6_RX, gic_iid(0x86), 0),
+- RSND_SSI_SET(3, HPBDMA_SLAVE_SSI7_TX, gic_iid(0x86), RSND_SSI_PLAY),
+- RSND_SSI_SET(4, HPBDMA_SLAVE_SSI8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
++ RSND_SSI_SET(1, HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), RSND_SSI_PLAY),
++ RSND_SSI_SET(2, HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
++ RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), RSND_SSI_PLAY),
++ RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
++ RSND_SSI_SET(3, HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), RSND_SSI_PLAY),
++ RSND_SSI_SET(4, HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
+ };
+
+ static struct rsnd_scu_platform_info rsnd_scu[9] = {
+- /* no member at this point */
++ { .flags = 0, }, /* SRU 0 */
++ { .flags = 0, }, /* SRU 1 */
++ { .flags = 0, }, /* SRU 2 */
++ { .flags = RSND_SCU_USE_HPBIF, },
++ { .flags = RSND_SCU_USE_HPBIF, },
++ { .flags = RSND_SCU_USE_HPBIF, },
++ { .flags = RSND_SCU_USE_HPBIF, },
++ { .flags = RSND_SCU_USE_HPBIF, },
++ { .flags = RSND_SCU_USE_HPBIF, },
+ };
+
+ enum {
+--
+2.1.2
+
diff --git a/patches.renesas/0220-ARM-shmobile-bockw-add-USB-Func-DMAEngine-support.patch b/patches.renesas/0220-ARM-shmobile-bockw-add-USB-Func-DMAEngine-support.patch
new file mode 100644
index 00000000000000..eaf2923913e3ad
--- /dev/null
+++ b/patches.renesas/0220-ARM-shmobile-bockw-add-USB-Func-DMAEngine-support.patch
@@ -0,0 +1,29 @@
+From 11f36f546f19bcb16918ac1f55ee863465275a49 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 23 Dec 2013 20:44:30 -0800
+Subject: ARM: shmobile: bockw: add USB Func DMAEngine support
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit f3ffa47c8d563d8ea3e378fa59aca5dde9624a01)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-bockw.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
+index 24b41613eabe..684a529e400d 100644
+--- a/arch/arm/mach-shmobile/board-bockw.c
++++ b/arch/arm/mach-shmobile/board-bockw.c
+@@ -168,6 +168,8 @@ static struct renesas_usbhs_platform_info usbhs_info __initdata = {
+ },
+ .driver_param = {
+ .buswait_bwait = 4,
++ .d0_tx_id = HPBDMA_SLAVE_USBFUNC_TX,
++ .d1_rx_id = HPBDMA_SLAVE_USBFUNC_RX,
+ },
+ };
+
+--
+2.1.2
+
diff --git a/patches.renesas/0221-ARM-shmobile-koelsch-Conditionally-select-MICREL_PHY.patch b/patches.renesas/0221-ARM-shmobile-koelsch-Conditionally-select-MICREL_PHY.patch
new file mode 100644
index 00000000000000..9503971ba60df2
--- /dev/null
+++ b/patches.renesas/0221-ARM-shmobile-koelsch-Conditionally-select-MICREL_PHY.patch
@@ -0,0 +1,32 @@
+From 3d981c9883f146b00480026235c2ac6147529d28 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Thu, 26 Dec 2013 14:30:38 +0900
+Subject: ARM: shmobile: koelsch: Conditionally select MICREL_PHY for
+ Multiplatform
+
+The koelsch board uses has an SH ethernet controller which uses a Micrel
+phy. Select MICREL_PHY for koelsch if SH_ETH is enabled to make use of the
+Micrel-specific phy driver rather than relying on the generic phy driver.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit aefe88ba044bdcd91bc0cd1e75ab2dc524ed5107)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index d99a952cfb11..96ebc05a0d9b 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -45,6 +45,7 @@ config MACH_GENMAI
+ config MACH_KOELSCH
+ bool "Koelsch board"
+ depends on ARCH_R8A7791
++ select MICREL_PHY if SH_ETH
+
+ config MACH_KZM9D
+ bool "KZM9D board"
+--
+2.1.2
+
diff --git a/patches.renesas/0222-ARM-mach-shmobile-kzm9g-add-zboot-support.patch b/patches.renesas/0222-ARM-mach-shmobile-kzm9g-add-zboot-support.patch
new file mode 100644
index 00000000000000..bd2033a0cbcfeb
--- /dev/null
+++ b/patches.renesas/0222-ARM-mach-shmobile-kzm9g-add-zboot-support.patch
@@ -0,0 +1,506 @@
+From a348afa382f8f4cdff53a20eb4bf549f384e2d1c Mon Sep 17 00:00:00 2001
+From: Ulrich Hecht <ulrich.hecht@gmail.com>
+Date: Tue, 26 Nov 2013 21:53:20 +0100
+Subject: ARM: mach-shmobile: kzm9g: add zboot support
+
+Adds support to run the kernel on the uninitialized KZM9G board, using for
+instance the mask ROM boot loader or JTAG. This patch tries to emulate the
+style of the corresponding "mackerel" implementation. The DRAM controller
+setup code has been adapted from u-boot.
+
+Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a56585d12cbe8903dcc71332579b9e2e0807fe44)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/include/mach/head-kzm9g.txt | 410 +++++++++++++++++++++
+ arch/arm/mach-shmobile/include/mach/zboot.h | 3 +
+ arch/arm/mach-shmobile/include/mach/zboot_macros.h | 43 +++
+ 3 files changed, 456 insertions(+)
+ create mode 100644 arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
+
+diff --git a/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt b/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
+new file mode 100644
+index 000000000000..9531f46a822a
+--- /dev/null
++++ b/arch/arm/mach-shmobile/include/mach/head-kzm9g.txt
+@@ -0,0 +1,410 @@
++LIST "KZM9G low-level initialization routine."
++LIST "Adapted from u-boot KZM9G support code."
++
++LIST "Copyright (C) 2013 Ulrich Hecht"
++
++LIST "This program is free software; you can redistribute it and/or modify"
++LIST "it under the terms of the GNU General Public License version 2 as"
++LIST "published by the Free Software Foundation."
++
++LIST "This program is distributed in the hope that it will be useful,"
++LIST "but WITHOUT ANY WARRANTY; without even the implied warranty of"
++LIST "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
++LIST "GNU General Public License for more details."
++
++
++LIST "Register definitions:"
++
++LIST "Secure control register"
++#define LIFEC_SEC_SRC (0xE6110008)
++
++LIST "RWDT"
++#define RWDT_BASE (0xE6020000)
++#define RWTCSRA0 (RWDT_BASE + 0x04)
++
++LIST "HPB Semaphore Control Registers"
++#define HPBSCR_BASE (0xE6000000)
++#define HPBCTRL6 (HPBSCR_BASE + 0x1030)
++
++#define SBSC1_BASE (0xFE400000)
++#define SDCR0A (SBSC1_BASE + 0x0008)
++#define SDCR1A (SBSC1_BASE + 0x000C)
++#define SDPCRA (SBSC1_BASE + 0x0010)
++#define SDCR0SA (SBSC1_BASE + 0x0018)
++#define SDCR1SA (SBSC1_BASE + 0x001C)
++#define RTCSRA (SBSC1_BASE + 0x0020)
++#define RTCORA (SBSC1_BASE + 0x0028)
++#define RTCORHA (SBSC1_BASE + 0x002C)
++#define SDWCRC0A (SBSC1_BASE + 0x0040)
++#define SDWCRC1A (SBSC1_BASE + 0x0044)
++#define SDWCR00A (SBSC1_BASE + 0x0048)
++#define SDWCR01A (SBSC1_BASE + 0x004C)
++#define SDWCR10A (SBSC1_BASE + 0x0050)
++#define SDWCR11A (SBSC1_BASE + 0x0054)
++#define SDWCR2A (SBSC1_BASE + 0x0060)
++#define SDWCRC2A (SBSC1_BASE + 0x0064)
++#define ZQCCRA (SBSC1_BASE + 0x0068)
++#define SDMRACR0A (SBSC1_BASE + 0x0084)
++#define SDMRTMPCRA (SBSC1_BASE + 0x008C)
++#define SDMRTMPMSKA (SBSC1_BASE + 0x0094)
++#define SDGENCNTA (SBSC1_BASE + 0x009C)
++#define SDDRVCR0A (SBSC1_BASE + 0x00B4)
++#define DLLCNT0A (SBSC1_BASE + 0x0354)
++
++#define SDMRA1 (0xFE500000)
++#define SDMRA2 (0xFE5C0000)
++#define SDMRA3 (0xFE504000)
++
++#define SBSC2_BASE (0xFB400000)
++#define SDCR0B (SBSC2_BASE + 0x0008)
++#define SDCR1B (SBSC2_BASE + 0x000C)
++#define SDPCRB (SBSC2_BASE + 0x0010)
++#define SDCR0SB (SBSC2_BASE + 0x0018)
++#define SDCR1SB (SBSC2_BASE + 0x001C)
++#define RTCSRB (SBSC2_BASE + 0x0020)
++#define RTCORB (SBSC2_BASE + 0x0028)
++#define RTCORHB (SBSC2_BASE + 0x002C)
++#define SDWCRC0B (SBSC2_BASE + 0x0040)
++#define SDWCRC1B (SBSC2_BASE + 0x0044)
++#define SDWCR00B (SBSC2_BASE + 0x0048)
++#define SDWCR01B (SBSC2_BASE + 0x004C)
++#define SDWCR10B (SBSC2_BASE + 0x0050)
++#define SDWCR11B (SBSC2_BASE + 0x0054)
++#define SDPDCR0B (SBSC2_BASE + 0x0058)
++#define SDWCR2B (SBSC2_BASE + 0x0060)
++#define SDWCRC2B (SBSC2_BASE + 0x0064)
++#define ZQCCRB (SBSC2_BASE + 0x0068)
++#define SDMRACR0B (SBSC2_BASE + 0x0084)
++#define SDMRTMPCRB (SBSC2_BASE + 0x008C)
++#define SDMRTMPMSKB (SBSC2_BASE + 0x0094)
++#define SDGENCNTB (SBSC2_BASE + 0x009C)
++#define DPHYCNT0B (SBSC2_BASE + 0x00A0)
++#define DPHYCNT1B (SBSC2_BASE + 0x00A4)
++#define DPHYCNT2B (SBSC2_BASE + 0x00A8)
++#define SDDRVCR0B (SBSC2_BASE + 0x00B4)
++#define DLLCNT0B (SBSC2_BASE + 0x0354)
++
++#define SDMRB1 (0xFB500000)
++#define SDMRB2 (0xFB5C0000)
++#define SDMRB3 (0xFB504000)
++
++#define CPG_BASE (0xE6150000)
++#define FRQCRA (CPG_BASE + 0x0000)
++#define FRQCRB (CPG_BASE + 0x0004)
++#define FRQCRD (CPG_BASE + 0x00E4)
++#define VCLKCR1 (CPG_BASE + 0x0008)
++#define VCLKCR2 (CPG_BASE + 0x000C)
++#define VCLKCR3 (CPG_BASE + 0x001C)
++#define ZBCKCR (CPG_BASE + 0x0010)
++#define FLCKCR (CPG_BASE + 0x0014)
++#define SD0CKCR (CPG_BASE + 0x0074)
++#define SD1CKCR (CPG_BASE + 0x0078)
++#define SD2CKCR (CPG_BASE + 0x007C)
++#define FSIACKCR (CPG_BASE + 0x0018)
++#define SUBCKCR (CPG_BASE + 0x0080)
++#define SPUACKCR (CPG_BASE + 0x0084)
++#define SPUVCKCR (CPG_BASE + 0x0094)
++#define MSUCKCR (CPG_BASE + 0x0088)
++#define HSICKCR (CPG_BASE + 0x008C)
++#define FSIBCKCR (CPG_BASE + 0x0090)
++#define MFCK1CR (CPG_BASE + 0x0098)
++#define MFCK2CR (CPG_BASE + 0x009C)
++#define DSITCKCR (CPG_BASE + 0x0060)
++#define DSI0PCKCR (CPG_BASE + 0x0064)
++#define DSI1PCKCR (CPG_BASE + 0x0068)
++#define DSI0PHYCR (CPG_BASE + 0x006C)
++#define DVFSCR3 (CPG_BASE + 0x0174)
++#define DVFSCR4 (CPG_BASE + 0x0178)
++#define DVFSCR5 (CPG_BASE + 0x017C)
++#define MPMODE (CPG_BASE + 0x00CC)
++
++#define PLLECR (CPG_BASE + 0x00D0)
++#define PLL0CR (CPG_BASE + 0x00D8)
++#define PLL1CR (CPG_BASE + 0x0028)
++#define PLL2CR (CPG_BASE + 0x002C)
++#define PLL3CR (CPG_BASE + 0x00DC)
++#define PLL0STPCR (CPG_BASE + 0x00F0)
++#define PLL1STPCR (CPG_BASE + 0x00C8)
++#define PLL2STPCR (CPG_BASE + 0x00F8)
++#define PLL3STPCR (CPG_BASE + 0x00FC)
++#define RMSTPCR0 (CPG_BASE + 0x0110)
++#define RMSTPCR1 (CPG_BASE + 0x0114)
++#define RMSTPCR2 (CPG_BASE + 0x0118)
++#define RMSTPCR3 (CPG_BASE + 0x011C)
++#define RMSTPCR4 (CPG_BASE + 0x0120)
++#define RMSTPCR5 (CPG_BASE + 0x0124)
++#define SMSTPCR0 (CPG_BASE + 0x0130)
++#define SMSTPCR2 (CPG_BASE + 0x0138)
++#define SMSTPCR3 (CPG_BASE + 0x013C)
++#define CPGXXCR4 (CPG_BASE + 0x0150)
++#define SRCR0 (CPG_BASE + 0x80A0)
++#define SRCR2 (CPG_BASE + 0x80B0)
++#define SRCR3 (CPG_BASE + 0x80A8)
++#define VREFCR (CPG_BASE + 0x00EC)
++#define PCLKCR (CPG_BASE + 0x1020)
++
++#define PORT32CR (0xE6051020)
++#define PORT33CR (0xE6051021)
++#define PORT34CR (0xE6051022)
++#define PORT35CR (0xE6051023)
++
++LIST "DRAM initialization code:"
++
++EW RWTCSRA0, 0xA507
++
++ED_AND LIFEC_SEC_SRC, 0xFFFF7FFF
++
++ED_AND SMSTPCR3,0xFFFF7FFF
++ED_AND SRCR3, 0xFFFF7FFF
++ED_AND SMSTPCR2,0xFFFBFFFF
++ED_AND SRCR2, 0xFFFBFFFF
++ED PLLECR, 0x00000000
++
++WAIT_MASK PLLECR, 0x00000F00, 0x00000000
++WAIT_MASK FRQCRB, 0x80000000, 0x00000000
++
++ED PLL0CR, 0x2D000000
++ED PLL1CR, 0x17100000
++ED FRQCRB, 0x96235880
++WAIT_MASK FRQCRB, 0x80000000, 0x00000000
++
++ED FLCKCR, 0x0000000B
++ED_AND SMSTPCR0, 0xFFFFFFFD
++
++ED_AND SRCR0, 0xFFFFFFFD
++ED 0xE6001628, 0x514
++ED 0xE6001648, 0x514
++ED 0xE6001658, 0x514
++ED 0xE6001678, 0x514
++
++ED DVFSCR4, 0x00092000
++ED DVFSCR5, 0x000000DC
++ED PLLECR, 0x00000000
++WAIT_MASK PLLECR, 0x00000F00, 0x00000000
++
++ED FRQCRA, 0x0012453C
++ED FRQCRB, 0x80431350
++WAIT_MASK FRQCRB, 0x80000000, 0x00000000
++ED FRQCRD, 0x00000B0B
++WAIT_MASK FRQCRD, 0x80000000, 0x00000000
++
++ED PCLKCR, 0x00000003
++ED VCLKCR1, 0x0000012F
++ED VCLKCR2, 0x00000119
++ED VCLKCR3, 0x00000119
++ED ZBCKCR, 0x00000002
++ED FLCKCR, 0x00000005
++ED SD0CKCR, 0x00000080
++ED SD1CKCR, 0x00000080
++ED SD2CKCR, 0x00000080
++ED FSIACKCR, 0x0000003F
++ED FSIBCKCR, 0x0000003F
++ED SUBCKCR, 0x00000080
++ED SPUACKCR, 0x0000000B
++ED SPUVCKCR, 0x0000000B
++ED MSUCKCR, 0x0000013F
++ED HSICKCR, 0x00000080
++ED MFCK1CR, 0x0000003F
++ED MFCK2CR, 0x0000003F
++ED DSITCKCR, 0x00000107
++ED DSI0PCKCR, 0x00000313
++ED DSI1PCKCR, 0x0000130D
++ED DSI0PHYCR, 0x2A800E0E
++ED PLL0CR, 0x1E000000
++ED PLL0CR, 0x2D000000
++ED PLL1CR, 0x17100000
++ED PLL2CR, 0x27000080
++ED PLL3CR, 0x1D000000
++ED PLL0STPCR, 0x00080000
++ED PLL1STPCR, 0x000120C0
++ED PLL2STPCR, 0x00012000
++ED PLL3STPCR, 0x00000030
++ED PLLECR, 0x0000000B
++WAIT_MASK PLLECR, 0x00000B00, 0x00000B00
++
++ED DVFSCR3, 0x000120F0
++ED MPMODE, 0x00000020
++ED VREFCR, 0x0000028A
++ED RMSTPCR0, 0xE4628087
++ED RMSTPCR1, 0xFFFFFFFF
++ED RMSTPCR2, 0x53FFFFFF
++ED RMSTPCR3, 0xFFFFFFFF
++ED RMSTPCR4, 0x00800D3D
++ED RMSTPCR5, 0xFFFFF3FF
++ED SMSTPCR2, 0x00000000
++ED SRCR2, 0x00040000
++ED_AND PLLECR, 0xFFFFFFF7
++WAIT_MASK PLLECR, 0x00000800, 0x00000000
++
++LIST "set SBSC operational"
++ED HPBCTRL6, 0x00000001
++WAIT_MASK HPBCTRL6, 0x00000001, 0x00000001
++
++LIST "set SBSC operating frequency"
++ED FRQCRD, 0x00001414
++WAIT_MASK FRQCRD, 0x80000000, 0x00000000
++ED PLL3CR, 0x1D000000
++ED_OR PLLECR, 0x00000008
++WAIT_MASK PLLECR, 0x00000800, 0x00000800
++
++LIST "enable DLL oscillation in DDRPHY"
++ED_OR DLLCNT0A, 0x00000002
++
++LIST "wait >= 100 ns"
++ED SDGENCNTA, 0x00000005
++WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
++
++LIST "target LPDDR2 device settings"
++ED SDCR0A, 0xACC90159
++ED SDCR1A, 0x00010059
++ED SDWCRC0A, 0x50874114
++ED SDWCRC1A, 0x33199B37
++ED SDWCRC2A, 0x008F2313
++ED SDWCR00A, 0x31020707
++ED SDWCR01A, 0x0017040A
++ED SDWCR10A, 0x31020707
++ED SDWCR11A, 0x0017040A
++
++ED SDDRVCR0A, 0x055557ff
++
++ED SDWCR2A, 0x30000000
++
++LIST "drive CKE high"
++ED_OR SDPCRA, 0x00000080
++WAIT_MASK SDPCRA, 0x00000080, 0x00000080
++
++LIST "wait >= 200 us"
++ED SDGENCNTA, 0x00002710
++WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
++
++LIST "issue reset command to LPDDR2 device"
++ED SDMRACR0A, 0x0000003F
++ED SDMRA1, 0x00000000
++
++LIST "wait >= 10 (or 1) us (docs inconsistent)"
++ED SDGENCNTA, 0x000001F4
++WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
++
++LIST "MRW ZS initialization calibration command"
++ED SDMRACR0A, 0x0000FF0A
++ED SDMRA3, 0x00000000
++
++LIST "wait >= 1 us"
++ED SDGENCNTA, 0x00000032
++WAIT_MASK SDGENCNTA, 0xFFFFFFFF, 0x00000000
++
++LIST "specify operating mode in LPDDR2"
++ED SDMRACR0A, 0x00002201
++ED SDMRA1, 0x00000000
++ED SDMRACR0A, 0x00000402
++ED SDMRA1, 0x00000000
++ED SDMRACR0A, 0x00000203
++ED SDMRA1, 0x00000000
++
++LIST "initialize DDR interface"
++ED SDMRA2, 0x00000000
++
++LIST "temperature sensor control"
++ED SDMRTMPCRA, 0x88800004
++ED SDMRTMPMSKA,0x00000004
++
++LIST "auto-refreshing control"
++ED RTCORA, 0xA55A0032
++ED RTCORHA, 0xA55A000C
++ED RTCSRA, 0xA55A2048
++
++ED_OR SDCR0A, 0x00000800
++ED_OR SDCR1A, 0x00000400
++
++LIST "auto ZQ calibration control"
++ED ZQCCRA, 0xFFF20000
++
++ED_OR DLLCNT0B, 0x00000002
++ED SDGENCNTB, 0x00000005
++WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
++
++ED SDCR0B, 0xACC90159
++ED SDCR1B, 0x00010059
++ED SDWCRC0B, 0x50874114
++ED SDWCRC1B, 0x33199B37
++ED SDWCRC2B, 0x008F2313
++ED SDWCR00B, 0x31020707
++ED SDWCR01B, 0x0017040A
++ED SDWCR10B, 0x31020707
++ED SDWCR11B, 0x0017040A
++ED SDDRVCR0B, 0x055557ff
++ED SDWCR2B, 0x30000000
++ED_OR SDPCRB, 0x00000080
++WAIT_MASK SDPCRB, 0x00000080, 0x00000080
++
++ED SDGENCNTB, 0x00002710
++WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
++ED SDMRACR0B, 0x0000003F
++
++LIST "upstream u-boot writes to SDMRA1A for both SBSC 1 and 2, which does"
++LIST "not seem to make a lot of sense..."
++ED SDMRB1, 0x00000000
++
++ED SDGENCNTB, 0x000001F4
++WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
++
++ED SDMRACR0B, 0x0000FF0A
++ED SDMRB3, 0x00000000
++ED SDGENCNTB, 0x00000032
++WAIT_MASK SDGENCNTB, 0xFFFFFFFF, 0x00000000
++
++ED SDMRACR0B, 0x00002201
++ED SDMRB1, 0x00000000
++ED SDMRACR0B, 0x00000402
++ED SDMRB1, 0x00000000
++ED SDMRACR0B, 0x00000203
++ED SDMRB1, 0x00000000
++ED SDMRB2, 0x00000000
++ED SDMRTMPCRB, 0x88800004
++ED SDMRTMPMSKB, 0x00000004
++ED RTCORB, 0xA55A0032
++ED RTCORHB, 0xA55A000C
++ED RTCSRB, 0xA55A2048
++ED_OR SDCR0B, 0x00000800
++ED_OR SDCR1B, 0x00000400
++ED ZQCCRB, 0xFFF20000
++ED_OR SDPDCR0B, 0x00030000
++ED DPHYCNT1B, 0xA5390000
++ED DPHYCNT0B, 0x00001200
++ED DPHYCNT1B, 0x07CE0000
++ED DPHYCNT0B, 0x00001247
++WAIT_MASK DPHYCNT2B, 0xFFFFFFFF, 0x07CE0000
++
++ED_AND SDPDCR0B, 0xFFFCFFFF
++
++ED FRQCRD, 0x00000B0B
++WAIT_MASK FRQCRD, 0x80000000, 0x00000000
++
++ED CPGXXCR4, 0xfffffffc
++
++LIST "Setup SCIF4 / workaround"
++EB PORT32CR, 0x12
++EB PORT33CR, 0x22
++EB PORT34CR, 0x12
++EB PORT35CR, 0x22
++
++EW 0xE6C80000, 0
++EB 0xE6C80004, 0x19
++EW 0xE6C80008, 0x0030
++EW 0xE6C80018, 0
++EW 0xE6C80030, 0x0014
++
++LIST "Magic to avoid hangs and corruption on DRAM writes."
++
++LIST "It has been observed that the system would most often hang while"
++LIST "decompressing the kernel, and if it didn't it would always write"
++LIST "a corrupt image to DRAM."
++LIST "This problem does not occur in u-boot, and the reason is that"
++LIST "u-boot performs an additional cache invalidation after setting up"
++LIST "the DRAM controller. Such an invalidation should not be necessary at"
++LIST "this point, and attempts at removing parts of the routine to arrive"
++LIST "at the minimal snippet of code necessary to avoid the DRAM stability"
++LIST "problem yielded the following:"
++
++MRC p15, 0, r0, c1, c0, 0
++MCR p15, 0, r0, c1, c0, 0
+diff --git a/arch/arm/mach-shmobile/include/mach/zboot.h b/arch/arm/mach-shmobile/include/mach/zboot.h
+index c3c4669a2d72..727cc78ac8ec 100644
+--- a/arch/arm/mach-shmobile/include/mach/zboot.h
++++ b/arch/arm/mach-shmobile/include/mach/zboot.h
+@@ -12,6 +12,9 @@
+ #ifdef CONFIG_MACH_MACKEREL
+ #define MEMORY_START 0x40000000
+ #include "mach/head-mackerel.txt"
++#elif defined(CONFIG_MACH_KZM9G) || defined(CONFIG_MACH_KZM9G_REFERENCE)
++#define MEMORY_START 0x43000000
++#include "mach/head-kzm9g.txt"
+ #else
+ #error "unsupported board."
+ #endif
+diff --git a/arch/arm/mach-shmobile/include/mach/zboot_macros.h b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
+index aa6111fbc989..14fd3d538e9a 100644
+--- a/arch/arm/mach-shmobile/include/mach/zboot_macros.h
++++ b/arch/arm/mach-shmobile/include/mach/zboot_macros.h
+@@ -62,4 +62,47 @@
+ 2 :
+ .endm
+
++/* loop until a given value has been read (with mask) */
++.macro WAIT_MASK, addr, data, cmp
++ LDR r0, 2f
++ LDR r1, 3f
++ LDR r2, 4f
++1:
++ LDR r3, [r0, #0]
++ AND r3, r1, r3
++ CMP r2, r3
++ BNE 1b
++ B 5f
++2: .long \addr
++3: .long \data
++4: .long \cmp
++5:
++.endm
++
++/* read 32-bit value from addr, "or" an immediate and write back */
++.macro ED_OR, addr, data
++ LDR r4, 1f
++ LDR r5, 2f
++ LDR r6, [r4]
++ ORR r5, r6, r5
++ STR r5, [r4]
++ B 3f
++1: .long \addr
++2: .long \data
++3:
++.endm
++
++/* read 32-bit value from addr, "and" an immediate and write back */
++.macro ED_AND, addr, data
++ LDR r4, 1f
++ LDR r5, 2f
++ LDR r6, [r4]
++ AND r5, r6, r5
++ STR r5, [r4]
++ B 3f
++1: .long \addr
++2: .long \data
++3:
++.endm
++
+ #endif /* __ZBOOT_MACRO_H */
+--
+2.1.2
+
diff --git a/patches.renesas/0223-ARM-shmobile-lager-Add-VIN1-SoC-camera-support.patch b/patches.renesas/0223-ARM-shmobile-lager-Add-VIN1-SoC-camera-support.patch
new file mode 100644
index 00000000000000..32a42564e26a9e
--- /dev/null
+++ b/patches.renesas/0223-ARM-shmobile-lager-Add-VIN1-SoC-camera-support.patch
@@ -0,0 +1,141 @@
+From f9511459c1288c40f860520b8df6b85f0a95482a Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Fri, 27 Dec 2013 15:44:04 +0400
+Subject: ARM: shmobile: lager: Add VIN1 SoC camera support
+
+This adds VIN1 SoC camera along with ADV7180 subdevice support to Lager.
+VIN0 camera is not registered because it has ADV7612 I2C subdevice
+which is not supported yet.
+
+Changes in V2:
+* made lager_add_vin_device function static.
+
+Changes in V3:
+* capitalized ARM in the subject.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 094a804aa6943de0e9939e1c48341e87be93b3d2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 76 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 76 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index f20c10a18543..c5643e1d647a 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -27,6 +27,7 @@
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/sh_mmcif.h>
+ #include <linux/pinctrl/machine.h>
++#include <linux/platform_data/camera-rcar.h>
+ #include <linux/platform_data/gpio-rcar.h>
+ #include <linux/platform_data/rcar-du.h>
+ #include <linux/platform_device.h>
+@@ -39,6 +40,7 @@
+ #include <mach/common.h>
+ #include <mach/irqs.h>
+ #include <mach/r8a7790.h>
++#include <media/soc_camera.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <linux/mtd/partitions.h>
+@@ -291,6 +293,62 @@ static const struct resource qspi_resources[] __initconst = {
+ DEFINE_RES_IRQ(gic_spi(184)),
+ };
+
++/* VIN */
++static const struct resource vin_resources[] __initconst = {
++ /* VIN0 */
++ DEFINE_RES_MEM(0xe6ef0000, 0x1000),
++ DEFINE_RES_IRQ(gic_spi(188)),
++ /* VIN1 */
++ DEFINE_RES_MEM(0xe6ef1000, 0x1000),
++ DEFINE_RES_IRQ(gic_spi(189)),
++};
++
++static void __init lager_add_vin_device(unsigned idx,
++ struct rcar_vin_platform_data *pdata)
++{
++ struct platform_device_info vin_info = {
++ .parent = &platform_bus,
++ .name = "r8a7790-vin",
++ .id = idx,
++ .res = &vin_resources[idx * 2],
++ .num_res = 2,
++ .dma_mask = DMA_BIT_MASK(32),
++ .data = pdata,
++ .size_data = sizeof(*pdata),
++ };
++
++ BUG_ON(idx > 1);
++
++ platform_device_register_full(&vin_info);
++}
++
++#define LAGER_CAMERA(idx, name, addr, pdata, flag) \
++static struct i2c_board_info i2c_cam##idx##_device = { \
++ I2C_BOARD_INFO(name, addr), \
++}; \
++ \
++static struct rcar_vin_platform_data vin##idx##_pdata = { \
++ .flags = flag, \
++}; \
++ \
++static struct soc_camera_link cam##idx##_link = { \
++ .bus_id = idx, \
++ .board_info = &i2c_cam##idx##_device, \
++ .i2c_adapter_id = 2, \
++ .module_name = name, \
++ .priv = pdata, \
++}
++
++/* Camera 0 is not currently supported due to adv7612 support missing */
++LAGER_CAMERA(1, "adv7180", 0x20, NULL, RCAR_VIN_BT656);
++
++static void __init lager_add_camera1_device(void)
++{
++ platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
++ &cam1_link, sizeof(cam1_link));
++ lager_add_vin_device(1, &vin1_pdata);
++}
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -319,6 +377,22 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ "eth_rmii", "eth"),
+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790",
+ "intc_irq0", "intc"),
++ /* VIN0 */
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
++ "vin0_data24", "vin0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
++ "vin0_sync", "vin0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
++ "vin0_field", "vin0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
++ "vin0_clkenb", "vin0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.0", "pfc-r8a7790",
++ "vin0_clk", "vin0"),
++ /* VIN1 */
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
++ "vin1_data8", "vin1"),
++ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
++ "vin1_clk", "vin1"),
+ };
+
+ static void __init lager_add_standard_devices(void)
+@@ -368,6 +442,8 @@ static void __init lager_add_standard_devices(void)
+ &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
+ platform_device_register_data(&platform_bus, "gpio-regulator", gpio_regulator_idx++,
+ &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
++
++ lager_add_camera1_device();
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0224-ARM-shmobile-kzm9d-Use-common-clock-framework.patch b/patches.renesas/0224-ARM-shmobile-kzm9d-Use-common-clock-framework.patch
new file mode 100644
index 00000000000000..51636a937ad8c5
--- /dev/null
+++ b/patches.renesas/0224-ARM-shmobile-kzm9d-Use-common-clock-framework.patch
@@ -0,0 +1,45 @@
+From 2ce7cca86459fb56b33451ab0a3076242c4f353a Mon Sep 17 00:00:00 2001
+From: Takashi Yoshii <takasi-y@ops.dti.ne.jp>
+Date: Tue, 8 Oct 2013 14:34:03 +0900
+Subject: ARM: shmobile: kzm9d: Use common clock framework
+
+Use common clock framework version of clock
+ drivers/clk/shmobile/clk-emev2.c
+instead of sh-clkfwk version
+ arch/arm/mach-shmobile/clock-emev2.c
+when it is configured as a part of multi-platform.
+
+Signed-off-by: Takashi Yoshii <takasi-y@ops.dti.ne.jp>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit ef5ecd1f20de2d1919714f029f5016bf6d061e66)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-kzm9d-reference.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-kzm9d-reference.c b/arch/arm/mach-shmobile/board-kzm9d-reference.c
+index 054d8d5c8fc1..853003c8988a 100644
+--- a/arch/arm/mach-shmobile/board-kzm9d-reference.c
++++ b/arch/arm/mach-shmobile/board-kzm9d-reference.c
+@@ -20,15 +20,14 @@
+
+ #include <linux/init.h>
+ #include <linux/of_platform.h>
++#include <linux/clk-provider.h>
+ #include <mach/emev2.h>
+ #include <mach/common.h>
+ #include <asm/mach/arch.h>
+
+ static void __init kzm9d_add_standard_devices(void)
+ {
+- if (!IS_ENABLED(CONFIG_COMMON_CLK))
+- emev2_clock_init();
+-
++ of_clk_init(NULL);
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0225-ARM-shmobile-lager-Make-spi_flash_data-const.patch b/patches.renesas/0225-ARM-shmobile-lager-Make-spi_flash_data-const.patch
new file mode 100644
index 00000000000000..8b681169b7604d
--- /dev/null
+++ b/patches.renesas/0225-ARM-shmobile-lager-Make-spi_flash_data-const.patch
@@ -0,0 +1,29 @@
+From 5d1b0b6919a209bf614cd632c959f86d571ff9a4 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 3 Jan 2014 16:48:48 +0100
+Subject: ARM: shmobile: lager: Make spi_flash_data const
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d422c451a9795c7a10c3ae1ab7ca87ce7518546b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index c5643e1d647a..aa8f1d915865 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -265,7 +265,7 @@ static struct mtd_partition spi_flash_part[] = {
+ },
+ };
+
+-static struct flash_platform_data spi_flash_data = {
++static const struct flash_platform_data spi_flash_data = {
+ .name = "m25p80",
+ .parts = spi_flash_part,
+ .nr_parts = ARRAY_SIZE(spi_flash_part),
+--
+2.1.2
+
diff --git a/patches.renesas/0226-ARM-shmobile-lager-Add-SATA-support.patch b/patches.renesas/0226-ARM-shmobile-lager-Add-SATA-support.patch
new file mode 100644
index 00000000000000..8a6fdffd6c796a
--- /dev/null
+++ b/patches.renesas/0226-ARM-shmobile-lager-Add-SATA-support.patch
@@ -0,0 +1,57 @@
+From d1b57a4fa24216294e160b0b4f38b0707e57794f Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 19 Dec 2013 21:57:23 +0400
+Subject: ARM: shmobile: lager: Add SATA support
+
+This adds SATA support to Lager board. Only SATA1 port is available.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: resolved trivial conflicts]
+[horms+renesas@verge.net.au: capitalised "ARM" in subject]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 1e0d2c495316862fa3da73150ee86ba30c9faf0c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index aa8f1d915865..8dde4462f600 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -349,6 +349,21 @@ static void __init lager_add_camera1_device(void)
+ lager_add_vin_device(1, &vin1_pdata);
+ }
+
++/* SATA1 */
++static const struct resource sata1_resources[] __initconst = {
++ DEFINE_RES_MEM(0xee500000, 0x2000),
++ DEFINE_RES_IRQ(gic_spi(106)),
++};
++
++static const struct platform_device_info sata1_info __initconst = {
++ .parent = &platform_bus,
++ .name = "sata-r8a7790",
++ .id = 1,
++ .res = sata1_resources,
++ .num_res = ARRAY_SIZE(sata1_resources),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -444,6 +459,8 @@ static void __init lager_add_standard_devices(void)
+ &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
+
+ lager_add_camera1_device();
++
++ platform_device_register_full(&sata1_info);
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0227-ARM-shmobile-koelsch-Add-SATA0-support.patch b/patches.renesas/0227-ARM-shmobile-koelsch-Add-SATA0-support.patch
new file mode 100644
index 00000000000000..2073dfc54e0854
--- /dev/null
+++ b/patches.renesas/0227-ARM-shmobile-koelsch-Add-SATA0-support.patch
@@ -0,0 +1,56 @@
+From fc32ac31759f9a319b399f1d82169c36462c5cbd Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 9 Jan 2014 19:23:22 +0400
+Subject: ARM: shmobile: koelsch: Add SATA0 support
+
+This adds SATA0 support to Koelsch board.
+SATA1 is not available since its pinmux
+configuration is fixed to PCIe.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4fc0a0b93f178c0b077201ab70a53e1be6a69054)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index de7cc64b1f37..2ab5c75ba2c2 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -148,6 +148,21 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
+ .nbuttons = ARRAY_SIZE(gpio_buttons),
+ };
+
++/* SATA0 */
++static const struct resource sata0_resources[] __initconst = {
++ DEFINE_RES_MEM(0xee300000, 0x2000),
++ DEFINE_RES_IRQ(gic_spi(105)),
++};
++
++static const struct platform_device_info sata0_info __initconst = {
++ .parent = &platform_bus,
++ .name = "sata-r8a7791",
++ .id = 0,
++ .res = sata0_resources,
++ .num_res = ARRAY_SIZE(sata0_resources),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ /* DU */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
+@@ -192,6 +207,8 @@ static void __init koelsch_add_standard_devices(void)
+ sizeof(koelsch_keys_pdata));
+
+ koelsch_add_du_device();
++
++ platform_device_register_full(&sata0_info);
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0228-ARM-shmobile-ape6evm-Conditionally-select-SMSC_PHY.patch b/patches.renesas/0228-ARM-shmobile-ape6evm-Conditionally-select-SMSC_PHY.patch
new file mode 100644
index 00000000000000..130a22a6b7b263
--- /dev/null
+++ b/patches.renesas/0228-ARM-shmobile-ape6evm-Conditionally-select-SMSC_PHY.patch
@@ -0,0 +1,37 @@
+From 97ea497808fda65d694c22abe57c1e625024c63a Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 15:23:47 +0900
+Subject: ARM: shmobile: ape6evm: Conditionally select SMSC_PHY
+
+The ape6evm board uses has an SMSC911X ethernet controller which uses an
+SMSC phy. Select SMSC_PHY for ape6evm if SMSC911X is enabled to make use of the
+SMSC-specific phy driver rather than relying on the generic phy driver.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9edaca863ea6807aca7bb8aa5c7791f7387f6022)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 96ebc05a0d9b..2fbdf53809b0 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -156,11 +156,13 @@ comment "Renesas ARM SoCs Board Type"
+ config MACH_APE6EVM
+ bool "APE6EVM board"
+ depends on ARCH_R8A73A4
++ select SMSC_PHY if SMSC911X
+ select USE_OF
+
+ config MACH_APE6EVM_REFERENCE
+ bool "APE6EVM board - Reference Device Tree Implementation"
+ depends on ARCH_R8A73A4
++ select SMSC_PHY if SMSC911X
+ select USE_OF
+ ---help---
+ Use reference implementation of APE6EVM board support
+--
+2.1.2
+
diff --git a/patches.renesas/0229-ARM-shmobile-armadillo800eva-Conditionally-select-SM.patch b/patches.renesas/0229-ARM-shmobile-armadillo800eva-Conditionally-select-SM.patch
new file mode 100644
index 00000000000000..42f78f8527272f
--- /dev/null
+++ b/patches.renesas/0229-ARM-shmobile-armadillo800eva-Conditionally-select-SM.patch
@@ -0,0 +1,39 @@
+From 8dfbca9b5cd32182d5f2bfcdf1c4a8da1b00264f Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 15:55:49 +0900
+Subject: ARM: shmobile: armadillo800eva: Conditionally select SMSC_PHY
+
+The armadillo800eva board uses has an SH ethernet controller which uses an
+SMSC phy. Select SMSC_PHY for koelsch if SH_ETH is enabled to make use of the
+SMSC-specific phy driver rather than relying on the generic phy driver.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 6a517b114d007a35fc264ef16b09db35548f0290)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 2fbdf53809b0..be7aec02be30 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -184,6 +184,7 @@ config MACH_ARMADILLO800EVA
+ depends on ARCH_R8A7740
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SH_ETH
+ select SND_SOC_WM8978 if SND_SIMPLE_CARD
+ select USE_OF
+
+@@ -192,6 +193,7 @@ config MACH_ARMADILLO800EVA_REFERENCE
+ depends on ARCH_R8A7740
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SH_ETH
+ select SND_SOC_WM8978 if SND_SIMPLE_CARD
+ select USE_OF
+ ---help---
+--
+2.1.2
+
diff --git a/patches.renesas/0230-ARM-shmobile-bockw-Sort-Kconfig-node-s-selections.patch b/patches.renesas/0230-ARM-shmobile-bockw-Sort-Kconfig-node-s-selections.patch
new file mode 100644
index 00000000000000..cc71aedfbf2d98
--- /dev/null
+++ b/patches.renesas/0230-ARM-shmobile-bockw-Sort-Kconfig-node-s-selections.patch
@@ -0,0 +1,33 @@
+From 506dd28366213f8f3455c98ae0f8f464dd42038f Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 16:40:32 +0900
+Subject: ARM: shmobile: bockw: Sort Kconfig node's selections
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 2b2fd2755182d43e149259330c7b1fe0aa3243d6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index be7aec02be30..055b0b819719 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -207,11 +207,11 @@ config MACH_BOCKW
+ bool "BOCK-W platform"
+ depends on ARCH_R8A7778
+ select ARCH_REQUIRE_GPIOLIB
+- select RENESAS_INTC_IRQPIN
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
+- select USE_OF
++ select RENESAS_INTC_IRQPIN
+ select SND_SOC_AK4554 if SND_SIMPLE_CARD
+ select SND_SOC_AK4642 if SND_SIMPLE_CARD
++ select USE_OF
+
+ config MACH_BOCKW_REFERENCE
+ bool "BOCK-W - Reference Device Tree Implementation"
+--
+2.1.2
+
diff --git a/patches.renesas/0231-ARM-shmobile-r8a7779-Wait-for-status-on-selected-MST.patch b/patches.renesas/0231-ARM-shmobile-r8a7779-Wait-for-status-on-selected-MST.patch
new file mode 100644
index 00000000000000..59172ecf63e0c3
--- /dev/null
+++ b/patches.renesas/0231-ARM-shmobile-r8a7779-Wait-for-status-on-selected-MST.patch
@@ -0,0 +1,57 @@
+From 2632c11ee1416998150d68f9bfc21ae05d0c8970 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Sat, 14 Dec 2013 16:23:52 +0100
+Subject: ARM: shmobile: r8a7779: Wait for status on selected MSTP clocks
+
+When enabling some of the module clocks by clearing stop bits in the
+MSTP control registers, the CPG requires waiting for the status
+registers to signal that the clocks have started. Failure to do so will
+result in returning from the clk_enable() call with the clock
+potentially still disabled, leading to various race conditions and
+difficult to debug errors.
+
+Enable status wait for all the r8a7779 MSTP clocks that report their
+status.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 017410f686b8d9928ce30e4eb146175ea672f4c9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7779.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
+index f1fb89b76786..93a562531d53 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7779.c
++++ b/arch/arm/mach-shmobile/clock-r8a7779.c
+@@ -127,16 +127,16 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */
+ [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */
+ [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */
+- [MSTP120] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 20, 0), /* VIN3 */
+- [MSTP116] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 16, 0), /* PCIe */
+- [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */
+- [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */
+- [MSTP110] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 10, 0), /* VIN0 */
+- [MSTP109] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 9, 0), /* VIN1 */
+- [MSTP108] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 8, 0), /* VIN2 */
+- [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */
+- [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */
+- [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */
++ [MSTP120] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 20, MSTPSR1, 0), /* VIN3 */
++ [MSTP116] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 16, MSTPSR1, 0), /* PCIe */
++ [MSTP115] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 15, MSTPSR1, 0), /* SATA */
++ [MSTP114] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 14, MSTPSR1, 0), /* Ether */
++ [MSTP110] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 10, MSTPSR1, 0), /* VIN0 */
++ [MSTP109] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 9, MSTPSR1, 0), /* VIN1 */
++ [MSTP108] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 8, MSTPSR1, 0), /* VIN2 */
++ [MSTP103] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 3, MSTPSR1, 0), /* DU */
++ [MSTP101] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 1, MSTPSR1, 0), /* USB2 */
++ [MSTP100] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 0, MSTPSR1, 0), /* USB0/1 */
+ [MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */
+ [MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */
+ [MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */
+--
+2.1.2
+
diff --git a/patches.renesas/0232-ARM-shmobile-r8a7790-Wait-for-status-on-all-MSTP-clo.patch b/patches.renesas/0232-ARM-shmobile-r8a7790-Wait-for-status-on-all-MSTP-clo.patch
new file mode 100644
index 00000000000000..e9265fd029b9ee
--- /dev/null
+++ b/patches.renesas/0232-ARM-shmobile-r8a7790-Wait-for-status-on-all-MSTP-clo.patch
@@ -0,0 +1,158 @@
+From a8c1317bc014c63db7eca0f52020891653bcc71b Mon Sep 17 00:00:00 2001
+From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
+Date: Sat, 14 Dec 2013 16:23:53 +0100
+Subject: ARM: shmobile: r8a7790: Wait for status on all MSTP clocks
+
+When enabling a module clock by clearing its bit in the MSTP control
+register, the CPG requires waiting for the status register to signal
+that the clock has started. Failure to do so will result in returning
+from the clk_enable() call with the clock potentially still disabled,
+leading to various race conditions and difficult to debug errors.
+
+Enable status wait for all MSTP clocks on the r8a7790.
+
+Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit cb9ec3adf882688831cdc9e7b84bb388f215f8ce)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 115 ++++++++++++++++++---------------
+ 1 file changed, 62 insertions(+), 53 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index f44987a92ad4..a028f96ad1b0 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -43,17 +43,26 @@
+ * see "p1 / 2" on R8A7790_CLOCK_ROOT() below
+ */
+
+-#define CPG_BASE 0xe6150000
+-#define CPG_LEN 0x1000
+-
+-#define SMSTPCR1 0xe6150134
+-#define SMSTPCR2 0xe6150138
+-#define SMSTPCR3 0xe615013c
+-#define SMSTPCR5 0xe6150144
+-#define SMSTPCR7 0xe615014c
+-#define SMSTPCR8 0xe6150990
+-#define SMSTPCR9 0xe6150994
+-#define SMSTPCR10 0xe6150998
++#define CPG_BASE 0xe6150000
++#define CPG_LEN 0x1000
++
++#define SMSTPCR1 0xe6150134
++#define SMSTPCR2 0xe6150138
++#define SMSTPCR3 0xe615013c
++#define SMSTPCR5 0xe6150144
++#define SMSTPCR7 0xe615014c
++#define SMSTPCR8 0xe6150990
++#define SMSTPCR9 0xe6150994
++#define SMSTPCR10 0xe6150998
++
++#define MSTPSR1 IOMEM(0xe6150038)
++#define MSTPSR2 IOMEM(0xe6150040)
++#define MSTPSR3 IOMEM(0xe6150048)
++#define MSTPSR5 IOMEM(0xe615003c)
++#define MSTPSR7 IOMEM(0xe61501c4)
++#define MSTPSR8 IOMEM(0xe61509a0)
++#define MSTPSR9 IOMEM(0xe61509a4)
++#define MSTPSR10 IOMEM(0xe61509a8)
+
+ #define SDCKCR 0xE6150074
+ #define SD2CKCR 0xE6150078
+@@ -199,48 +208,48 @@ enum {
+ };
+
+ static struct clk mstp_clks[MSTP_NR] = {
+- [MSTP1015] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 15, 0), /* SSI0 */
+- [MSTP1014] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 14, 0), /* SSI1 */
+- [MSTP1013] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 13, 0), /* SSI2 */
+- [MSTP1012] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 12, 0), /* SSI3 */
+- [MSTP1011] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 11, 0), /* SSI4 */
+- [MSTP1010] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 10, 0), /* SSI5 */
+- [MSTP1009] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 9, 0), /* SSI6 */
+- [MSTP1008] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 8, 0), /* SSI7 */
+- [MSTP1007] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 7, 0), /* SSI8 */
+- [MSTP1006] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 6, 0), /* SSI9 */
+- [MSTP1005] = SH_CLK_MSTP32(&p_clk, SMSTPCR10, 5, 0), /* SSI ALL */
+- [MSTP931] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 31, 0), /* I2C0 */
+- [MSTP930] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 30, 0), /* I2C1 */
+- [MSTP929] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 29, 0), /* I2C2 */
+- [MSTP928] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 28, 0), /* I2C3 */
+- [MSTP917] = SH_CLK_MSTP32(&qspi_clk, SMSTPCR9, 17, 0), /* QSPI */
+- [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
+- [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
+- [MSTP725] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 25, 0), /* LVDS1 */
+- [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */
+- [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */
+- [MSTP722] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 22, 0), /* DU2 */
+- [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
+- [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
+- [MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
+- [MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
+- [MSTP704] = SH_CLK_MSTP32(&mp_clk, SMSTPCR7, 4, 0), /* HSUSB */
+- [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */
+- [MSTP315] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* MMC0 */
+- [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* SDHI0 */
+- [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_SD1], SMSTPCR3, 13, 0), /* SDHI1 */
+- [MSTP312] = SH_CLK_MSTP32(&div6_clks[DIV6_SD2], SMSTPCR3, 12, 0), /* SDHI2 */
+- [MSTP311] = SH_CLK_MSTP32(&div6_clks[DIV6_SD3], SMSTPCR3, 11, 0), /* SDHI3 */
+- [MSTP305] = SH_CLK_MSTP32(&div6_clks[DIV6_MMC1], SMSTPCR3, 5, 0), /* MMC1 */
+- [MSTP304] = SH_CLK_MSTP32(&cp_clk, SMSTPCR3, 4, 0), /* TPU0 */
+- [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
+- [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */
+- [MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */
+- [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
+- [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
+- [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
+- [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */
++ [MSTP1015] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 15, MSTPSR10, 0), /* SSI0 */
++ [MSTP1014] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 14, MSTPSR10, 0), /* SSI1 */
++ [MSTP1013] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 13, MSTPSR10, 0), /* SSI2 */
++ [MSTP1012] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 12, MSTPSR10, 0), /* SSI3 */
++ [MSTP1011] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 11, MSTPSR10, 0), /* SSI4 */
++ [MSTP1010] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 10, MSTPSR10, 0), /* SSI5 */
++ [MSTP1009] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 9, MSTPSR10, 0), /* SSI6 */
++ [MSTP1008] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 8, MSTPSR10, 0), /* SSI7 */
++ [MSTP1007] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 7, MSTPSR10, 0), /* SSI8 */
++ [MSTP1006] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 6, MSTPSR10, 0), /* SSI9 */
++ [MSTP1005] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 5, MSTPSR10, 0), /* SSI ALL */
++ [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
++ [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
++ [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
++ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
++ [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
++ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
++ [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
++ [MSTP725] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 25, MSTPSR7, 0), /* LVDS1 */
++ [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
++ [MSTP723] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 23, MSTPSR7, 0), /* DU1 */
++ [MSTP722] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 22, MSTPSR7, 0), /* DU2 */
++ [MSTP721] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 21, MSTPSR7, 0), /* SCIF0 */
++ [MSTP720] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 20, MSTPSR7, 0), /* SCIF1 */
++ [MSTP717] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 17, MSTPSR7, 0), /* HSCIF0 */
++ [MSTP716] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 16, MSTPSR7, 0), /* HSCIF1 */
++ [MSTP704] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 4, MSTPSR7, 0), /* HSUSB */
++ [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
++ [MSTP315] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, MSTPSR3, 0), /* MMC0 */
++ [MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
++ [MSTP313] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD1], SMSTPCR3, 13, MSTPSR3, 0), /* SDHI1 */
++ [MSTP312] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD2], SMSTPCR3, 12, MSTPSR3, 0), /* SDHI2 */
++ [MSTP311] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD3], SMSTPCR3, 11, MSTPSR3, 0), /* SDHI3 */
++ [MSTP305] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_MMC1], SMSTPCR3, 5, MSTPSR3, 0), /* MMC1 */
++ [MSTP304] = SH_CLK_MSTP32_STS(&cp_clk, SMSTPCR3, 4, MSTPSR3, 0), /* TPU0 */
++ [MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
++ [MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
++ [MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
++ [MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
++ [MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
++ [MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
++ [MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
+ };
+
+ static struct clk_lookup lookups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0233-ARM-shmobile-r8a7791-Add-I2C-clocks.patch b/patches.renesas/0233-ARM-shmobile-r8a7791-Add-I2C-clocks.patch
new file mode 100644
index 00000000000000..3c9ed6200ae166
--- /dev/null
+++ b/patches.renesas/0233-ARM-shmobile-r8a7791-Add-I2C-clocks.patch
@@ -0,0 +1,59 @@
+From 3c9d63e8c6a5bc9a760190781fce4356007ba1e4 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Fri, 27 Dec 2013 15:27:38 +0400
+Subject: ARM: shmobile: r8a7791: Add I2C clocks
+
+This adds I2C[0-5] clock support to R8A7791 SoC.
+
+Changes in V2:
+* Capitalized ARM in the subject.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 106c0e8fa3a2f7a40d25583e193e34af3861564d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index f5461262ee25..fe4a774b6211 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -122,6 +122,7 @@ static struct clk *main_clks[] = {
+
+ /* MSTP */
+ enum {
++ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
+ MSTP813,
+ MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
+ MSTP719, MSTP718, MSTP715, MSTP714,
+@@ -133,6 +134,12 @@ enum {
+ };
+
+ static struct clk mstp_clks[MSTP_NR] = {
++ [MSTP931] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 31, 0), /* I2C0 */
++ [MSTP930] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 30, 0), /* I2C1 */
++ [MSTP929] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 29, 0), /* I2C2 */
++ [MSTP928] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 28, 0), /* I2C3 */
++ [MSTP927] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 27, 0), /* I2C4 */
++ [MSTP925] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 25, 0), /* I2C5 */
+ [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
+ [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
+ [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */
+@@ -194,6 +201,12 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.4", &mstp_clks[MSTP927]),
++ CLKDEV_DEV_ID("i2c-rcar_gen2.5", &mstp_clks[MSTP925]),
+ CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */
+ };
+
+--
+2.1.2
+
diff --git a/patches.renesas/0234-ARM-shmobile-r8a7791-Add-VIN-clocks.patch b/patches.renesas/0234-ARM-shmobile-r8a7791-Add-VIN-clocks.patch
new file mode 100644
index 00000000000000..3359209c684601
--- /dev/null
+++ b/patches.renesas/0234-ARM-shmobile-r8a7791-Add-VIN-clocks.patch
@@ -0,0 +1,80 @@
+From 2656932494c3f1beb04a7958bf940ef3b78f146e Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Fri, 27 Dec 2013 15:57:50 +0400
+Subject: ARM: shmobile: r8a7791: Add VIN clocks
+
+This adds VIN[0-2] clock support to R8A7791 SoC.
+
+Changes in V2:
+* none.
+
+Changes in V3:
+* capitalized ARM in the subject.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5f3fbe63b39923294cfd4bce84ab16948467d30f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index fe4a774b6211..191ad606860c 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -103,6 +103,7 @@ SH_FIXED_RATIO_CLK_SET(hp_clk, pll1_clk, 1, 12);
+ SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24);
+ SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024));
+ SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
++SH_FIXED_RATIO_CLK_SET(zg_clk, pll1_clk, 1, 3);
+ SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3);
+
+ static struct clk *main_clks[] = {
+@@ -117,6 +118,7 @@ static struct clk *main_clks[] = {
+ &rclk_clk,
+ &mp_clk,
+ &cp_clk,
++ &zg_clk,
+ &zx_clk,
+ };
+
+@@ -124,6 +126,7 @@ static struct clk *main_clks[] = {
+ enum {
+ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
+ MSTP813,
++ MSTP811, MSTP810, MSTP809,
+ MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
+ MSTP719, MSTP718, MSTP715, MSTP714,
+ MSTP522,
+@@ -141,6 +144,9 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP927] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 27, 0), /* I2C4 */
+ [MSTP925] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 25, 0), /* I2C5 */
+ [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
++ [MSTP811] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 11, 0), /* VIN0 */
++ [MSTP810] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 10, 0), /* VIN1 */
++ [MSTP809] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 9, 0), /* VIN2 */
+ [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
+ [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */
+ [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */
+@@ -172,6 +178,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("pll1", &pll1_clk),
+ CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk),
+ CLKDEV_CON_ID("pll3", &pll3_clk),
++ CLKDEV_CON_ID("zg", &zg_clk),
+ CLKDEV_CON_ID("hp", &hp_clk),
+ CLKDEV_CON_ID("p", &p_clk),
+ CLKDEV_CON_ID("rclk", &rclk_clk),
+@@ -208,6 +215,9 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("i2c-rcar_gen2.4", &mstp_clks[MSTP927]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.5", &mstp_clks[MSTP925]),
+ CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */
++ CLKDEV_DEV_ID("r8a7791-vin.0", &mstp_clks[MSTP811]),
++ CLKDEV_DEV_ID("r8a7791-vin.1", &mstp_clks[MSTP810]),
++ CLKDEV_DEV_ID("r8a7791-vin.2", &mstp_clks[MSTP809]),
+ };
+
+ #define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
+--
+2.1.2
+
diff --git a/patches.renesas/0235-ARM-shmobile-Remove-duplicate-shmobile_invalidate_st.patch b/patches.renesas/0235-ARM-shmobile-Remove-duplicate-shmobile_invalidate_st.patch
new file mode 100644
index 00000000000000..2a74e41219d056
--- /dev/null
+++ b/patches.renesas/0235-ARM-shmobile-Remove-duplicate-shmobile_invalidate_st.patch
@@ -0,0 +1,29 @@
+From c7d0114a9d9b59ae6c3ed1d7f882d94c8c7aa8b0 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Fri, 3 Jan 2014 16:48:47 +0100
+Subject: ARM: shmobile: Remove duplicate shmobile_invalidate_start()
+ declaration
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 891fa525dc29cbed3ef0b74d5e0ab2fb5233f9a6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/include/mach/common.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
+index e31980590eb4..cb8e32deb2a3 100644
+--- a/arch/arm/mach-shmobile/include/mach/common.h
++++ b/arch/arm/mach-shmobile/include/mach/common.h
+@@ -25,7 +25,6 @@ extern int shmobile_smp_apmu_boot_secondary(unsigned int cpu,
+ struct task_struct *idle);
+ extern void shmobile_smp_apmu_cpu_die(unsigned int cpu);
+ extern int shmobile_smp_apmu_cpu_kill(unsigned int cpu);
+-extern void shmobile_invalidate_start(void);
+ struct clk;
+ extern int shmobile_clk_init(void);
+ extern void shmobile_handle_irq_intc(struct pt_regs *);
+--
+2.1.2
+
diff --git a/patches.renesas/0236-ARM-shmobile-r8a7779-Remove-unused-clock-constants.patch b/patches.renesas/0236-ARM-shmobile-r8a7779-Remove-unused-clock-constants.patch
new file mode 100644
index 00000000000000..d05b1fc4a1d62e
--- /dev/null
+++ b/patches.renesas/0236-ARM-shmobile-r8a7779-Remove-unused-clock-constants.patch
@@ -0,0 +1,38 @@
+From f1dae1c435d14297697fa934997cfd2b7204f89c Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Wed, 8 Jan 2014 13:34:39 +0900
+Subject: ARM: shmobile: r8a7779: Remove unused clock constants
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+(cherry picked from commit d690f4681ceddeb3f077c661a19af0b8e0411ae7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7779.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
+index 93a562531d53..8e403ae0c7b2 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7779.c
++++ b/arch/arm/mach-shmobile/clock-r8a7779.c
+@@ -47,17 +47,10 @@
+
+ #define MD(nr) BIT(nr)
+
+-#define FRQMR IOMEM(0xffc80014)
+ #define MSTPCR0 IOMEM(0xffc80030)
+ #define MSTPCR1 IOMEM(0xffc80034)
+ #define MSTPCR3 IOMEM(0xffc8003c)
+ #define MSTPSR1 IOMEM(0xffc80044)
+-#define MSTPSR4 IOMEM(0xffc80048)
+-#define MSTPSR6 IOMEM(0xffc8004c)
+-#define MSTPCR4 IOMEM(0xffc80050)
+-#define MSTPCR5 IOMEM(0xffc80054)
+-#define MSTPCR6 IOMEM(0xffc80058)
+-#define MSTPCR7 IOMEM(0xffc80040)
+
+ #define MODEMR 0xffcc0020
+
+--
+2.1.2
+
diff --git a/patches.renesas/0237-ARM-shmobile-emev2-Use-__initconst-for-const-init-de.patch b/patches.renesas/0237-ARM-shmobile-emev2-Use-__initconst-for-const-init-de.patch
new file mode 100644
index 00000000000000..fabc99127c3812
--- /dev/null
+++ b/patches.renesas/0237-ARM-shmobile-emev2-Use-__initconst-for-const-init-de.patch
@@ -0,0 +1,35 @@
+From acd1dd5870a0c0cce50faeb546bc36205819347a Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Fri, 27 Dec 2013 12:14:08 +0900
+Subject: ARM: shmobile: emev2: Use __initconst for const init definition
+
+__initconst must be used instead of __initdata for
+const init definitions.
+
+This problem was introduced by 3d5de27174955702 ("mach-shmobile: Emma
+Mobile EV2 DT support V3") in v3.4-rc7.
+
+Reported-by: Fengguang Wu <fengguang.wu@intel.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d24d1780c340777942061ef3445edcf228e8d35b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/setup-emev2.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c
+index c8f2a1a69a52..c71d667007b8 100644
+--- a/arch/arm/mach-shmobile/setup-emev2.c
++++ b/arch/arm/mach-shmobile/setup-emev2.c
+@@ -58,7 +58,7 @@ static void __init emev2_add_standard_devices_dt(void)
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+ }
+
+-static const char *emev2_boards_compat_dt[] __initdata = {
++static const char *emev2_boards_compat_dt[] __initconst = {
+ "renesas,emev2",
+ NULL,
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0238-ARM-shmobile-r8a7791-Wait-for-status-on-all-MSTP-clo.patch b/patches.renesas/0238-ARM-shmobile-r8a7791-Wait-for-status-on-all-MSTP-clo.patch
new file mode 100644
index 00000000000000..9ef0e05a57f0f8
--- /dev/null
+++ b/patches.renesas/0238-ARM-shmobile-r8a7791-Wait-for-status-on-all-MSTP-clo.patch
@@ -0,0 +1,111 @@
+From e3c402240b19c64d55dc5865e7377809380f27c7 Mon Sep 17 00:00:00 2001
+From: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
+Date: Wed, 8 Jan 2014 08:54:46 +0100
+Subject: ARM: shmobile: r8a7791: Wait for status on all MSTP clocks
+
+When enabling a module clock by clearing its bit in the MSTP control
+register, the CPG requires waiting for the status register to signal
+that the clock has started. Failure to do so will result in returning
+from the clk_enable() call with the clock potentially still disabled,
+leading to various race conditions and difficult to debug errors.
+
+Enable status wait for all MSTP clocks on the r8a7791.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit dd6fc76d2f61e732a14f3592bdd83c2c0b7d2dcc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 68 +++++++++++++++++++---------------
+ 1 file changed, 38 insertions(+), 30 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index 191ad606860c..1074ba4c3817 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -59,6 +59,14 @@
+ #define SMSTPCR10 0xE6150998
+ #define SMSTPCR11 0xE615099C
+
++#define MSTPSR1 IOMEM(0xe6150038)
++#define MSTPSR2 IOMEM(0xe6150040)
++#define MSTPSR5 IOMEM(0xe615003c)
++#define MSTPSR7 IOMEM(0xe61501c4)
++#define MSTPSR8 IOMEM(0xe61509a0)
++#define MSTPSR9 IOMEM(0xe61509a4)
++#define MSTPSR11 IOMEM(0xe61509ac)
++
+ #define MODEMR 0xE6160060
+ #define SDCKCR 0xE6150074
+ #define SD2CKCR 0xE6150078
+@@ -137,36 +145,36 @@ enum {
+ };
+
+ static struct clk mstp_clks[MSTP_NR] = {
+- [MSTP931] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 31, 0), /* I2C0 */
+- [MSTP930] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 30, 0), /* I2C1 */
+- [MSTP929] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 29, 0), /* I2C2 */
+- [MSTP928] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 28, 0), /* I2C3 */
+- [MSTP927] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 27, 0), /* I2C4 */
+- [MSTP925] = SH_CLK_MSTP32(&p_clk, SMSTPCR9, 25, 0), /* I2C5 */
+- [MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */
+- [MSTP811] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 11, 0), /* VIN0 */
+- [MSTP810] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 10, 0), /* VIN1 */
+- [MSTP809] = SH_CLK_MSTP32(&zg_clk, SMSTPCR8, 9, 0), /* VIN2 */
+- [MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */
+- [MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */
+- [MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */
+- [MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */
+- [MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
+- [MSTP719] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 19, 0), /* SCIF2 */
+- [MSTP718] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 18, 0), /* SCIF3 */
+- [MSTP715] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 15, 0), /* SCIF4 */
+- [MSTP714] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 14, 0), /* SCIF5 */
+- [MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */
+- [MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */
+- [MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */
+- [MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */
+- [MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
+- [MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
+- [MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
+- [MSTP1105] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 5, 0), /* SCIFA3 */
+- [MSTP1106] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 6, 0), /* SCIFA4 */
+- [MSTP1107] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 7, 0), /* SCIFA5 */
+- [MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */
++ [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
++ [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
++ [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
++ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
++ [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
++ [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
++ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
++ [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
++ [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
++ [MSTP809] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 9, MSTPSR8, 0), /* VIN2 */
++ [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
++ [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
++ [MSTP723] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 23, MSTPSR7, 0), /* DU1 */
++ [MSTP721] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 21, MSTPSR7, 0), /* SCIF0 */
++ [MSTP720] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 20, MSTPSR7, 0), /* SCIF1 */
++ [MSTP719] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 19, MSTPSR7, 0), /* SCIF2 */
++ [MSTP718] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 18, MSTPSR7, 0), /* SCIF3 */
++ [MSTP715] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 15, MSTPSR7, 0), /* SCIF4 */
++ [MSTP714] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 14, MSTPSR7, 0), /* SCIF5 */
++ [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
++ [MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
++ [MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
++ [MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
++ [MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
++ [MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
++ [MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
++ [MSTP1105] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 5, MSTPSR11, 0), /* SCIFA3 */
++ [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA4 */
++ [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA5 */
++ [MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
+ };
+
+ static struct clk_lookup lookups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0239-ARM-shmobile-r8a7790-add-Audio-DMAC-clock.patch b/patches.renesas/0239-ARM-shmobile-r8a7790-add-Audio-DMAC-clock.patch
new file mode 100644
index 00000000000000..741e02fdd9ffa9
--- /dev/null
+++ b/patches.renesas/0239-ARM-shmobile-r8a7790-add-Audio-DMAC-clock.patch
@@ -0,0 +1,48 @@
+From 8c8ba12b5ea2b98e04d800e79bbede1cfc2fd1ca Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 7 Jan 2014 22:08:40 -0800
+Subject: ARM: shmobile: r8a7790: add Audio DMAC clock
+
+Audio DMAC can be controlled via sh-dma-engine
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit f5b2947e4a6589f07d485ca149d606283294979f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index a028f96ad1b0..58f3dcf322fd 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -201,6 +201,7 @@ enum {
+ MSTP717, MSTP716,
+ MSTP704,
+ MSTP522,
++ MSTP502, MSTP501,
+ MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
+ MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
+ MSTP124,
+@@ -236,6 +237,8 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP716] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 16, MSTPSR7, 0), /* HSCIF1 */
+ [MSTP704] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 4, MSTPSR7, 0), /* HSUSB */
+ [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
++ [MSTP502] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 2, MSTPSR5, 0), /* Audio-DMAC low */
++ [MSTP501] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 1, MSTPSR5, 0), /* Audio-DMAC hi */
+ [MSTP315] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_MMC0], SMSTPCR3, 15, MSTPSR3, 0), /* MMC0 */
+ [MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
+ [MSTP313] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD1], SMSTPCR3, 13, MSTPSR3, 0), /* SDHI1 */
+@@ -311,6 +314,8 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
+ CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
++ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP502]),
++ CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP501]),
+ CLKDEV_DEV_ID("ee200000.mmc", &mstp_clks[MSTP315]),
+ CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
+ CLKDEV_DEV_ID("ee100000.sd", &mstp_clks[MSTP314]),
+--
+2.1.2
+
diff --git a/patches.renesas/0240-ARM-shmobile-r8a7790-add-Audio-DMAC-support.patch b/patches.renesas/0240-ARM-shmobile-r8a7790-add-Audio-DMAC-support.patch
new file mode 100644
index 00000000000000..2988bed8cd5c57
--- /dev/null
+++ b/patches.renesas/0240-ARM-shmobile-r8a7790-add-Audio-DMAC-support.patch
@@ -0,0 +1,177 @@
+From 08bd27dad0340c37d6ff01bd88a01d693d17692a Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 6 Jan 2014 00:32:54 -0800
+Subject: ARM: shmobile: r8a7790: add Audio DMAC support
+
+R-Car H2 has many DMACs
+(ex SYS-DMAC, 2D-DMAC, Audio-DMAC, USB-DMAC etc)
+and, these DMAEngine needs DMA slave IDs to use it.
+
+This patch adds new DMA slave ID list for r8a7790.
+There, common part has RCAR_DMA_xxx prefix,
+and Audio DMAC part has AUDIO_DMAC_SLAVE_xxx prefix.
+
+Audio DMAC can be controlled via sh-dma-engine
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 2c578a1be846bde49cb0a916c20f526f27b59e89)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/include/mach/r8a7790.h | 25 ++++++++
+ arch/arm/mach-shmobile/setup-r8a7790.c | 90 +++++++++++++++++++++++++++
+ 2 files changed, 115 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
+index 5fbfa28b40b6..2177325af22f 100644
+--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
++++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
+@@ -3,6 +3,31 @@
+
+ #include <mach/rcar-gen2.h>
+
++/* DMA slave IDs */
++enum {
++ RCAR_DMA_SLAVE_INVALID,
++ AUDIO_DMAC_SLAVE_SSI0_TX,
++ AUDIO_DMAC_SLAVE_SSI0_RX,
++ AUDIO_DMAC_SLAVE_SSI1_TX,
++ AUDIO_DMAC_SLAVE_SSI1_RX,
++ AUDIO_DMAC_SLAVE_SSI2_TX,
++ AUDIO_DMAC_SLAVE_SSI2_RX,
++ AUDIO_DMAC_SLAVE_SSI3_TX,
++ AUDIO_DMAC_SLAVE_SSI3_RX,
++ AUDIO_DMAC_SLAVE_SSI4_TX,
++ AUDIO_DMAC_SLAVE_SSI4_RX,
++ AUDIO_DMAC_SLAVE_SSI5_TX,
++ AUDIO_DMAC_SLAVE_SSI5_RX,
++ AUDIO_DMAC_SLAVE_SSI6_TX,
++ AUDIO_DMAC_SLAVE_SSI6_RX,
++ AUDIO_DMAC_SLAVE_SSI7_TX,
++ AUDIO_DMAC_SLAVE_SSI7_RX,
++ AUDIO_DMAC_SLAVE_SSI8_TX,
++ AUDIO_DMAC_SLAVE_SSI8_RX,
++ AUDIO_DMAC_SLAVE_SSI9_TX,
++ AUDIO_DMAC_SLAVE_SSI9_RX,
++};
++
+ void r8a7790_add_standard_devices(void);
+ void r8a7790_add_dt_devices(void);
+ void r8a7790_clock_init(void);
+diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
+index 6ab37aa1e919..c4616f0698c6 100644
+--- a/arch/arm/mach-shmobile/setup-r8a7790.c
++++ b/arch/arm/mach-shmobile/setup-r8a7790.c
+@@ -24,12 +24,100 @@
+ #include <linux/platform_data/gpio-rcar.h>
+ #include <linux/platform_data/irq-renesas-irqc.h>
+ #include <linux/serial_sci.h>
++#include <linux/sh_dma.h>
+ #include <linux/sh_timer.h>
+ #include <mach/common.h>
++#include <mach/dma-register.h>
+ #include <mach/irqs.h>
+ #include <mach/r8a7790.h>
+ #include <asm/mach/arch.h>
+
++/* Audio-DMAC */
++#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \
++{ \
++ .slave_id = AUDIO_DMAC_SLAVE_## _id ##_TX, \
++ .addr = _addr + 0x8, \
++ .chcr = CHCR_TX(XMIT_SZ_32BIT), \
++ .mid_rid = t, \
++}, { \
++ .slave_id = AUDIO_DMAC_SLAVE_## _id ##_RX, \
++ .addr = _addr + 0xc, \
++ .chcr = CHCR_RX(XMIT_SZ_32BIT), \
++ .mid_rid = r, \
++}
++
++static const struct sh_dmae_slave_config r8a7790_audio_dmac_slaves[] = {
++ AUDIO_DMAC_SLAVE(SSI0, 0xec241000, 0x01, 0x02),
++ AUDIO_DMAC_SLAVE(SSI1, 0xec241040, 0x03, 0x04),
++ AUDIO_DMAC_SLAVE(SSI2, 0xec241080, 0x05, 0x06),
++ AUDIO_DMAC_SLAVE(SSI3, 0xec2410c0, 0x07, 0x08),
++ AUDIO_DMAC_SLAVE(SSI4, 0xec241100, 0x09, 0x0a),
++ AUDIO_DMAC_SLAVE(SSI5, 0xec241140, 0x0b, 0x0c),
++ AUDIO_DMAC_SLAVE(SSI6, 0xec241180, 0x0d, 0x0e),
++ AUDIO_DMAC_SLAVE(SSI7, 0xec2411c0, 0x0f, 0x10),
++ AUDIO_DMAC_SLAVE(SSI8, 0xec241200, 0x11, 0x12),
++ AUDIO_DMAC_SLAVE(SSI9, 0xec241240, 0x13, 0x14),
++};
++
++#define DMAE_CHANNEL(a, b) \
++{ \
++ .offset = (a) - 0x20, \
++ .dmars = (a) - 0x20 + 0x40, \
++ .chclr_bit = (b), \
++ .chclr_offset = 0x80 - 0x20, \
++}
++
++static const struct sh_dmae_channel r8a7790_audio_dmac_channels[] = {
++ DMAE_CHANNEL(0x8000, 0),
++ DMAE_CHANNEL(0x8080, 1),
++ DMAE_CHANNEL(0x8100, 2),
++ DMAE_CHANNEL(0x8180, 3),
++ DMAE_CHANNEL(0x8200, 4),
++ DMAE_CHANNEL(0x8280, 5),
++ DMAE_CHANNEL(0x8300, 6),
++ DMAE_CHANNEL(0x8380, 7),
++ DMAE_CHANNEL(0x8400, 8),
++ DMAE_CHANNEL(0x8480, 9),
++ DMAE_CHANNEL(0x8500, 10),
++ DMAE_CHANNEL(0x8580, 11),
++ DMAE_CHANNEL(0x8600, 12),
++};
++
++static struct sh_dmae_pdata r8a7790_audio_dmac_platform_data = {
++ .slave = r8a7790_audio_dmac_slaves,
++ .slave_num = ARRAY_SIZE(r8a7790_audio_dmac_slaves),
++ .channel = r8a7790_audio_dmac_channels,
++ .channel_num = ARRAY_SIZE(r8a7790_audio_dmac_channels),
++ .ts_low_shift = TS_LOW_SHIFT,
++ .ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
++ .ts_high_shift = TS_HI_SHIFT,
++ .ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
++ .ts_shift = dma_ts_shift,
++ .ts_shift_num = ARRAY_SIZE(dma_ts_shift),
++ .dmaor_init = DMAOR_DME,
++ .chclr_present = 1,
++ .chclr_bitwise = 1,
++};
++
++static struct resource r8a7790_audio_dmac_resources[] = {
++ /* Channel registers and DMAOR for low */
++ DEFINE_RES_MEM(0xec700020, 0x8663 - 0x20),
++ DEFINE_RES_IRQ(gic_spi(346)),
++ DEFINE_RES_NAMED(gic_spi(320), 13, NULL, IORESOURCE_IRQ),
++
++ /* Channel registers and DMAOR for hi */
++ DEFINE_RES_MEM(0xec720020, 0x8663 - 0x20), /* hi */
++ DEFINE_RES_IRQ(gic_spi(347)),
++ DEFINE_RES_NAMED(gic_spi(333), 13, NULL, IORESOURCE_IRQ),
++};
++
++#define r8a7790_register_audio_dmac(id) \
++ platform_device_register_resndata( \
++ &platform_bus, "sh-dma-engine", id, \
++ &r8a7790_audio_dmac_resources[id * 3], 3, \
++ &r8a7790_audio_dmac_platform_data, \
++ sizeof(r8a7790_audio_dmac_platform_data))
++
+ static const struct resource pfc_resources[] __initconst = {
+ DEFINE_RES_MEM(0xe6060000, 0x250),
+ };
+@@ -101,6 +189,8 @@ void __init r8a7790_pinmux_init(void)
+ r8a7790_register_i2c(1);
+ r8a7790_register_i2c(2);
+ r8a7790_register_i2c(3);
++ r8a7790_register_audio_dmac(0);
++ r8a7790_register_audio_dmac(1);
+ }
+
+ #define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \
+--
+2.1.2
+
diff --git a/patches.renesas/0241-ARM-shmobile-r8a7790-Add-VIN-clock-support.patch b/patches.renesas/0241-ARM-shmobile-r8a7790-Add-VIN-clock-support.patch
new file mode 100644
index 00000000000000..f6df00e22e22c8
--- /dev/null
+++ b/patches.renesas/0241-ARM-shmobile-r8a7790-Add-VIN-clock-support.patch
@@ -0,0 +1,54 @@
+From 1b7e08aa8f4a674f9db33d6cf118b22dc4f7cf55 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Wed, 8 Jan 2014 20:31:23 +0400
+Subject: ARM: shmobile: r8a7790: Add VIN clock support
+
+This adds VIN[0-3] clock support to R8A7790 SoC.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+[horms+renesas@verge.net.au: manually applied]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit b89dfdfad949798e1624dd2ff494bdb7ac943b04)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index 58f3dcf322fd..b2b232335ceb 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -197,6 +197,7 @@ enum {
+ MSTP931, MSTP930, MSTP929, MSTP928,
+ MSTP917,
+ MSTP813,
++ MSTP811, MSTP810, MSTP809, MSTP808,
+ MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
+ MSTP717, MSTP716,
+ MSTP704,
+@@ -226,6 +227,10 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+ [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
+ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
++ [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
++ [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
++ [MSTP809] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 9, MSTPSR8, 0), /* VIN2 */
++ [MSTP808] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 8, MSTPSR8, 0), /* VIN3 */
+ [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
+ [MSTP725] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 25, MSTPSR7, 0), /* LVDS1 */
+ [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
+@@ -312,6 +317,10 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP928]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
+ CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
++ CLKDEV_DEV_ID("r8a7790-vin.0", &mstp_clks[MSTP811]),
++ CLKDEV_DEV_ID("r8a7790-vin.1", &mstp_clks[MSTP810]),
++ CLKDEV_DEV_ID("r8a7790-vin.2", &mstp_clks[MSTP809]),
++ CLKDEV_DEV_ID("r8a7790-vin.3", &mstp_clks[MSTP808]),
+ CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP502]),
+--
+2.1.2
+
diff --git a/patches.renesas/0242-ARM-shmobile-r8a7790-Add-SATA-clocks.patch b/patches.renesas/0242-ARM-shmobile-r8a7790-Add-SATA-clocks.patch
new file mode 100644
index 00000000000000..47a65123ea9c94
--- /dev/null
+++ b/patches.renesas/0242-ARM-shmobile-r8a7790-Add-SATA-clocks.patch
@@ -0,0 +1,51 @@
+From 53bfac96de73bf08cbd70ecfa7f5724f84eccbe4 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Wed, 8 Jan 2014 20:31:25 +0400
+Subject: ARM: shmobile: r8a7790: Add SATA clocks
+
+This adds SATA[01] clock support to R8A7790 SoC.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+[horms+renesas@verge.net.au: resolved trivial conflicts]
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 64b7f9aca549db8a8bbcf68c911e9bd24efe76f7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index b2b232335ceb..f25b43a1fd73 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -196,6 +196,7 @@ enum {
+ MSTP1009, MSTP1008, MSTP1007, MSTP1006, MSTP1005,
+ MSTP931, MSTP930, MSTP929, MSTP928,
+ MSTP917,
++ MSTP815, MSTP814,
+ MSTP813,
+ MSTP811, MSTP810, MSTP809, MSTP808,
+ MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
+@@ -226,6 +227,8 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
+ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+ [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
++ [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
++ [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
+ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
+ [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
+ [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
+@@ -340,6 +343,8 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+ CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]),
++ CLKDEV_DEV_ID("sata-r8a7790.0", &mstp_clks[MSTP815]),
++ CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]),
+
+ /* ICK */
+ CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]),
+--
+2.1.2
+
diff --git a/patches.renesas/0243-ARM-shmobile-r8a7791-Add-ZS-clock.patch b/patches.renesas/0243-ARM-shmobile-r8a7791-Add-ZS-clock.patch
new file mode 100644
index 00000000000000..da224ad6d42dda
--- /dev/null
+++ b/patches.renesas/0243-ARM-shmobile-r8a7791-Add-ZS-clock.patch
@@ -0,0 +1,46 @@
+From 9a9a163109066b790377f6802c06d70373d50af3 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 9 Jan 2014 19:23:20 +0400
+Subject: ARM: shmobile: r8a7791: Add ZS clock
+
+This adds fixed ratio zs_clk to R8A7791 clocks.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5a6f994abbfde8e17671541db04399dfc4aebe62)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index 1074ba4c3817..52d7d13609ce 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -113,6 +113,7 @@ SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024));
+ SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
+ SH_FIXED_RATIO_CLK_SET(zg_clk, pll1_clk, 1, 3);
+ SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3);
++SH_FIXED_RATIO_CLK_SET(zs_clk, pll1_clk, 1, 6);
+
+ static struct clk *main_clks[] = {
+ &extal_clk,
+@@ -128,6 +129,7 @@ static struct clk *main_clks[] = {
+ &cp_clk,
+ &zg_clk,
+ &zx_clk,
++ &zs_clk,
+ };
+
+ /* MSTP */
+@@ -187,6 +189,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk),
+ CLKDEV_CON_ID("pll3", &pll3_clk),
+ CLKDEV_CON_ID("zg", &zg_clk),
++ CLKDEV_CON_ID("zs", &zs_clk),
+ CLKDEV_CON_ID("hp", &hp_clk),
+ CLKDEV_CON_ID("p", &p_clk),
+ CLKDEV_CON_ID("rclk", &rclk_clk),
+--
+2.1.2
+
diff --git a/patches.renesas/0244-ARM-shmobile-r8a7791-Add-SATA-clocks.patch b/patches.renesas/0244-ARM-shmobile-r8a7791-Add-SATA-clocks.patch
new file mode 100644
index 00000000000000..84e14b4762339b
--- /dev/null
+++ b/patches.renesas/0244-ARM-shmobile-r8a7791-Add-SATA-clocks.patch
@@ -0,0 +1,48 @@
+From 4c6b8edf97fed4a868017e82b00cda8b8d6a4d6c Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 9 Jan 2014 19:23:21 +0400
+Subject: ARM: shmobile: r8a7791: Add SATA clocks
+
+This adds SATA[01] clock support to R8A7791 SoC.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 373ababd4896d6012871f03a3f6d96083dc50610)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index 52d7d13609ce..e4e4dfac85e9 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -135,6 +135,7 @@ static struct clk *main_clks[] = {
+ /* MSTP */
+ enum {
+ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
++ MSTP815, MSTP814,
+ MSTP813,
+ MSTP811, MSTP810, MSTP809,
+ MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
+@@ -153,6 +154,8 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+ [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
+ [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
++ [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
++ [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
+ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
+ [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
+ [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
+@@ -229,6 +232,8 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("r8a7791-vin.0", &mstp_clks[MSTP811]),
+ CLKDEV_DEV_ID("r8a7791-vin.1", &mstp_clks[MSTP810]),
+ CLKDEV_DEV_ID("r8a7791-vin.2", &mstp_clks[MSTP809]),
++ CLKDEV_DEV_ID("sata-r8a7791.0", &mstp_clks[MSTP815]),
++ CLKDEV_DEV_ID("sata-r8a7791.1", &mstp_clks[MSTP814]),
+ };
+
+ #define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
+--
+2.1.2
+
diff --git a/patches.renesas/0245-ARM-shmobile-r7s72100-really-add-i2c-clocks.patch b/patches.renesas/0245-ARM-shmobile-r7s72100-really-add-i2c-clocks.patch
new file mode 100644
index 00000000000000..d83e5ea492a0f7
--- /dev/null
+++ b/patches.renesas/0245-ARM-shmobile-r7s72100-really-add-i2c-clocks.patch
@@ -0,0 +1,37 @@
+From 7375c87bc090361c28f8533e460d1f83ba3c3b5d Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Fri, 27 Dec 2013 05:15:24 +0100
+Subject: ARM: shmobile: r7s72100: really add i2c clocks
+
+Due to a merge conflict, addition of the clocks was lost. Tested with
+RIIC2 on a genmai board. Others untested but hopefully trivial enough to
+be added.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+[horms+renesas@verge.net.au: Capitalised "ARM" in subject]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 3440cb28627d7fbaf25c0d60cb9c6cf6d66d61ad)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r7s72100.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
+index e6ab0cd5b286..dd8ce87596de 100644
+--- a/arch/arm/mach-shmobile/clock-r7s72100.c
++++ b/arch/arm/mach-shmobile/clock-r7s72100.c
+@@ -176,6 +176,10 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
+
+ /* MSTP clocks */
++ CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
++ CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
++ CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
++ CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
+ CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
+
+ /* ICK */
+--
+2.1.2
+
diff --git a/patches.renesas/0246-ARM-shmobile-r8a7790-Add-PCI-USB-host-clock-support.patch b/patches.renesas/0246-ARM-shmobile-r8a7790-Add-PCI-USB-host-clock-support.patch
new file mode 100644
index 00000000000000..01f7601c4c86a0
--- /dev/null
+++ b/patches.renesas/0246-ARM-shmobile-r8a7790-Add-PCI-USB-host-clock-support.patch
@@ -0,0 +1,50 @@
+From a6650cb7dbba1fc0c4313dd21c47ac528cbb219e Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Sat, 25 Jan 2014 02:28:48 +0400
+Subject: ARM: shmobile: r8a7790: Add PCI USB host clock support
+
+This adds internal PCI USB host clock support.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 012a7069b5a10a0851584d71a1facdc40a972319)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index f25b43a1fd73..507073e9d455 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -201,7 +201,7 @@ enum {
+ MSTP811, MSTP810, MSTP809, MSTP808,
+ MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
+ MSTP717, MSTP716,
+- MSTP704,
++ MSTP704, MSTP703,
+ MSTP522,
+ MSTP502, MSTP501,
+ MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
+@@ -244,6 +244,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP717] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 17, MSTPSR7, 0), /* HSCIF0 */
+ [MSTP716] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR7, 16, MSTPSR7, 0), /* HSCIF1 */
+ [MSTP704] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 4, MSTPSR7, 0), /* HSUSB */
++ [MSTP703] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR7, 3, MSTPSR7, 0), /* EHCI */
+ [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
+ [MSTP502] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 2, MSTPSR5, 0), /* Audio-DMAC low */
+ [MSTP501] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR5, 1, MSTPSR5, 0), /* Audio-DMAC hi */
+@@ -343,6 +344,9 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+ CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]),
++ CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]),
++ CLKDEV_DEV_ID("pci-rcar-gen2.1", &mstp_clks[MSTP703]),
++ CLKDEV_DEV_ID("pci-rcar-gen2.2", &mstp_clks[MSTP703]),
+ CLKDEV_DEV_ID("sata-r8a7790.0", &mstp_clks[MSTP815]),
+ CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]),
+
+--
+2.1.2
+
diff --git a/patches.renesas/0247-ARM-shmobile-lager-Enable-VIN-along-with-ADV7180-dec.patch b/patches.renesas/0247-ARM-shmobile-lager-Enable-VIN-along-with-ADV7180-dec.patch
new file mode 100644
index 00000000000000..89182b3ca75b23
--- /dev/null
+++ b/patches.renesas/0247-ARM-shmobile-lager-Enable-VIN-along-with-ADV7180-dec.patch
@@ -0,0 +1,39 @@
+From 8ed5b0bb57d791fab8534ec3094beb39a6a7e40d Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Mon, 6 Jan 2014 18:55:41 +0400
+Subject: ARM: shmobile: lager: Enable VIN along with ADV7180 decoder in
+ defconfig
+
+This enables R-Car VIN SoC camera along with ADV7180 decoder,
+which can be found on Lager board, to lager_defconfig.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5d738332973d1b33cd9fb77062d3959d6c7e7a74)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/lager_defconfig | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
+index 883443f8f4f3..89b6e71006cb 100644
+--- a/arch/arm/configs/lager_defconfig
++++ b/arch/arm/configs/lager_defconfig
+@@ -90,6 +90,14 @@ CONFIG_RCAR_THERMAL=y
+ CONFIG_REGULATOR=y
+ CONFIG_REGULATOR_FIXED_VOLTAGE=y
+ CONFIG_REGULATOR_GPIO=y
++CONFIG_MEDIA_SUPPORT=y
++CONFIG_MEDIA_CAMERA_SUPPORT=y
++CONFIG_V4L_PLATFORM_DRIVERS=y
++CONFIG_SOC_CAMERA=y
++CONFIG_SOC_CAMERA_PLATFORM=y
++CONFIG_VIDEO_RCAR_VIN=y
++# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
++CONFIG_VIDEO_ADV7180=y
+ CONFIG_DRM=y
+ CONFIG_DRM_RCAR_DU=y
+ # CONFIG_USB_SUPPORT is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0248-ARM-shmobile-koelsch-Enable-SATA-in-defconfig.patch b/patches.renesas/0248-ARM-shmobile-koelsch-Enable-SATA-in-defconfig.patch
new file mode 100644
index 00000000000000..17f9f7edbf5966
--- /dev/null
+++ b/patches.renesas/0248-ARM-shmobile-koelsch-Enable-SATA-in-defconfig.patch
@@ -0,0 +1,40 @@
+From 7babd16f537ffde58f925a4ad56cb165d7b717d4 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 9 Jan 2014 19:23:23 +0400
+Subject: ARM: shmobile: koelsch: Enable SATA in defconfig
+
+This enables block layer, R-Car SATA and SCSI disk in koelsch_defconfig.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 7f03e3bf2bca488e1471e00b6b8b74242b065020)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/koelsch_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
+index e248f49d5549..4071e61d808f 100644
+--- a/arch/arm/configs/koelsch_defconfig
++++ b/arch/arm/configs/koelsch_defconfig
+@@ -8,7 +8,6 @@ CONFIG_SYSCTL_SYSCALL=y
+ CONFIG_EMBEDDED=y
+ CONFIG_PERF_EVENTS=y
+ CONFIG_SLAB=y
+-# CONFIG_BLOCK is not set
+ CONFIG_ARCH_SHMOBILE_LEGACY=y
+ CONFIG_ARCH_R8A7791=y
+ CONFIG_MACH_KOELSCH=y
+@@ -36,6 +35,9 @@ CONFIG_INET=y
+ CONFIG_IP_PNP=y
+ CONFIG_IP_PNP_DHCP=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_BLK_DEV_SD=y
++CONFIG_ATA=y
++CONFIG_SATA_RCAR=y
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_VENDOR_ARC is not set
+ # CONFIG_NET_CADENCE is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0249-ARM-shmobile-koelsch-Enable-DEVTMPFS_MOUNT-in-defcon.patch b/patches.renesas/0249-ARM-shmobile-koelsch-Enable-DEVTMPFS_MOUNT-in-defcon.patch
new file mode 100644
index 00000000000000..0ec7112bbc211b
--- /dev/null
+++ b/patches.renesas/0249-ARM-shmobile-koelsch-Enable-DEVTMPFS_MOUNT-in-defcon.patch
@@ -0,0 +1,33 @@
+From eb31397f2cd2df2ad30f00d18cf440de9afd3079 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Sun, 12 Jan 2014 12:15:49 +0100
+Subject: ARM: shmobile: koelsch: Enable DEVTMPFS_MOUNT in defconfig
+
+Without this, a Debian jessie nfsroot hangs early in the boot process.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+[horms+renesas@verge.net.au: resolved trivial conflict]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 9a4e2a5a11efb7734dabef77a6e1515cbfdd9f42)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/koelsch_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
+index 4071e61d808f..30157975998a 100644
+--- a/arch/arm/configs/koelsch_defconfig
++++ b/arch/arm/configs/koelsch_defconfig
+@@ -34,6 +34,8 @@ CONFIG_UNIX=y
+ CONFIG_INET=y
+ CONFIG_IP_PNP=y
+ CONFIG_IP_PNP_DHCP=y
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_ATA=y
+--
+2.1.2
+
diff --git a/patches.renesas/0250-ARM-shmobile-lager-Enable-SATA-in-defconfig.patch b/patches.renesas/0250-ARM-shmobile-lager-Enable-SATA-in-defconfig.patch
new file mode 100644
index 00000000000000..3820e11a90ed2c
--- /dev/null
+++ b/patches.renesas/0250-ARM-shmobile-lager-Enable-SATA-in-defconfig.patch
@@ -0,0 +1,32 @@
+From adba6f5501a2a077cfe65032e843071e3de46989 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Thu, 9 Jan 2014 18:24:37 +0400
+Subject: ARM: shmobile: lager: Enable SATA in defconfig
+
+This enables R-Car SATA and SCSI disk in lager_defconfig.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 0e02971e4047e61edc913c997ba9124df33d5112)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/lager_defconfig | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
+index 89b6e71006cb..ee93b8a55cf9 100644
+--- a/arch/arm/configs/lager_defconfig
++++ b/arch/arm/configs/lager_defconfig
+@@ -49,6 +49,9 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_BLK_DEV_SD=y
++CONFIG_ATA=y
++CONFIG_SATA_RCAR=y
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_CORE is not set
+ # CONFIG_NET_VENDOR_ARC is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0251-ARM-shmobile-marzen-enable-CONFIG_DEVTMPFS-in-defcon.patch b/patches.renesas/0251-ARM-shmobile-marzen-enable-CONFIG_DEVTMPFS-in-defcon.patch
new file mode 100644
index 00000000000000..7500f2de46e134
--- /dev/null
+++ b/patches.renesas/0251-ARM-shmobile-marzen-enable-CONFIG_DEVTMPFS-in-defcon.patch
@@ -0,0 +1,37 @@
+From ea5805e4e87d4c38879499525a4bd60fef2ac574 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:56:01 -0800
+Subject: ARM: shmobile: marzen: enable CONFIG_DEVTMPFS in defconfig
+
+This reverts commit 41307133da4b6f242ecbb45950b9d043c0b21b96
+("ARM: shmobile: marzen: Do not enable CONFIG_DEVTMPFS defconfig").
+
+DEVTMPFS is needed for udev.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+[horms+renesas@verge.net.au: Added subject of reverted patch to changelog]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit edcde600a0bf778d98d945bd27f51c941e35bb8c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/marzen_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
+index f21bd405cc2a..92994f7f6fd8 100644
+--- a/arch/arm/configs/marzen_defconfig
++++ b/arch/arm/configs/marzen_defconfig
+@@ -43,6 +43,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ # CONFIG_STANDALONE is not set
+ # CONFIG_PREVENT_FIRMWARE_BUILD is not set
+ # CONFIG_FW_LOADER is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0252-ARM-shmobile-mackerel-enable-CONFIG_DEVTMPFS-in-defc.patch b/patches.renesas/0252-ARM-shmobile-mackerel-enable-CONFIG_DEVTMPFS-in-defc.patch
new file mode 100644
index 00000000000000..ecc28b47268825
--- /dev/null
+++ b/patches.renesas/0252-ARM-shmobile-mackerel-enable-CONFIG_DEVTMPFS-in-defc.patch
@@ -0,0 +1,32 @@
+From 898b9552f1a16bf1f1a3ef5d09e56a969890e13f Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:56:17 -0800
+Subject: ARM: shmobile: mackerel: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 97b3fbccfae2d1fee679073f1690e2428868754c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/mackerel_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/mackerel_defconfig b/arch/arm/configs/mackerel_defconfig
+index a61e1653fc5e..57ececba2ae6 100644
+--- a/arch/arm/configs/mackerel_defconfig
++++ b/arch/arm/configs/mackerel_defconfig
+@@ -42,6 +42,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ # CONFIG_FIRMWARE_IN_KERNEL is not set
+ CONFIG_MTD=y
+ CONFIG_MTD_CONCAT=y
+--
+2.1.2
+
diff --git a/patches.renesas/0253-ARM-shmobile-lager-enable-CONFIG_DEVTMPFS-in-defconf.patch b/patches.renesas/0253-ARM-shmobile-lager-enable-CONFIG_DEVTMPFS-in-defconf.patch
new file mode 100644
index 00000000000000..f4fc79c97b1ead
--- /dev/null
+++ b/patches.renesas/0253-ARM-shmobile-lager-enable-CONFIG_DEVTMPFS-in-defconf.patch
@@ -0,0 +1,34 @@
+From 2d8f81ddddaabd34ced3e4e542729b19758e59c4 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:56:33 -0800
+Subject: ARM: shmobile: lager: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+[horms+renesas@verge.net.au: resolved trivial conflict]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 6ea8b5ff7ca2d200875ddd774faa8ca40d990d86)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/lager_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
+index ee93b8a55cf9..3e7e0aef26c9 100644
+--- a/arch/arm/configs/lager_defconfig
++++ b/arch/arm/configs/lager_defconfig
+@@ -49,6 +49,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_ATA=y
+ CONFIG_SATA_RCAR=y
+--
+2.1.2
+
diff --git a/patches.renesas/0254-ARM-shmobile-kzm9g-enable-CONFIG_DEVTMPFS-in-defconf.patch b/patches.renesas/0254-ARM-shmobile-kzm9g-enable-CONFIG_DEVTMPFS-in-defconf.patch
new file mode 100644
index 00000000000000..98aa4fc101b772
--- /dev/null
+++ b/patches.renesas/0254-ARM-shmobile-kzm9g-enable-CONFIG_DEVTMPFS-in-defconf.patch
@@ -0,0 +1,32 @@
+From 61f892a9f9e96dd5be90a36cc40cef5c4d666691 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:56:55 -0800
+Subject: ARM: shmobile: kzm9g: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 19bc39274b42052a198ae836c059652b65e2a21e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/kzm9g_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
+index 9934dbc23d64..12bd1f63c399 100644
+--- a/arch/arm/configs/kzm9g_defconfig
++++ b/arch/arm/configs/kzm9g_defconfig
+@@ -60,6 +60,8 @@ CONFIG_IRDA=y
+ CONFIG_SH_IRDA=y
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_SCSI=y
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_NETDEVICES=y
+--
+2.1.2
+
diff --git a/patches.renesas/0255-ARM-shmobile-kzm9d-enable-CONFIG_DEVTMPFS-in-defconf.patch b/patches.renesas/0255-ARM-shmobile-kzm9d-enable-CONFIG_DEVTMPFS-in-defconf.patch
new file mode 100644
index 00000000000000..c0c463e5dbdd89
--- /dev/null
+++ b/patches.renesas/0255-ARM-shmobile-kzm9d-enable-CONFIG_DEVTMPFS-in-defconf.patch
@@ -0,0 +1,32 @@
+From 89ac6eb28734a34601e0341fc55b65f8d3aef351 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:57:04 -0800
+Subject: ARM: shmobile: kzm9d: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c5aa40f8485b9b6aaeae14e5bddd5e569829ac2f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/kzm9d_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
+index e42ce3756af3..1cc330b06bf6 100644
+--- a/arch/arm/configs/kzm9d_defconfig
++++ b/arch/arm/configs/kzm9d_defconfig
+@@ -50,6 +50,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ # CONFIG_BLK_DEV is not set
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_VENDOR_BROADCOM is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0256-ARM-shmobile-genmai-enable-CONFIG_DEVTMPFS-in-defcon.patch b/patches.renesas/0256-ARM-shmobile-genmai-enable-CONFIG_DEVTMPFS-in-defcon.patch
new file mode 100644
index 00000000000000..128847fa25bcbd
--- /dev/null
+++ b/patches.renesas/0256-ARM-shmobile-genmai-enable-CONFIG_DEVTMPFS-in-defcon.patch
@@ -0,0 +1,32 @@
+From 8ce37ea5dd7f46ab8a71dde7558baf3d2135bce0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:57:24 -0800
+Subject: ARM: shmobile: genmai: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 2304de6ef7479b12fa4529c12a53cac631a2c67b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/genmai_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/genmai_defconfig b/arch/arm/configs/genmai_defconfig
+index aa0b704f48af..c56a7ff1dcd7 100644
+--- a/arch/arm/configs/genmai_defconfig
++++ b/arch/arm/configs/genmai_defconfig
+@@ -50,6 +50,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_CORE is not set
+ # CONFIG_NET_VENDOR_ARC is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0257-ARM-shmobile-bockw-enable-CONFIG_DEVTMPFS-in-defconf.patch b/patches.renesas/0257-ARM-shmobile-bockw-enable-CONFIG_DEVTMPFS-in-defconf.patch
new file mode 100644
index 00000000000000..618ff14b289757
--- /dev/null
+++ b/patches.renesas/0257-ARM-shmobile-bockw-enable-CONFIG_DEVTMPFS-in-defconf.patch
@@ -0,0 +1,35 @@
+From a4325fe514faf9a2768a495820473a1b059d0c3a Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:57:39 -0800
+Subject: ARM: shmobile: bockw: enable CONFIG_DEVTMPFS in defconfig
+
+This reverts commit e14ee5deab24200e4b70fe31a8c806f0acd3d37c
+("ARM: shmobile: bockw: Do not enable CONFIG_DEVTMPFS defconfig").
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+[horms+renesas@verge.net.au: Added subject of reverted commit to changelog]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit f921163add46d0dd8321f9d59496bbc17fb38850)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/bockw_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
+index 80cff50beb34..e816140d81c5 100644
+--- a/arch/arm/configs/bockw_defconfig
++++ b/arch/arm/configs/bockw_defconfig
+@@ -44,6 +44,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_INET_DIAG is not set
+ # CONFIG_IPV6 is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ # CONFIG_STANDALONE is not set
+ # CONFIG_PREVENT_FIRMWARE_BUILD is not set
+ # CONFIG_FW_LOADER is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0258-ARM-shmobile-armadillo-enable-CONFIG_DEVTMPFS-in-def.patch b/patches.renesas/0258-ARM-shmobile-armadillo-enable-CONFIG_DEVTMPFS-in-def.patch
new file mode 100644
index 00000000000000..33fcaeb445c579
--- /dev/null
+++ b/patches.renesas/0258-ARM-shmobile-armadillo-enable-CONFIG_DEVTMPFS-in-def.patch
@@ -0,0 +1,32 @@
+From f67d72e912ccffe918eb5219e6020fafc70e631c Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:57:49 -0800
+Subject: ARM: shmobile: armadillo: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a3b74d3e45f2e28e7c57d5c16a94b59c1a68dd09)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/armadillo800eva_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
+index 9287a62de830..065adddeee3e 100644
+--- a/arch/arm/configs/armadillo800eva_defconfig
++++ b/arch/arm/configs/armadillo800eva_defconfig
+@@ -58,6 +58,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6 is not set
+ # CONFIG_WIRELESS is not set
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ CONFIG_SCSI=y
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_MD=y
+--
+2.1.2
+
diff --git a/patches.renesas/0259-ARM-shmobile-ape6evm-enable-CONFIG_DEVTMPFS-in-defco.patch b/patches.renesas/0259-ARM-shmobile-ape6evm-enable-CONFIG_DEVTMPFS-in-defco.patch
new file mode 100644
index 00000000000000..d397825390dbb9
--- /dev/null
+++ b/patches.renesas/0259-ARM-shmobile-ape6evm-enable-CONFIG_DEVTMPFS-in-defco.patch
@@ -0,0 +1,32 @@
+From 7a8d0839cfb2d9aea4bc56617865b1a7ffca22ee Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 29 Jan 2014 16:57:59 -0800
+Subject: ARM: shmobile: ape6evm: enable CONFIG_DEVTMPFS in defconfig
+
+DEVTMPFS is needed for udev
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 0771ddff31186836f62a20c42e7958bd37f7b4ed)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/ape6evm_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/ape6evm_defconfig b/arch/arm/configs/ape6evm_defconfig
+index cb26c62dc722..bb396c0e5fda 100644
+--- a/arch/arm/configs/ape6evm_defconfig
++++ b/arch/arm/configs/ape6evm_defconfig
+@@ -48,6 +48,8 @@ CONFIG_IP_PNP_DHCP=y
+ # CONFIG_IPV6_SIT is not set
+ CONFIG_NETFILTER=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
+ # CONFIG_FW_LOADER_USER_HELPER is not set
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_CADENCE is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0260-ARM-shmobile-kzm9d-Conditionally-select-SMSC_PHY.patch b/patches.renesas/0260-ARM-shmobile-kzm9d-Conditionally-select-SMSC_PHY.patch
new file mode 100644
index 00000000000000..6ed868487f41e0
--- /dev/null
+++ b/patches.renesas/0260-ARM-shmobile-kzm9d-Conditionally-select-SMSC_PHY.patch
@@ -0,0 +1,35 @@
+From d572070dfe2694c0a96017eceabc14f5d5334d19 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 15:23:47 +0900
+Subject: ARM: shmobile: kzm9d: Conditionally select SMSC_PHY
+
+The kzm9d board uses has an SMSC911X ethernet controller which uses an
+SMSC phy. Select SMSC_PHY for kzm9d if SMSC911X is enabled to make use of the
+SMSC-specific phy driver rather than relying on the generic phy driver.
+
+This only covers the case of multiplatform kzm9d
+as there is currently no Kconfig node for non-multiplatform kzm9d.
+One could be added if desired.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 682100f59c0051e2b6f5af294da79df2419db157)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 055b0b819719..b4a42e5401a8 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -51,6 +51,7 @@ config MACH_KZM9D
+ bool "KZM9D board"
+ depends on ARCH_EMEV2
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SMSC911X
+
+ config MACH_LAGER
+ bool "Lager board"
+--
+2.1.2
+
diff --git a/patches.renesas/0261-ARM-shmobile-mackerel-Conditionally-select-SMSC_PHY.patch b/patches.renesas/0261-ARM-shmobile-mackerel-Conditionally-select-SMSC_PHY.patch
new file mode 100644
index 00000000000000..b24d410684fcbb
--- /dev/null
+++ b/patches.renesas/0261-ARM-shmobile-mackerel-Conditionally-select-SMSC_PHY.patch
@@ -0,0 +1,31 @@
+From 6c5f9da5c2e65c6fb3e66a8194c78b62002c68cf Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 15:23:47 +0900
+Subject: ARM: shmobile: mackerel: Conditionally select SMSC_PHY
+
+The mackerel board uses has an SMSC911X ethernet controller which uses an
+SMSC phy. Select SMSC_PHY for mackerel if SMSC911X is enabled to make use of the
+SMSC-specific phy driver rather than relying on the generic phy driver.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c5c2a294a4b24778cd3cab880bf05becee471edb)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index b4a42e5401a8..86f2644cc387 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -177,6 +177,7 @@ config MACH_MACKEREL
+ depends on ARCH_SH7372
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SMSC911X
+ select SND_SOC_AK4642 if SND_SIMPLE_CARD
+ select USE_OF
+
+--
+2.1.2
+
diff --git a/patches.renesas/0262-ARM-shmobile-marzen-Conditionally-select-SMSC_PHY.patch b/patches.renesas/0262-ARM-shmobile-marzen-Conditionally-select-SMSC_PHY.patch
new file mode 100644
index 00000000000000..e515a159f0844e
--- /dev/null
+++ b/patches.renesas/0262-ARM-shmobile-marzen-Conditionally-select-SMSC_PHY.patch
@@ -0,0 +1,39 @@
+From 63d4b3d3855dbc8cc57a57d2694725fb6ef2c68e Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Tue, 7 Jan 2014 15:23:47 +0900
+Subject: ARM: shmobile: marzen: Conditionally select SMSC_PHY
+
+The marzen board uses has an SMSC911X ethernet controller which uses an
+SMSC phy. Select SMSC_PHY for marzen if SMSC911X is enabled to make use of the
+SMSC-specific phy driver rather than relying on the generic phy driver.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 317af6612ee29dfcb5ae04df9c58e9f79fc8d4ff)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 86f2644cc387..d67f4b9774f6 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -250,6 +250,7 @@ config MACH_MARZEN
+ depends on ARCH_R8A7779
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SMSC911X
+ select USE_OF
+
+ config MACH_MARZEN_REFERENCE
+@@ -257,6 +258,7 @@ config MACH_MARZEN_REFERENCE
+ depends on ARCH_R8A7779
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
++ select SMSC_PHY if SMSC911X
+ select USE_OF
+ ---help---
+ Use reference implementation of Marzen board support
+--
+2.1.2
+
diff --git a/patches.renesas/0263-ARM-shmobile-lager-fix-error-return-code-check-from-.patch b/patches.renesas/0263-ARM-shmobile-lager-fix-error-return-code-check-from-.patch
new file mode 100644
index 00000000000000..7927f811e3dc67
--- /dev/null
+++ b/patches.renesas/0263-ARM-shmobile-lager-fix-error-return-code-check-from-.patch
@@ -0,0 +1,50 @@
+From bf8ed5ec6bcae9971d44937dc4b5915fa2547c4c Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Tue, 14 Jan 2014 18:43:26 +0000
+Subject: ARM: shmobile: lager: fix error return code check from clk_get()
+
+The lager_add_standard_devices() function calls clk_get() but then fails
+to check that it returns an error pointer instead of NULL on failure.
+
+This was added by 4a606af2 ("ARM: shmobile: lager-reference: Instantiate
+clkdevs for SCIF and CMT") patch in Simon Horman's renesas-boards2-for-v3.14
+tag.
+
+The issue is not serious as it does not cause a crash and seems to not be
+actually causing any issues now the other clock bugs have been fixed.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+[horms+renesas@verge.net.au: tweaked changelog]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 7a543d8124e7e23190d36e7c57d3b9c394c4e4c1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager-reference.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
+index a6e271d92af0..dc8d76b9a9f1 100644
+--- a/arch/arm/mach-shmobile/board-lager-reference.c
++++ b/arch/arm/mach-shmobile/board-lager-reference.c
+@@ -44,14 +44,14 @@ static void __init lager_add_standard_devices(void)
+
+ for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
+ clk = clk_get(NULL, scif_names[i]);
+- if (clk) {
++ if (!IS_ERR(clk)) {
+ clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
+ clk_put(clk);
+ }
+ }
+
+ clk = clk_get(NULL, "cmt0");
+- if (clk) {
++ if (!IS_ERR(clk)) {
+ clk_register_clkdev(clk, NULL, "sh_cmt.0");
+ clk_put(clk);
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0264-ARM-shmobile-koelsch-fix-error-return-code-check-fro.patch b/patches.renesas/0264-ARM-shmobile-koelsch-fix-error-return-code-check-fro.patch
new file mode 100644
index 00000000000000..4bfc11fe385277
--- /dev/null
+++ b/patches.renesas/0264-ARM-shmobile-koelsch-fix-error-return-code-check-fro.patch
@@ -0,0 +1,50 @@
+From 4e386a2f54ec540bb0da28ab0442563f0d7ad87f Mon Sep 17 00:00:00 2001
+From: Ben Dooks <ben.dooks@codethink.co.uk>
+Date: Tue, 14 Jan 2014 18:43:27 +0000
+Subject: ARM: shmobile: koelsch: fix error return code check from clk_get()
+
+The koelsch_add_standard_devices() function calls clk_get() but then fails
+to check that it returns an error pointer instead of NULL on failure.
+
+This was added by f31239ef ("ARM: shmobile: koelsch-reference:
+Instantiate clkdevs for SCIF and CMT") in Simon Horman's
+renesas-boards2-for-v3.14 tag.
+
+The issue is not serious as it does not cause a crash and seems to not be
+actually causing any issues now the other clock bugs have been fixed.
+
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+[horms+renesas@verge.net.au: tweaked changelog]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit ca1187521b78ce4f980cd1b457f8c634dd401021)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch-reference.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
+index 652b59268416..feb8d97ea2f7 100644
+--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
++++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
+@@ -45,14 +45,14 @@ static void __init koelsch_add_standard_devices(void)
+
+ for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
+ clk = clk_get(NULL, scif_names[i]);
+- if (clk) {
++ if (!IS_ERR(clk)) {
+ clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
+ clk_put(clk);
+ }
+ }
+
+ clk = clk_get(NULL, "cmt0");
+- if (clk) {
++ if (!IS_ERR(clk)) {
+ clk_register_clkdev(clk, NULL, "sh_cmt.0");
+ clk_put(clk);
+ }
+--
+2.1.2
+
diff --git a/patches.renesas/0265-ARM-shmobile-lager-Add-USBHS-support.patch b/patches.renesas/0265-ARM-shmobile-lager-Add-USBHS-support.patch
new file mode 100644
index 00000000000000..1a28084737bc18
--- /dev/null
+++ b/patches.renesas/0265-ARM-shmobile-lager-Add-USBHS-support.patch
@@ -0,0 +1,196 @@
+From 5fe073b39a005a914c0650290142642afbe27f95 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Sat, 25 Jan 2014 02:28:47 +0400
+Subject: ARM: shmobile: lager: Add USBHS support
+
+This adds USBHS PHY and registers USBHS device if the driver is enabled.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 1eabe028f8aacd7367fbdda9596cd3d64659a49f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 138 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 138 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 8dde4462f600..4a95a4593eb1 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -30,6 +30,7 @@
+ #include <linux/platform_data/camera-rcar.h>
+ #include <linux/platform_data/gpio-rcar.h>
+ #include <linux/platform_data/rcar-du.h>
++#include <linux/platform_data/usb-rcar-gen2-phy.h>
+ #include <linux/platform_device.h>
+ #include <linux/phy.h>
+ #include <linux/regulator/driver.h>
+@@ -37,6 +38,8 @@
+ #include <linux/regulator/gpio-regulator.h>
+ #include <linux/regulator/machine.h>
+ #include <linux/sh_eth.h>
++#include <linux/usb/phy.h>
++#include <linux/usb/renesas_usbhs.h>
+ #include <mach/common.h>
+ #include <mach/irqs.h>
+ #include <mach/r8a7790.h>
+@@ -364,6 +367,131 @@ static const struct platform_device_info sata1_info __initconst = {
+ .dma_mask = DMA_BIT_MASK(32),
+ };
+
++/* USBHS */
++#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
++static const struct resource usbhs_resources[] __initconst = {
++ DEFINE_RES_MEM(0xe6590000, 0x100),
++ DEFINE_RES_IRQ(gic_spi(107)),
++};
++
++struct usbhs_private {
++ struct renesas_usbhs_platform_info info;
++ struct usb_phy *phy;
++};
++
++#define usbhs_get_priv(pdev) \
++ container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
++
++static int usbhs_power_ctrl(struct platform_device *pdev,
++ void __iomem *base, int enable)
++{
++ struct usbhs_private *priv = usbhs_get_priv(pdev);
++
++ if (!priv->phy)
++ return -ENODEV;
++
++ if (enable) {
++ int retval = usb_phy_init(priv->phy);
++
++ if (!retval)
++ retval = usb_phy_set_suspend(priv->phy, 0);
++ return retval;
++ }
++
++ usb_phy_set_suspend(priv->phy, 1);
++ usb_phy_shutdown(priv->phy);
++ return 0;
++}
++
++static int usbhs_hardware_init(struct platform_device *pdev)
++{
++ struct usbhs_private *priv = usbhs_get_priv(pdev);
++ struct usb_phy *phy;
++
++ phy = usb_get_phy_dev(&pdev->dev, 0);
++ if (IS_ERR(phy))
++ return PTR_ERR(phy);
++
++ priv->phy = phy;
++ return 0;
++}
++
++static int usbhs_hardware_exit(struct platform_device *pdev)
++{
++ struct usbhs_private *priv = usbhs_get_priv(pdev);
++
++ if (!priv->phy)
++ return 0;
++
++ usb_put_phy(priv->phy);
++ priv->phy = NULL;
++ return 0;
++}
++
++static int usbhs_get_id(struct platform_device *pdev)
++{
++ return USBHS_GADGET;
++}
++
++static u32 lager_usbhs_pipe_type[] = {
++ USB_ENDPOINT_XFER_CONTROL,
++ USB_ENDPOINT_XFER_ISOC,
++ USB_ENDPOINT_XFER_ISOC,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_INT,
++ USB_ENDPOINT_XFER_INT,
++ USB_ENDPOINT_XFER_INT,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++ USB_ENDPOINT_XFER_BULK,
++};
++
++static struct usbhs_private usbhs_priv __initdata = {
++ .info = {
++ .platform_callback = {
++ .power_ctrl = usbhs_power_ctrl,
++ .hardware_init = usbhs_hardware_init,
++ .hardware_exit = usbhs_hardware_exit,
++ .get_id = usbhs_get_id,
++ },
++ .driver_param = {
++ .buswait_bwait = 4,
++ .pipe_type = lager_usbhs_pipe_type,
++ .pipe_size = ARRAY_SIZE(lager_usbhs_pipe_type),
++ },
++ }
++};
++
++static void __init lager_register_usbhs(void)
++{
++ usb_bind_phy("renesas_usbhs", 0, "usb_phy_rcar_gen2");
++ platform_device_register_resndata(&platform_bus,
++ "renesas_usbhs", -1,
++ usbhs_resources,
++ ARRAY_SIZE(usbhs_resources),
++ &usbhs_priv.info,
++ sizeof(usbhs_priv.info));
++}
++#else /* CONFIG_USB_RENESAS_USBHS_UDC */
++static inline void lager_register_usbhs(void) { }
++#endif /* CONFIG_USB_RENESAS_USBHS_UDC */
++
++/* USBHS PHY */
++static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = {
++ .chan0_pci = 0, /* Channel 0 is USBHS */
++ .chan2_pci = 1, /* Channel 2 is PCI USB */
++};
++
++static const struct resource usbhs_phy_resources[] __initconst = {
++ DEFINE_RES_MEM(0xe6590100, 0x100),
++};
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -408,6 +536,9 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ "vin1_data8", "vin1"),
+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-vin.1", "pfc-r8a7790",
+ "vin1_clk", "vin1"),
++ /* USB0 */
++ PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790",
++ "usb0", "usb0"),
+ };
+
+ static void __init lager_add_standard_devices(void)
+@@ -461,6 +592,13 @@ static void __init lager_add_standard_devices(void)
+ lager_add_camera1_device();
+
+ platform_device_register_full(&sata1_info);
++
++ platform_device_register_resndata(&platform_bus, "usb_phy_rcar_gen2",
++ -1, usbhs_phy_resources,
++ ARRAY_SIZE(usbhs_phy_resources),
++ &usbhs_phy_pdata,
++ sizeof(usbhs_phy_pdata));
++ lager_register_usbhs();
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0266-ARM-shmobile-Remove-Lager-USBHS-UDC-ifdefs.patch b/patches.renesas/0266-ARM-shmobile-Remove-Lager-USBHS-UDC-ifdefs.patch
new file mode 100644
index 00000000000000..b95e67690ddf52
--- /dev/null
+++ b/patches.renesas/0266-ARM-shmobile-Remove-Lager-USBHS-UDC-ifdefs.patch
@@ -0,0 +1,46 @@
+From 08fd6f65fe0bd9c7f77c0d9bf3b7d6d9359640ed Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 30 Jan 2014 08:10:09 +0900
+Subject: ARM: shmobile: Remove Lager USBHS UDC ifdefs
+
+Remove ifdefs to make the Lager USBHS device always present.
+This makes it more like other devices, no need to be special.
+
+Also, these ifdefs by themselves do not hurt much, but combined
+with USB Host device ifdefs that were proposed earlier we could
+basically end up with a kernel that drives VBUS incorrectly
+depending on the kernel configuration - lets not do that.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 235cda29e4d5047622ff9b82b1f0b4cb6cf95f6c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 4a95a4593eb1..fdcc868de1fa 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -368,7 +368,6 @@ static const struct platform_device_info sata1_info __initconst = {
+ };
+
+ /* USBHS */
+-#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
+ static const struct resource usbhs_resources[] __initconst = {
+ DEFINE_RES_MEM(0xe6590000, 0x100),
+ DEFINE_RES_IRQ(gic_spi(107)),
+@@ -478,9 +477,6 @@ static void __init lager_register_usbhs(void)
+ &usbhs_priv.info,
+ sizeof(usbhs_priv.info));
+ }
+-#else /* CONFIG_USB_RENESAS_USBHS_UDC */
+-static inline void lager_register_usbhs(void) { }
+-#endif /* CONFIG_USB_RENESAS_USBHS_UDC */
+
+ /* USBHS PHY */
+ static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = {
+--
+2.1.2
+
diff --git a/patches.renesas/0267-ARM-shmobile-Lager-pass-Ether-PHY-IRQ.patch b/patches.renesas/0267-ARM-shmobile-Lager-pass-Ether-PHY-IRQ.patch
new file mode 100644
index 00000000000000..fce3935ab51641
--- /dev/null
+++ b/patches.renesas/0267-ARM-shmobile-Lager-pass-Ether-PHY-IRQ.patch
@@ -0,0 +1,49 @@
+From 545c226e7992deed9123d1853e1016bcd188549a Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Tue, 4 Feb 2014 18:53:50 +0300
+Subject: ARM: shmobile: Lager: pass Ether PHY IRQ
+
+Pass Ether's PHY IRQ (which is IRQC's IRQ0) to the 'sh_eth' driver. Set the IRQ
+trigger type to be low-level as per the Micrel PHY driver's setup.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Acked-by: Magnus Damm <magnus.damm@gmail.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5812b8b2bcc35e7928c0e5616bbe35a0e97c7749)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index fdcc868de1fa..30ebd0805a34 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -22,6 +22,7 @@
+ #include <linux/gpio_keys.h>
+ #include <linux/input.h>
+ #include <linux/interrupt.h>
++#include <linux/irq.h>
+ #include <linux/kernel.h>
+ #include <linux/leds.h>
+ #include <linux/mmc/host.h>
+@@ -233,6 +234,7 @@ static const struct resource mmcif1_resources[] __initconst = {
+ /* Ether */
+ static const struct sh_eth_plat_data ether_pdata __initconst = {
+ .phy = 0x1,
++ .phy_irq = irq_pin(0),
+ .edmac_endian = EDMAC_LITTLE_ENDIAN,
+ .phy_interface = PHY_INTERFACE_MODE_RMII,
+ .ether_link_active_low = 1,
+@@ -618,6 +620,8 @@ static void __init lager_init(void)
+ {
+ lager_add_standard_devices();
+
++ irq_set_irq_type(irq_pin(0), IRQ_TYPE_LEVEL_LOW);
++
+ if (IS_ENABLED(CONFIG_PHYLIB))
+ phy_register_fixup_for_id("r8a7790-ether-ff:01",
+ lager_ksz8041_fixup);
+--
+2.1.2
+
diff --git a/patches.renesas/0268-ARM-shmobile-Koelsch-pass-Ether-PHY-IRQ.patch b/patches.renesas/0268-ARM-shmobile-Koelsch-pass-Ether-PHY-IRQ.patch
new file mode 100644
index 00000000000000..4047e676a71c8e
--- /dev/null
+++ b/patches.renesas/0268-ARM-shmobile-Koelsch-pass-Ether-PHY-IRQ.patch
@@ -0,0 +1,49 @@
+From 5915cb53ebd071e4123fae6b9bc7016fde68bd24 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Tue, 4 Feb 2014 18:55:32 +0300
+Subject: ARM: shmobile: Koelsch: pass Ether PHY IRQ
+
+Pass Ether's PHY IRQ (which is IRQC's IRQ0) to the 'sh_eth' driver. Set the IRQ
+trigger type to be low-level as per the Micrel PHY driver's setup.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Acked-by: Magnus Damm <magnus.damm@gmail.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 29d9f010d7103f2b83ce1c25999a6f3a1e57f5e2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index 2ab5c75ba2c2..1ec3b91b475c 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -23,6 +23,7 @@
+ #include <linux/gpio.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/input.h>
++#include <linux/irq.h>
+ #include <linux/kernel.h>
+ #include <linux/leds.h>
+ #include <linux/phy.h>
+@@ -92,6 +93,7 @@ static void __init koelsch_add_du_device(void)
+ /* Ether */
+ static const struct sh_eth_plat_data ether_pdata __initconst = {
+ .phy = 0x1,
++ .phy_irq = irq_pin(0),
+ .edmac_endian = EDMAC_LITTLE_ENDIAN,
+ .phy_interface = PHY_INTERFACE_MODE_RMII,
+ .ether_link_active_low = 1,
+@@ -232,6 +234,8 @@ static void __init koelsch_init(void)
+ {
+ koelsch_add_standard_devices();
+
++ irq_set_irq_type(irq_pin(0), IRQ_TYPE_LEVEL_LOW);
++
+ if (IS_ENABLED(CONFIG_PHYLIB))
+ phy_register_fixup_for_id("r8a7791-ether-ff:01",
+ koelsch_ksz8041_fixup);
+--
+2.1.2
+
diff --git a/patches.renesas/0269-ARM-shmobile-koelsch-Add-I2C-support.patch b/patches.renesas/0269-ARM-shmobile-koelsch-Add-I2C-support.patch
new file mode 100644
index 00000000000000..f1bbd77a8c9817
--- /dev/null
+++ b/patches.renesas/0269-ARM-shmobile-koelsch-Add-I2C-support.patch
@@ -0,0 +1,93 @@
+From 625fc194e833471fd38b79383d284e62a3b9a6c8 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 4 Feb 2014 22:48:20 +0400
+Subject: ARM: shmobile: koelsch: Add I2C support
+
+This adds I2C[1245] busses support to Koelsch board.
+I2C[03] do not have any slave devices connected and
+are not used because of the following:
+* I2C0 pins are multiplexed with LBSC pins;
+* I2C3 pins are multiplexed with EtherMAC and VIN0 pins.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 12c1d5a54e874f26d08fa27f13f63ef7ccf38a2a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 46 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index 1ec3b91b475c..2741dba74aaa 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -165,6 +165,38 @@ static const struct platform_device_info sata0_info __initconst = {
+ .dma_mask = DMA_BIT_MASK(32),
+ };
+
++/* I2C */
++static const struct resource i2c_resources[] __initconst = {
++ /* I2C0 */
++ DEFINE_RES_MEM(0xE6508000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(287)),
++ /* I2C1 */
++ DEFINE_RES_MEM(0xE6518000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(288)),
++ /* I2C2 */
++ DEFINE_RES_MEM(0xE6530000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(286)),
++ /* I2C3 */
++ DEFINE_RES_MEM(0xE6540000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(290)),
++ /* I2C4 */
++ DEFINE_RES_MEM(0xE6520000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(19)),
++ /* I2C5 */
++ DEFINE_RES_MEM(0xE6528000, 0x40),
++ DEFINE_RES_IRQ(gic_spi(20)),
++};
++
++static void __init koelsch_add_i2c(unsigned idx)
++{
++ unsigned res_idx = idx * 2;
++
++ BUG_ON(res_idx >= ARRAY_SIZE(i2c_resources));
++
++ platform_device_register_simple("i2c-rcar_gen2", idx,
++ i2c_resources + res_idx, 2);
++}
++
+ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ /* DU */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
+@@ -188,6 +220,15 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ /* SCIF1 (CN20: DEBUG SERIAL1) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7791",
+ "scif1_data_d", "scif1"),
++ /* I2C1 */
++ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.1", "pfc-r8a7791",
++ "i2c1_e", "i2c1"),
++ /* I2C2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.2", "pfc-r8a7791",
++ "i2c2", "i2c2"),
++ /* I2C4 */
++ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.4", "pfc-r8a7791",
++ "i2c4_c", "i2c4"),
+ };
+
+ static void __init koelsch_add_standard_devices(void)
+@@ -211,6 +252,11 @@ static void __init koelsch_add_standard_devices(void)
+ koelsch_add_du_device();
+
+ platform_device_register_full(&sata0_info);
++
++ koelsch_add_i2c(1);
++ koelsch_add_i2c(2);
++ koelsch_add_i2c(4);
++ koelsch_add_i2c(5);
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0270-ARM-shmobile-koelsch-Enable-I2C-in-defconfig.patch b/patches.renesas/0270-ARM-shmobile-koelsch-Enable-I2C-in-defconfig.patch
new file mode 100644
index 00000000000000..7fa23cee02d371
--- /dev/null
+++ b/patches.renesas/0270-ARM-shmobile-koelsch-Enable-I2C-in-defconfig.patch
@@ -0,0 +1,31 @@
+From 832bfcf55e8b312b66e0a8965a6284e69f18ea91 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Tue, 4 Feb 2014 22:48:22 +0400
+Subject: ARM: shmobile: koelsch: Enable I2C in defconfig
+
+This enables I2C support in koelsch_defconfig.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit ab44f75f1142edde5737203a0d259853f34686fb)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/koelsch_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
+index 30157975998a..c3b3c9d1d4e8 100644
+--- a/arch/arm/configs/koelsch_defconfig
++++ b/arch/arm/configs/koelsch_defconfig
+@@ -62,6 +62,8 @@ CONFIG_SH_ETH=y
+ CONFIG_SERIAL_SH_SCI=y
+ CONFIG_SERIAL_SH_SCI_NR_UARTS=20
+ CONFIG_SERIAL_SH_SCI_CONSOLE=y
++CONFIG_I2C=y
++CONFIG_I2C_RCAR=y
+ # CONFIG_HWMON is not set
+ CONFIG_THERMAL=y
+ CONFIG_RCAR_THERMAL=y
+--
+2.1.2
+
diff --git a/patches.renesas/0271-ARM-shmobile-bockw-use-wp-gpios-instead-of-WP-pin.patch b/patches.renesas/0271-ARM-shmobile-bockw-use-wp-gpios-instead-of-WP-pin.patch
new file mode 100644
index 00000000000000..9f8e24920cd2ff
--- /dev/null
+++ b/patches.renesas/0271-ARM-shmobile-bockw-use-wp-gpios-instead-of-WP-pin.patch
@@ -0,0 +1,52 @@
+From 0cbe1f20051b79e7b649af4030cd5c7edf1a7e99 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 30 Jan 2014 21:39:40 -0800
+Subject: ARM: shmobile: bockw: use wp-gpios instead of WP pin
+
+Latest Renesas Chip has some SDHI channels and the WP pin
+availability depends on its channel or HW implementation.
+Thus, this patch decides new policy whch indicates
+WP is disabled as default.
+But, we can use wp-gpios property to enable it as
+other method.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit f729dd554e9a04a55950693ea8eca0d3aaa28d22)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7778-bockw-reference.dts | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7778-bockw-reference.dts b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
+index bb62c7a906f4..06cda19dac6a 100644
+--- a/arch/arm/boot/dts/r8a7778-bockw-reference.dts
++++ b/arch/arm/boot/dts/r8a7778-bockw-reference.dts
+@@ -17,6 +17,7 @@
+ /dts-v1/;
+ #include "r8a7778.dtsi"
+ #include <dt-bindings/interrupt-controller/irq.h>
++#include <dt-bindings/gpio/gpio.h>
+
+ / {
+ model = "bockw";
+@@ -84,7 +85,7 @@
+
+ sdhi0_pins: sd0 {
+ renesas,groups = "sdhi0_data4", "sdhi0_ctrl",
+- "sdhi0_cd", "sdhi0_wp";
++ "sdhi0_cd";
+ renesas,function = "sdhi0";
+ };
+
+@@ -101,6 +102,7 @@
+ vmmc-supply = <&fixedregulator3v3>;
+ bus-width = <4>;
+ status = "okay";
++ wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>;
+ };
+
+ &hspi0 {
+--
+2.1.2
+
diff --git a/patches.renesas/0272-ARM-shmobile-Lager-USB0-cable-detection-workaround.patch b/patches.renesas/0272-ARM-shmobile-Lager-USB0-cable-detection-workaround.patch
new file mode 100644
index 00000000000000..80d049e671a938
--- /dev/null
+++ b/patches.renesas/0272-ARM-shmobile-Lager-USB0-cable-detection-workaround.patch
@@ -0,0 +1,83 @@
+From 74be9c7a78fea88c2504448fff201d44e8ec0ef9 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 30 Jan 2014 08:10:29 +0900
+Subject: ARM: shmobile: Lager USB0 cable detection workaround
+
+Add Lager board code to check the PWEN GPIO signal and refuse to
+allow probe of the USBHS driver in case of DIP misconfiguration.
+
+For correct operation Lager DIP switches SW5 and SW6 shall be
+configured in 2-3 position to enable USB Function support.
+
+If the DIP switch is configured incorrectly then the user can
+simply adjust the hardware and either reboot or use the bind interface
+to try to probe again:
+
+# echo renesas_usbhs > /sys/bus/platform/drivers/renesas_usbhs/bind
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 36be7686caa05334ca8d52df157b373a41d8d9f1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 25 ++++++++++++++++++++++---
+ 1 file changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 30ebd0805a34..6a7041f9afa6 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -408,13 +408,30 @@ static int usbhs_hardware_init(struct platform_device *pdev)
+ {
+ struct usbhs_private *priv = usbhs_get_priv(pdev);
+ struct usb_phy *phy;
++ int ret;
++
++ /* USB0 Function - use PWEN as GPIO input to detect DIP Switch SW5
++ * setting to avoid VBUS short circuit due to wrong cable.
++ * PWEN should be pulled up high if USB Function is selected by SW5
++ */
++ gpio_request_one(RCAR_GP_PIN(5, 18), GPIOF_IN, NULL); /* USB0_PWEN */
++ if (!gpio_get_value(RCAR_GP_PIN(5, 18))) {
++ pr_warn("Error: USB Function not selected - check SW5 + SW6\n");
++ ret = -ENOTSUPP;
++ goto error;
++ }
+
+ phy = usb_get_phy_dev(&pdev->dev, 0);
+- if (IS_ERR(phy))
+- return PTR_ERR(phy);
++ if (IS_ERR(phy)) {
++ ret = PTR_ERR(phy);
++ goto error;
++ }
+
+ priv->phy = phy;
+ return 0;
++ error:
++ gpio_free(RCAR_GP_PIN(5, 18));
++ return ret;
+ }
+
+ static int usbhs_hardware_exit(struct platform_device *pdev)
+@@ -426,6 +443,8 @@ static int usbhs_hardware_exit(struct platform_device *pdev)
+
+ usb_put_phy(priv->phy);
+ priv->phy = NULL;
++
++ gpio_free(RCAR_GP_PIN(5, 18));
+ return 0;
+ }
+
+@@ -536,7 +555,7 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ "vin1_clk", "vin1"),
+ /* USB0 */
+ PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790",
+- "usb0", "usb0"),
++ "usb0_ovc_vbus", "usb0"),
+ };
+
+ static void __init lager_add_standard_devices(void)
+--
+2.1.2
+
diff --git a/patches.renesas/0273-ARM-shmobile-lager-add-sound-support.patch b/patches.renesas/0273-ARM-shmobile-lager-add-sound-support.patch
new file mode 100644
index 00000000000000..4ad23ae3d45ac9
--- /dev/null
+++ b/patches.renesas/0273-ARM-shmobile-lager-add-sound-support.patch
@@ -0,0 +1,179 @@
+From 9032548b7e7ad43969dbd51d27c628fa708746da Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 13 Jan 2014 18:25:50 -0800
+Subject: ARM: shmobile: lager: add sound support
+
+This patch adds sound support for Lager board.
+But, it is using PIO transfer at this point.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+[horms+renesas@verge.net.au: resolved conflicts]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit d58922ce8cadba7e758608fef9438bc183b46b0f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 1 +
+ arch/arm/mach-shmobile/board-lager.c | 100 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 101 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index d67f4b9774f6..eb25bb9a5d4d 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -272,6 +272,7 @@ config MACH_LAGER
+ depends on ARCH_R8A7790
+ select USE_OF
+ select MICREL_PHY if SH_ETH
++ select SND_SOC_AK4642 if SND_SIMPLE_CARD
+
+ config MACH_KOELSCH
+ bool "Koelsch board"
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 6a7041f9afa6..e8242c552da1 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -20,6 +20,7 @@
+
+ #include <linux/gpio.h>
+ #include <linux/gpio_keys.h>
++#include <linux/i2c.h>
+ #include <linux/input.h>
+ #include <linux/interrupt.h>
+ #include <linux/irq.h>
+@@ -52,6 +53,20 @@
+ #include <linux/spi/flash.h>
+ #include <linux/spi/rspi.h>
+ #include <linux/spi/spi.h>
++#include <sound/rcar_snd.h>
++#include <sound/simple_card.h>
++
++/*
++ * SSI-AK4643
++ *
++ * SW1: 1: AK4643
++ * 2: CN22
++ * 3: ADV7511
++ *
++ * this command is required when playback.
++ *
++ * # amixer set "LINEOUT Mixer DACL" on
++ */
+
+ /* DU */
+ static struct rcar_du_encoder_data lager_du_encoders[] = {
+@@ -509,6 +524,77 @@ static const struct resource usbhs_phy_resources[] __initconst = {
+ DEFINE_RES_MEM(0xe6590100, 0x100),
+ };
+
++/* I2C */
++static struct i2c_board_info i2c2_devices[] = {
++ {
++ I2C_BOARD_INFO("ak4643", 0x12),
++ }
++};
++
++/* Sound */
++static struct resource rsnd_resources[] __initdata = {
++ [RSND_GEN2_SCU] = DEFINE_RES_MEM(0xec500000, 0x1000),
++ [RSND_GEN2_ADG] = DEFINE_RES_MEM(0xec5a0000, 0x100),
++ [RSND_GEN2_SSIU] = DEFINE_RES_MEM(0xec540000, 0x1000),
++ [RSND_GEN2_SSI] = DEFINE_RES_MEM(0xec541000, 0x1280),
++};
++
++static struct rsnd_ssi_platform_info rsnd_ssi[] = {
++ RSND_SSI_SET(0, 0, gic_spi(370), RSND_SSI_PLAY),
++ RSND_SSI_SET(0, 0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
++};
++
++static struct rsnd_scu_platform_info rsnd_scu[2] = {
++ /* no member at this point */
++};
++
++static struct rcar_snd_info rsnd_info = {
++ .flags = RSND_GEN2,
++ .ssi_info = rsnd_ssi,
++ .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
++ .scu_info = rsnd_scu,
++ .scu_info_nr = ARRAY_SIZE(rsnd_scu),
++};
++
++static struct asoc_simple_card_info rsnd_card_info = {
++ .name = "AK4643",
++ .card = "SSI01-AK4643",
++ .codec = "ak4642-codec.2-0012",
++ .platform = "rcar_sound",
++ .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .cpu_dai = {
++ .name = "rcar_sound",
++ .fmt = SND_SOC_DAIFMT_CBS_CFS,
++ },
++ .codec_dai = {
++ .name = "ak4642-hifi",
++ .fmt = SND_SOC_DAIFMT_CBM_CFM,
++ .sysclk = 11289600,
++ },
++};
++
++static void __init lager_add_rsnd_device(void)
++{
++ struct platform_device_info cardinfo = {
++ .parent = &platform_bus,
++ .name = "asoc-simple-card",
++ .id = -1,
++ .data = &rsnd_card_info,
++ .size_data = sizeof(struct asoc_simple_card_info),
++ .dma_mask = DMA_BIT_MASK(32),
++ };
++
++ i2c_register_board_info(2, i2c2_devices,
++ ARRAY_SIZE(i2c2_devices));
++
++ platform_device_register_resndata(
++ &platform_bus, "rcar_sound", -1,
++ rsnd_resources, ARRAY_SIZE(rsnd_resources),
++ &rsnd_info, sizeof(rsnd_info));
++
++ platform_device_register_full(&cardinfo);
++}
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -517,12 +603,24 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ "du_sync_1", "du"),
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+ "du_clk_out_0", "du"),
++ /* I2C2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar.2", "pfc-r8a7790",
++ "i2c2", "i2c2"),
+ /* SCIF0 (CN19: DEBUG SERIAL0) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
+ "scif0_data", "scif0"),
+ /* SCIF1 (CN20: DEBUG SERIAL1) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
+ "scif1_data", "scif1"),
++ /* SSI (CN17: sound) */
++ PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
++ "ssi0129_ctrl", "ssi"),
++ PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
++ "ssi0_data", "ssi"),
++ PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
++ "ssi1_data", "ssi"),
++ PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
++ "audio_clk_a", "audio_clk"),
+ /* MMCIF1 */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790",
+ "mmc1_data8", "mmc1"),
+@@ -616,6 +714,8 @@ static void __init lager_add_standard_devices(void)
+ &usbhs_phy_pdata,
+ sizeof(usbhs_phy_pdata));
+ lager_register_usbhs();
++
++ lager_add_rsnd_device();
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0274-ARM-shmobile-lager-add-sound-support-on-defconfig.patch b/patches.renesas/0274-ARM-shmobile-lager-add-sound-support-on-defconfig.patch
new file mode 100644
index 00000000000000..12b6aa4b671ae4
--- /dev/null
+++ b/patches.renesas/0274-ARM-shmobile-lager-add-sound-support-on-defconfig.patch
@@ -0,0 +1,31 @@
+From 921bd6b201d76e68860485af07e24e86fcfc0187 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 13 Jan 2014 18:26:00 -0800
+Subject: ARM: shmobile: lager: add sound support on defconfig
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 90bdadf5b05be16e7ba663ba8b9e42d20dcef861)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/lager_defconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
+index 3e7e0aef26c9..b17f48739013 100644
+--- a/arch/arm/configs/lager_defconfig
++++ b/arch/arm/configs/lager_defconfig
+@@ -105,6 +105,10 @@ CONFIG_VIDEO_RCAR_VIN=y
+ CONFIG_VIDEO_ADV7180=y
+ CONFIG_DRM=y
+ CONFIG_DRM_RCAR_DU=y
++CONFIG_SOUND=y
++CONFIG_SND=y
++CONFIG_SND_SOC=y
++CONFIG_SND_SOC_RCAR=y
+ # CONFIG_USB_SUPPORT is not set
+ CONFIG_MMC=y
+ CONFIG_MMC_SDHI=y
+--
+2.1.2
+
diff --git a/patches.renesas/0275-Revert-ARM-shmobile-marzen-Conditionally-select-SMSC.patch b/patches.renesas/0275-Revert-ARM-shmobile-marzen-Conditionally-select-SMSC.patch
new file mode 100644
index 00000000000000..ea6cd0228240e9
--- /dev/null
+++ b/patches.renesas/0275-Revert-ARM-shmobile-marzen-Conditionally-select-SMSC.patch
@@ -0,0 +1,40 @@
+From bedc61eb247902b7b27c6a5295bb598ea2e49320 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Thu, 6 Feb 2014 17:54:02 +0900
+Subject: Revert "ARM: shmobile: marzen: Conditionally select SMSC_PHY"
+
+This reverts commit 317af6612ee29dfcb5ae04df9c58e9f79fc8d4ff.
+
+This seems to prevent the board from booting now that the tree has been
+rebased on v3.14-rc1.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c73c7ff8d5b1f4ee0bb9cd7c57c37782954b2246)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index eb25bb9a5d4d..deb6dc884bf0 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -250,7 +250,6 @@ config MACH_MARZEN
+ depends on ARCH_R8A7779
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
+- select SMSC_PHY if SMSC911X
+ select USE_OF
+
+ config MACH_MARZEN_REFERENCE
+@@ -258,7 +257,6 @@ config MACH_MARZEN_REFERENCE
+ depends on ARCH_R8A7779
+ select ARCH_REQUIRE_GPIOLIB
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
+- select SMSC_PHY if SMSC911X
+ select USE_OF
+ ---help---
+ Use reference implementation of Marzen board support
+--
+2.1.2
+
diff --git a/patches.renesas/0276-ARM-shmobile-genmai-legacy-Add-RSPI-support.patch b/patches.renesas/0276-ARM-shmobile-genmai-legacy-Add-RSPI-support.patch
new file mode 100644
index 00000000000000..45722429c04ba1
--- /dev/null
+++ b/patches.renesas/0276-ARM-shmobile-genmai-legacy-Add-RSPI-support.patch
@@ -0,0 +1,86 @@
+From 20b54b0aeb02bcab6df237edd65fb9b69eaaf6c5 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:23:56 +0100
+Subject: ARM: shmobile: genmai legacy: Add RSPI support
+
+Add RSPI platform device, resources, platform data, and SPI child.
+
+On this board, only rspi4 is in use. Its bus contains a single device
+(a wm8978 audio codec).
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 664517474c4993c5d560d0e394c36583b7c99535)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-genmai.c | 44 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
+index 3e92e3c62d4c..c4064610e223 100644
+--- a/arch/arm/mach-shmobile/board-genmai.c
++++ b/arch/arm/mach-shmobile/board-genmai.c
+@@ -20,15 +20,59 @@
+
+ #include <linux/kernel.h>
+ #include <linux/platform_device.h>
++#include <linux/spi/rspi.h>
++#include <linux/spi/spi.h>
+ #include <mach/common.h>
++#include <mach/irqs.h>
+ #include <mach/r7s72100.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+
++/* RSPI */
++#define RSPI_RESOURCE(idx, baseaddr, irq) \
++static const struct resource rspi##idx##_resources[] __initconst = { \
++ DEFINE_RES_MEM(baseaddr, 0x24), \
++ DEFINE_RES_IRQ_NAMED(irq, "error"), \
++ DEFINE_RES_IRQ_NAMED(irq + 1, "rx"), \
++ DEFINE_RES_IRQ_NAMED(irq + 2, "tx"), \
++}
++
++RSPI_RESOURCE(0, 0xe800c800, gic_iid(270));
++RSPI_RESOURCE(1, 0xe800d000, gic_iid(273));
++RSPI_RESOURCE(2, 0xe800d800, gic_iid(276));
++RSPI_RESOURCE(3, 0xe800e000, gic_iid(279));
++RSPI_RESOURCE(4, 0xe800e800, gic_iid(282));
++
++static const struct rspi_plat_data rspi_pdata __initconst = {
++ .num_chipselect = 1,
++};
++
++#define r7s72100_register_rspi(idx) \
++ platform_device_register_resndata(&platform_bus, "rspi-rz", idx, \
++ rspi##idx##_resources, \
++ ARRAY_SIZE(rspi##idx##_resources), \
++ &rspi_pdata, sizeof(rspi_pdata))
++
++static const struct spi_board_info spi_info[] __initconst = {
++ {
++ .modalias = "wm8978",
++ .max_speed_hz = 5000000,
++ .bus_num = 4,
++ .chip_select = 0,
++ },
++};
++
+ static void __init genmai_add_standard_devices(void)
+ {
+ r7s72100_clock_init();
+ r7s72100_add_dt_devices();
++
++ r7s72100_register_rspi(0);
++ r7s72100_register_rspi(1);
++ r7s72100_register_rspi(2);
++ r7s72100_register_rspi(3);
++ r7s72100_register_rspi(4);
++ spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
+ }
+
+ static const char * const genmai_boards_compat_dt[] __initconst = {
+--
+2.1.2
+
diff --git a/patches.renesas/0277-ARM-shmobile-r7s72100-dtsi-Add-RSPI-nodes.patch b/patches.renesas/0277-ARM-shmobile-r7s72100-dtsi-Add-RSPI-nodes.patch
new file mode 100644
index 00000000000000..7d42936702715c
--- /dev/null
+++ b/patches.renesas/0277-ARM-shmobile-r7s72100-dtsi-Add-RSPI-nodes.patch
@@ -0,0 +1,128 @@
+From f50707e0e538412cdcc0109d01eb7fe69053c0de Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:23:59 +0100
+Subject: ARM: shmobile: r7s72100 dtsi: Add RSPI nodes
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4b18e83f5d77c783d2d2092d0015ccda5fecaa8c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r7s72100-genmai-reference.dts | 2 +-
+ arch/arm/boot/dts/r7s72100.dtsi | 75 +++++++++++++++++++++++++
+ 2 files changed, 76 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+index da19c70ed82b..0849017e9d2f 100644
+--- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
++++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+@@ -9,7 +9,7 @@
+ */
+
+ /dts-v1/;
+-/include/ "r7s72100.dtsi"
++#include "r7s72100.dtsi"
+
+ / {
+ model = "Genmai";
+diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
+index 46b82aa7dc4e..9be67a16fc6f 100644
+--- a/arch/arm/boot/dts/r7s72100.dtsi
++++ b/arch/arm/boot/dts/r7s72100.dtsi
+@@ -8,12 +8,22 @@
+ * kind, whether express or implied.
+ */
+
++#include <dt-bindings/interrupt-controller/irq.h>
++
+ / {
+ compatible = "renesas,r7s72100";
+ interrupt-parent = <&gic>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
++ aliases {
++ spi0 = &spi0;
++ spi1 = &spi1;
++ spi2 = &spi2;
++ spi3 = &spi3;
++ spi4 = &spi4;
++ };
++
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+@@ -33,4 +43,69 @@
+ reg = <0xe8201000 0x1000>,
+ <0xe8202000 0x1000>;
+ };
++
++ spi0: spi@e800c800 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800c800 0x24>;
++ interrupts = <0 238 IRQ_TYPE_LEVEL_HIGH>,
++ <0 239 IRQ_TYPE_LEVEL_HIGH>,
++ <0 240 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
++ spi1: spi@e800d000 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800d000 0x24>;
++ interrupts = <0 241 IRQ_TYPE_LEVEL_HIGH>,
++ <0 242 IRQ_TYPE_LEVEL_HIGH>,
++ <0 243 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
++ spi2: spi@e800d800 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800d800 0x24>;
++ interrupts = <0 244 IRQ_TYPE_LEVEL_HIGH>,
++ <0 245 IRQ_TYPE_LEVEL_HIGH>,
++ <0 246 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
++ spi3: spi@e800e000 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800e000 0x24>;
++ interrupts = <0 247 IRQ_TYPE_LEVEL_HIGH>,
++ <0 248 IRQ_TYPE_LEVEL_HIGH>,
++ <0 249 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
++ spi4: spi@e800e800 {
++ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
++ reg = <0xe800e800 0x24>;
++ interrupts = <0 250 IRQ_TYPE_LEVEL_HIGH>,
++ <0 251 IRQ_TYPE_LEVEL_HIGH>,
++ <0 252 IRQ_TYPE_LEVEL_HIGH>;
++ interrupt-names = "error", "rx", "tx";
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0278-ARM-shmobile-koelsch-legacy-Add-QSPI-support.patch b/patches.renesas/0278-ARM-shmobile-koelsch-legacy-Add-QSPI-support.patch
new file mode 100644
index 00000000000000..9742cbeeac3961
--- /dev/null
+++ b/patches.renesas/0278-ARM-shmobile-koelsch-legacy-Add-QSPI-support.patch
@@ -0,0 +1,124 @@
+From 1a8313127bdf45d896daa16b4dcd6ba31226c644 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:01 +0100
+Subject: ARM: shmobile: koelsch legacy: Add QSPI support
+
+Enable support for the Spansion s25fl512s SPI FLASH on the Koelsch board:
+ - Add QSPI platform device, resources, platform data, and pinmux,
+ - Add FLASH data and MTD partitions.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit bcca4e8e5b6383cea9a2b310d5a964d8db18b9c7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 64 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 64 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index 2741dba74aaa..d42637db596a 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -26,12 +26,17 @@
+ #include <linux/irq.h>
+ #include <linux/kernel.h>
+ #include <linux/leds.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
+ #include <linux/phy.h>
+ #include <linux/pinctrl/machine.h>
+ #include <linux/platform_data/gpio-rcar.h>
+ #include <linux/platform_data/rcar-du.h>
+ #include <linux/platform_device.h>
+ #include <linux/sh_eth.h>
++#include <linux/spi/flash.h>
++#include <linux/spi/rspi.h>
++#include <linux/spi/spi.h>
+ #include <mach/common.h>
+ #include <mach/irqs.h>
+ #include <mach/r8a7791.h>
+@@ -150,6 +155,55 @@ static const struct gpio_keys_platform_data koelsch_keys_pdata __initconst = {
+ .nbuttons = ARRAY_SIZE(gpio_buttons),
+ };
+
++/* QSPI */
++static const struct resource qspi_resources[] __initconst = {
++ DEFINE_RES_MEM(0xe6b10000, 0x1000),
++ DEFINE_RES_IRQ_NAMED(gic_spi(184), "mux"),
++};
++
++static const struct rspi_plat_data qspi_pdata __initconst = {
++ .num_chipselect = 1,
++};
++
++/* SPI Flash memory (Spansion S25FL512SAGMFIG11 64 MiB) */
++static struct mtd_partition spi_flash_part[] = {
++ {
++ .name = "loader",
++ .offset = 0x00000000,
++ .size = 512 * 1024,
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "bootenv",
++ .offset = MTDPART_OFS_APPEND,
++ .size = 512 * 1024,
++ .mask_flags = MTD_WRITEABLE,
++ },
++ {
++ .name = "data",
++ .offset = MTDPART_OFS_APPEND,
++ .size = MTDPART_SIZ_FULL,
++ },
++};
++
++static const struct flash_platform_data spi_flash_data = {
++ .name = "m25p80",
++ .parts = spi_flash_part,
++ .nr_parts = ARRAY_SIZE(spi_flash_part),
++ .type = "s25fl512s",
++};
++
++static const struct spi_board_info spi_info[] __initconst = {
++ {
++ .modalias = "m25p80",
++ .platform_data = &spi_flash_data,
++ .mode = SPI_MODE_0,
++ .max_speed_hz = 30000000,
++ .bus_num = 0,
++ .chip_select = 0,
++ },
++};
++
+ /* SATA0 */
+ static const struct resource sata0_resources[] __initconst = {
+ DEFINE_RES_MEM(0xee300000, 0x2000),
+@@ -214,6 +268,11 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ "eth_rmii", "eth"),
+ PIN_MAP_MUX_GROUP_DEFAULT("r8a7791-ether", "pfc-r8a7791",
+ "intc_irq0", "intc"),
++ /* QSPI */
++ PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791",
++ "qspi_ctrl", "qspi"),
++ PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7791",
++ "qspi_data4", "qspi"),
+ /* SCIF0 (CN19: DEBUG SERIAL0) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7791",
+ "scif0_data_d", "scif0"),
+@@ -248,6 +307,11 @@ static void __init koelsch_add_standard_devices(void)
+ platform_device_register_data(&platform_bus, "gpio-keys", -1,
+ &koelsch_keys_pdata,
+ sizeof(koelsch_keys_pdata));
++ platform_device_register_resndata(&platform_bus, "qspi", 0,
++ qspi_resources,
++ ARRAY_SIZE(qspi_resources),
++ &qspi_pdata, sizeof(qspi_pdata));
++ spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
+
+ koelsch_add_du_device();
+
+--
+2.1.2
+
diff --git a/patches.renesas/0279-ARM-shmobile-r8a7791-dtsi-Add-QSPI-node.patch b/patches.renesas/0279-ARM-shmobile-r8a7791-dtsi-Add-QSPI-node.patch
new file mode 100644
index 00000000000000..20cd69c68ec14a
--- /dev/null
+++ b/patches.renesas/0279-ARM-shmobile-r8a7791-dtsi-Add-QSPI-node.patch
@@ -0,0 +1,38 @@
+From bfdabacff00abc1373f4bd2f8fb4e1762253ed06 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:03 +0100
+Subject: ARM: shmobile: r8a7791 dtsi: Add QSPI node
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4d5b59cde5b900a1f4a3a07a7a7b709dac1938f9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index d5cc3626dd60..240c4ece1f0c 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -710,4 +710,16 @@
+ clock-output-names = "scifa3", "scifa4", "scifa5";
+ };
+ };
++
++ spi: spi@e6b10000 {
++ compatible = "renesas,qspi-r8a7791", "renesas,qspi";
++ reg = <0 0xe6b10000 0 0x2c>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0280-ARM-shmobile-koelsch-dts-Add-QSPI-nodes.patch b/patches.renesas/0280-ARM-shmobile-koelsch-dts-Add-QSPI-nodes.patch
new file mode 100644
index 00000000000000..ed9db87afebc1f
--- /dev/null
+++ b/patches.renesas/0280-ARM-shmobile-koelsch-dts-Add-QSPI-nodes.patch
@@ -0,0 +1,69 @@
+From 297b07d22adf627ebc5100391fb07a70b36f8aa1 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:04 +0100
+Subject: ARM: shmobile: koelsch dts: Add QSPI nodes
+
+Add pinctrl and SPI devices for QSPI on Koelsch.
+Add Spansion s25fl512s SPI FLASH and MTD partitions.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit e02ee513eed4bb780848a5cedbd4b39afb395d3e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 36 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index 74f098596b5c..d4b9bba38685 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -121,8 +121,44 @@
+ renesas,groups = "scif1_data_d";
+ renesas,function = "scif1";
+ };
++
++ qspi_pins: spi {
++ renesas,groups = "qspi_ctrl", "qspi_data4";
++ renesas,function = "qspi";
++ };
+ };
+
+ &sata0 {
+ status = "okay";
+ };
++
++&spi {
++ pinctrl-0 = <&qspi_pins>;
++ pinctrl-names = "default";
++
++ status = "okay";
++
++ flash: flash@0 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "spansion,s25fl512s";
++ reg = <0>;
++ spi-max-frequency = <30000000>;
++ m25p,fast-read;
++
++ partition@0 {
++ label = "loader";
++ reg = <0x00000000 0x00080000>;
++ read-only;
++ };
++ partition@80000 {
++ label = "bootenv";
++ reg = <0x00080000 0x00080000>;
++ read-only;
++ };
++ partition@100000 {
++ label = "data";
++ reg = <0x00100000 0x03f00000>;
++ };
++ };
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0281-ARM-shmobile-lager-legacy-Switch-QSPI-to-named-IRQs.patch b/patches.renesas/0281-ARM-shmobile-lager-legacy-Switch-QSPI-to-named-IRQs.patch
new file mode 100644
index 00000000000000..d9059fb60bf403
--- /dev/null
+++ b/patches.renesas/0281-ARM-shmobile-lager-legacy-Switch-QSPI-to-named-IRQs.patch
@@ -0,0 +1,30 @@
+From 5a2a77735877bb7052137266af4af5ae43e9c3a6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:05 +0100
+Subject: ARM: shmobile: lager legacy: Switch QSPI to named IRQs
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a70eda7e40d09b8bf1a817488a255ce907587a71)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index e8242c552da1..317574864e7b 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -310,7 +310,7 @@ static const struct spi_board_info spi_info[] __initconst = {
+ /* QSPI resource */
+ static const struct resource qspi_resources[] __initconst = {
+ DEFINE_RES_MEM(0xe6b10000, 0x1000),
+- DEFINE_RES_IRQ(gic_spi(184)),
++ DEFINE_RES_IRQ_NAMED(gic_spi(184), "mux"),
+ };
+
+ /* VIN */
+--
+2.1.2
+
diff --git a/patches.renesas/0282-ARM-shmobile-koelsch-defconfig-Enable-RSPI-and-MTD_M.patch b/patches.renesas/0282-ARM-shmobile-koelsch-defconfig-Enable-RSPI-and-MTD_M.patch
new file mode 100644
index 00000000000000..332ef4742df648
--- /dev/null
+++ b/patches.renesas/0282-ARM-shmobile-koelsch-defconfig-Enable-RSPI-and-MTD_M.patch
@@ -0,0 +1,43 @@
+From 4606290dcbe85b2fc28650e450acb024cc1c1e4e Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:02 +0100
+Subject: ARM: shmobile: koelsch defconfig: Enable RSPI and MTD_M25P80
+
+This enables support for the Spansion s25fl512s SPI FLASH on QSPI.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: resolved conflict]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 201bd5ddcd9f11bb3942a062f0e907c3edc61f87)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/koelsch_defconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
+index c3b3c9d1d4e8..95611392a20e 100644
+--- a/arch/arm/configs/koelsch_defconfig
++++ b/arch/arm/configs/koelsch_defconfig
+@@ -40,6 +40,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_ATA=y
+ CONFIG_SATA_RCAR=y
++CONFIG_MTD=y
++CONFIG_MTD_M25P80=y
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_VENDOR_ARC is not set
+ # CONFIG_NET_CADENCE is not set
+@@ -64,6 +66,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=20
+ CONFIG_SERIAL_SH_SCI_CONSOLE=y
+ CONFIG_I2C=y
+ CONFIG_I2C_RCAR=y
++CONFIG_SPI=y
++CONFIG_SPI_RSPI=y
+ # CONFIG_HWMON is not set
+ CONFIG_THERMAL=y
+ CONFIG_RCAR_THERMAL=y
+--
+2.1.2
+
diff --git a/patches.renesas/0283-ARM-shmobile-genmai-defconfig-Enable-RSPI.patch b/patches.renesas/0283-ARM-shmobile-genmai-defconfig-Enable-RSPI.patch
new file mode 100644
index 00000000000000..126fef52d13e7f
--- /dev/null
+++ b/patches.renesas/0283-ARM-shmobile-genmai-defconfig-Enable-RSPI.patch
@@ -0,0 +1,30 @@
+From bd978100d36621438ab50eea55944022717a7770 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:23:57 +0100
+Subject: ARM: shmobile: genmai defconfig: Enable RSPI
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 8f33d31ee270f2a6bcc661815a520f76565674c3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/genmai_defconfig | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/configs/genmai_defconfig b/arch/arm/configs/genmai_defconfig
+index c56a7ff1dcd7..5ee6ac0931f7 100644
+--- a/arch/arm/configs/genmai_defconfig
++++ b/arch/arm/configs/genmai_defconfig
+@@ -81,6 +81,8 @@ CONFIG_SERIAL_SH_SCI_NR_UARTS=10
+ CONFIG_SERIAL_SH_SCI_CONSOLE=y
+ # CONFIG_HW_RANDOM is not set
+ CONFIG_I2C_SH_MOBILE=y
++CONFIG_SPI=y
++CONFIG_SPI_RSPI=y
+ # CONFIG_HWMON is not set
+ CONFIG_THERMAL=y
+ CONFIG_RCAR_THERMAL=y
+--
+2.1.2
+
diff --git a/patches.renesas/0284-ARM-shmobile-genmai-Enable-r7s72100-ether.patch b/patches.renesas/0284-ARM-shmobile-genmai-Enable-r7s72100-ether.patch
new file mode 100644
index 00000000000000..58721b65ecb957
--- /dev/null
+++ b/patches.renesas/0284-ARM-shmobile-genmai-Enable-r7s72100-ether.patch
@@ -0,0 +1,61 @@
+From 1192790d47eb2b1579553bafbe9352ec14873c36 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Wed, 4 Dec 2013 13:12:20 +0900
+Subject: ARM: shmobile: genmai: Enable r7s72100-ether
+
+Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms@verge.net.au>
+(cherry picked from commit 03fec7dee502d43114f384a1588ce84a3c9bf38d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-genmai.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
+index c4064610e223..e240980cc227 100644
+--- a/arch/arm/mach-shmobile/board-genmai.c
++++ b/arch/arm/mach-shmobile/board-genmai.c
+@@ -20,6 +20,7 @@
+
+ #include <linux/kernel.h>
+ #include <linux/platform_device.h>
++#include <linux/sh_eth.h>
+ #include <linux/spi/rspi.h>
+ #include <linux/spi/spi.h>
+ #include <mach/common.h>
+@@ -28,6 +29,20 @@
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+
++/* Ether */
++static const struct sh_eth_plat_data ether_pdata __initconst = {
++ .phy = 0x00, /* PD60610 */
++ .edmac_endian = EDMAC_LITTLE_ENDIAN,
++ .phy_interface = PHY_INTERFACE_MODE_MII,
++ .no_ether_link = 1
++};
++
++static const struct resource ether_resources[] __initconst = {
++ DEFINE_RES_MEM(0xe8203000, 0x800),
++ DEFINE_RES_MEM(0xe8204800, 0x200),
++ DEFINE_RES_IRQ(gic_iid(359)),
++};
++
+ /* RSPI */
+ #define RSPI_RESOURCE(idx, baseaddr, irq) \
+ static const struct resource rspi##idx##_resources[] __initconst = { \
+@@ -67,6 +82,11 @@ static void __init genmai_add_standard_devices(void)
+ r7s72100_clock_init();
+ r7s72100_add_dt_devices();
+
++ platform_device_register_resndata(&platform_bus, "r7s72100-ether", -1,
++ ether_resources,
++ ARRAY_SIZE(ether_resources),
++ &ether_pdata, sizeof(ether_pdata));
++
+ r7s72100_register_rspi(0);
+ r7s72100_register_rspi(1);
+ r7s72100_register_rspi(2);
+--
+2.1.2
+
diff --git a/patches.renesas/0285-ARM-shmobile-Add-SDHI-devices-for-legacy-Koelsch.patch b/patches.renesas/0285-ARM-shmobile-Add-SDHI-devices-for-legacy-Koelsch.patch
new file mode 100644
index 00000000000000..a5b21777147176
--- /dev/null
+++ b/patches.renesas/0285-ARM-shmobile-Add-SDHI-devices-for-legacy-Koelsch.patch
@@ -0,0 +1,214 @@
+From 76f8106a169c91f40109918b4e83663958fedfd6 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 12 Feb 2014 13:26:21 +0900
+Subject: ARM: shmobile: Add SDHI devices for legacy Koelsch
+
+Add SDHI0, SDHI1 and SDHI2 as platform devices to the
+legacy Koelsch board code. Also include regulators that
+are needed to control VCCQ and VDD.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d12e699f44b8277b7b72b546c69948a2f20514f8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 155 +++++++++++++++++++++++++++++++++
+ 1 file changed, 155 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index d42637db596a..893d47c7d7a6 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -26,6 +26,9 @@
+ #include <linux/irq.h>
+ #include <linux/kernel.h>
+ #include <linux/leds.h>
++#include <linux/mfd/tmio.h>
++#include <linux/mmc/host.h>
++#include <linux/mmc/sh_mobile_sdhi.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/phy.h>
+@@ -33,6 +36,10 @@
+ #include <linux/platform_data/gpio-rcar.h>
+ #include <linux/platform_data/rcar-du.h>
+ #include <linux/platform_device.h>
++#include <linux/regulator/driver.h>
++#include <linux/regulator/fixed.h>
++#include <linux/regulator/gpio-regulator.h>
++#include <linux/regulator/machine.h>
+ #include <linux/sh_eth.h>
+ #include <linux/spi/flash.h>
+ #include <linux/spi/rspi.h>
+@@ -251,6 +258,103 @@ static void __init koelsch_add_i2c(unsigned idx)
+ i2c_resources + res_idx, 2);
+ }
+
++#define SDHI_REGULATOR(idx, vdd_pin, vccq_pin) \
++static struct regulator_consumer_supply vcc_sdhi##idx##_consumer = \
++ REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi." #idx); \
++ \
++static struct regulator_init_data vcc_sdhi##idx##_init_data = { \
++ .constraints = { \
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS, \
++ }, \
++ .consumer_supplies = &vcc_sdhi##idx##_consumer, \
++ .num_consumer_supplies = 1, \
++}; \
++ \
++static const struct fixed_voltage_config vcc_sdhi##idx##_info __initconst = {\
++ .supply_name = "SDHI" #idx "Vcc", \
++ .microvolts = 3300000, \
++ .gpio = vdd_pin, \
++ .enable_high = 1, \
++ .init_data = &vcc_sdhi##idx##_init_data, \
++}; \
++ \
++static struct regulator_consumer_supply vccq_sdhi##idx##_consumer = \
++ REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi." #idx); \
++ \
++static struct regulator_init_data vccq_sdhi##idx##_init_data = { \
++ .constraints = { \
++ .input_uV = 3300000, \
++ .min_uV = 1800000, \
++ .max_uV = 3300000, \
++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | \
++ REGULATOR_CHANGE_STATUS, \
++ }, \
++ .consumer_supplies = &vccq_sdhi##idx##_consumer, \
++ .num_consumer_supplies = 1, \
++}; \
++ \
++static struct gpio vccq_sdhi##idx##_gpio = \
++ { vccq_pin, GPIOF_OUT_INIT_HIGH, "vccq-sdhi" #idx }; \
++ \
++static struct gpio_regulator_state vccq_sdhi##idx##_states[] = { \
++ { .value = 1800000, .gpios = 0 }, \
++ { .value = 3300000, .gpios = 1 }, \
++}; \
++ \
++static const struct gpio_regulator_config vccq_sdhi##idx##_info __initconst = {\
++ .supply_name = "vqmmc", \
++ .gpios = &vccq_sdhi##idx##_gpio, \
++ .nr_gpios = 1, \
++ .states = vccq_sdhi##idx##_states, \
++ .nr_states = ARRAY_SIZE(vccq_sdhi##idx##_states), \
++ .type = REGULATOR_VOLTAGE, \
++ .init_data = &vccq_sdhi##idx##_init_data, \
++};
++
++SDHI_REGULATOR(0, RCAR_GP_PIN(7, 17), RCAR_GP_PIN(2, 12));
++SDHI_REGULATOR(1, RCAR_GP_PIN(7, 18), RCAR_GP_PIN(2, 13));
++SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));
++
++/* SDHI0 */
++static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
++ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
++ MMC_CAP_POWER_OFF_CARD,
++ .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
++};
++
++static struct resource sdhi0_resources[] __initdata = {
++ DEFINE_RES_MEM(0xee100000, 0x200),
++ DEFINE_RES_IRQ(gic_spi(165)),
++};
++
++/* SDHI1 */
++static struct sh_mobile_sdhi_info sdhi1_info __initdata = {
++ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
++ MMC_CAP_POWER_OFF_CARD,
++ .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
++};
++
++static struct resource sdhi1_resources[] __initdata = {
++ DEFINE_RES_MEM(0xee140000, 0x100),
++ DEFINE_RES_IRQ(gic_spi(167)),
++};
++
++/* SDHI2 */
++static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
++ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
++ MMC_CAP_POWER_OFF_CARD,
++ .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
++ TMIO_MMC_WRPROTECT_DISABLE,
++};
++
++static struct resource sdhi2_resources[] __initdata = {
++ DEFINE_RES_MEM(0xee160000, 0x100),
++ DEFINE_RES_IRQ(gic_spi(168)),
++};
++
+ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ /* DU */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7791", "pfc-r8a7791",
+@@ -288,6 +392,31 @@ static const struct pinctrl_map koelsch_pinctrl_map[] = {
+ /* I2C4 */
+ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar_gen2.4", "pfc-r8a7791",
+ "i2c4_c", "i2c4"),
++ /* SDHI0 */
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
++ "sdhi0_data4", "sdhi0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
++ "sdhi0_ctrl", "sdhi0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
++ "sdhi0_cd", "sdhi0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7791",
++ "sdhi0_wp", "sdhi0"),
++ /* SDHI2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
++ "sdhi1_data4", "sdhi1"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
++ "sdhi1_ctrl", "sdhi1"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
++ "sdhi1_cd", "sdhi1"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-r8a7791",
++ "sdhi1_wp", "sdhi1"),
++ /* SDHI2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
++ "sdhi2_data4", "sdhi2"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
++ "sdhi2_ctrl", "sdhi2"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7791",
++ "sdhi2_cd", "sdhi2"),
+ };
+
+ static void __init koelsch_add_standard_devices(void)
+@@ -321,6 +450,32 @@ static void __init koelsch_add_standard_devices(void)
+ koelsch_add_i2c(2);
+ koelsch_add_i2c(4);
+ koelsch_add_i2c(5);
++
++ platform_device_register_data(&platform_bus, "reg-fixed-voltage", 0,
++ &vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
++ platform_device_register_data(&platform_bus, "reg-fixed-voltage", 1,
++ &vcc_sdhi1_info, sizeof(struct fixed_voltage_config));
++ platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
++ &vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
++ platform_device_register_data(&platform_bus, "gpio-regulator", 0,
++ &vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
++ platform_device_register_data(&platform_bus, "gpio-regulator", 1,
++ &vccq_sdhi1_info, sizeof(struct gpio_regulator_config));
++ platform_device_register_data(&platform_bus, "gpio-regulator", 2,
++ &vccq_sdhi2_info, sizeof(struct gpio_regulator_config));
++
++ platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
++ sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
++ &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
++
++ platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
++ sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
++ &sdhi1_info, sizeof(struct sh_mobile_sdhi_info));
++
++ platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
++ sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
++ &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
++
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0286-ARM-shmobile-lager-add-SDHI0-2-support.patch b/patches.renesas/0286-ARM-shmobile-lager-add-SDHI0-2-support.patch
new file mode 100644
index 00000000000000..04a4829cd87c49
--- /dev/null
+++ b/patches.renesas/0286-ARM-shmobile-lager-add-SDHI0-2-support.patch
@@ -0,0 +1,123 @@
+From 8e9afeb19a7d975b86bf01a1d7fd417a58798ba8 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 12 Feb 2014 20:29:24 -0800
+Subject: ARM: shmobile: lager: add SDHI0/2 support
+
+SDHI0 (CN8) needs JP/SW settings
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 40e6a51e0cf44e944eed29697eb849140bf8258f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 64 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 64 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 317574864e7b..90d7e812d97b 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -26,8 +26,10 @@
+ #include <linux/irq.h>
+ #include <linux/kernel.h>
+ #include <linux/leds.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 <linux/pinctrl/machine.h>
+ #include <linux/platform_data/camera-rcar.h>
+ #include <linux/platform_data/gpio-rcar.h>
+@@ -68,6 +70,19 @@
+ * # amixer set "LINEOUT Mixer DACL" on
+ */
+
++/*
++ * SDHI0 (CN8)
++ *
++ * JP3: pin1
++ * SW20: pin1
++
++ * GP5_24: 1: VDD 3.3V (defult)
++ * 0: VDD 0.0V
++ * GP5_29: 1: VccQ 3.3V (defult)
++ * 0: VccQ 1.8V
++ *
++ */
++
+ /* DU */
+ static struct rcar_du_encoder_data lager_du_encoders[] = {
+ {
+@@ -595,6 +610,34 @@ static void __init lager_add_rsnd_device(void)
+ platform_device_register_full(&cardinfo);
+ }
+
++/* SDHI0 */
++static struct sh_mobile_sdhi_info sdhi0_info __initdata = {
++ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
++ MMC_CAP_POWER_OFF_CARD,
++ .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
++ TMIO_MMC_WRPROTECT_DISABLE,
++};
++
++static struct resource sdhi0_resources[] __initdata = {
++ DEFINE_RES_MEM(0xee100000, 0x200),
++ DEFINE_RES_IRQ(gic_spi(165)),
++};
++
++/* SDHI2 */
++static struct sh_mobile_sdhi_info sdhi2_info __initdata = {
++ .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
++ MMC_CAP_POWER_OFF_CARD,
++ .tmio_caps2 = MMC_CAP2_NO_MULTI_READ,
++ .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
++ TMIO_MMC_WRPROTECT_DISABLE,
++};
++
++static struct resource sdhi2_resources[] __initdata = {
++ DEFINE_RES_MEM(0xee140000, 0x100),
++ DEFINE_RES_IRQ(gic_spi(167)),
++};
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -612,6 +655,20 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* SCIF1 (CN20: DEBUG SERIAL1) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
+ "scif1_data", "scif1"),
++ /* SDHI0 */
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
++ "sdhi0_data4", "sdhi0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
++ "sdhi0_ctrl", "sdhi0"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7790",
++ "sdhi0_cd", "sdhi0"),
++ /* SDHI2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
++ "sdhi2_data4", "sdhi2"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
++ "sdhi2_ctrl", "sdhi2"),
++ PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.2", "pfc-r8a7790",
++ "sdhi2_cd", "sdhi2"),
+ /* SSI (CN17: sound) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar_sound", "pfc-r8a7790",
+ "ssi0129_ctrl", "ssi"),
+@@ -716,6 +773,13 @@ static void __init lager_add_standard_devices(void)
+ lager_register_usbhs();
+
+ lager_add_rsnd_device();
++
++ platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
++ sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
++ &sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
++ platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
++ sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
++ &sdhi2_info, sizeof(struct sh_mobile_sdhi_info));
+ }
+
+ /*
+--
+2.1.2
+
diff --git a/patches.renesas/0287-ARM-shmobile-lager-legacy-Add-QSPI-pinmux.patch b/patches.renesas/0287-ARM-shmobile-lager-legacy-Add-QSPI-pinmux.patch
new file mode 100644
index 00000000000000..e461c698ffcbce
--- /dev/null
+++ b/patches.renesas/0287-ARM-shmobile-lager-legacy-Add-QSPI-pinmux.patch
@@ -0,0 +1,33 @@
+From a5e489849b2ed5f73876a9899067afba05c7d917 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 11:47:28 +0100
+Subject: ARM: shmobile: lager legacy: Add QSPI pinmux
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 248deabbd4a2f4c696338536fdaad3a01f66bee7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 90d7e812d97b..72886af7b737 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -649,6 +649,11 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* I2C2 */
+ PIN_MAP_MUX_GROUP_DEFAULT("i2c-rcar.2", "pfc-r8a7790",
+ "i2c2", "i2c2"),
++ /* QSPI */
++ PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7790",
++ "qspi_ctrl", "qspi"),
++ PIN_MAP_MUX_GROUP_DEFAULT("qspi.0", "pfc-r8a7790",
++ "qspi_data4", "qspi"),
+ /* SCIF0 (CN19: DEBUG SERIAL0) */
+ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
+ "scif0_data", "scif0"),
+--
+2.1.2
+
diff --git a/patches.renesas/0288-ARM-shmobile-r8a7790-dtsi-Add-QSPI-node.patch b/patches.renesas/0288-ARM-shmobile-r8a7790-dtsi-Add-QSPI-node.patch
new file mode 100644
index 00000000000000..5d95768fda2403
--- /dev/null
+++ b/patches.renesas/0288-ARM-shmobile-r8a7790-dtsi-Add-QSPI-node.patch
@@ -0,0 +1,38 @@
+From 4b676879c228c2a96f8fb3330782f9ac19e51577 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 11:47:29 +0100
+Subject: ARM: shmobile: r8a7790 dtsi: Add QSPI node
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 7053e134a17d29e023dd4c55643ea4af9c534ccf)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index ba0ef9a864c8..858fc58c4298 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -752,4 +752,16 @@
+ "rcan1", "rcan0", "qspi_mod", "i2c3", "i2c2", "i2c1", "i2c0";
+ };
+ };
++
++ spi: spi@e6b10000 {
++ compatible = "renesas,qspi-r8a7790", "renesas,qspi";
++ reg = <0 0xe6b10000 0 0x2c>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7790_CLK_QSPI_MOD>;
++ num-cs = <1>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0289-ARM-shmobile-lager-dts-Add-QSPI-nodes.patch b/patches.renesas/0289-ARM-shmobile-lager-dts-Add-QSPI-nodes.patch
new file mode 100644
index 00000000000000..072814b0779193
--- /dev/null
+++ b/patches.renesas/0289-ARM-shmobile-lager-dts-Add-QSPI-nodes.patch
@@ -0,0 +1,71 @@
+From 8370266506607823b406ea7aced9b5ace63aec5d Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 11:47:30 +0100
+Subject: ARM: shmobile: lager dts: Add QSPI nodes
+
+Add pinctrl and SPI devices for QSPI on Lager.
+Add Spansion s25fl512s SPI FLASH and MTD partitions.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9fe7c4f810a7e82c4a1a9765017f9cb2c2b40a65)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index 1081c5e91ac4..adff2dc4012d 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -80,6 +80,11 @@
+ renesas,groups = "mmc1_data8", "mmc1_ctrl";
+ renesas,function = "mmc1";
+ };
++
++ qspi_pins: spi {
++ renesas,groups = "qspi_ctrl", "qspi_data4";
++ renesas,function = "qspi";
++ };
+ };
+
+ &mmcif1 {
+@@ -95,3 +100,34 @@
+ &sata1 {
+ status = "okay";
+ };
++
++&spi {
++ pinctrl-0 = <&qspi_pins>;
++ pinctrl-names = "default";
++
++ status = "okay";
++
++ flash: flash@0 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "spansion,s25fl512s";
++ reg = <0>;
++ spi-max-frequency = <30000000>;
++ m25p,fast-read;
++
++ partition@0 {
++ label = "loader";
++ reg = <0x00000000 0x00040000>;
++ read-only;
++ };
++ partition@40000 {
++ label = "user";
++ reg = <0x00040000 0x00400000>;
++ read-only;
++ };
++ partition@440000 {
++ label = "flash";
++ reg = <0x00440000 0x03bc0000>;
++ };
++ };
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0290-ARM-shmobile-lager-defconfig-Enable-RSPI-and-MTD_M25.patch b/patches.renesas/0290-ARM-shmobile-lager-defconfig-Enable-RSPI-and-MTD_M25.patch
new file mode 100644
index 00000000000000..840e9098dd0bc5
--- /dev/null
+++ b/patches.renesas/0290-ARM-shmobile-lager-defconfig-Enable-RSPI-and-MTD_M25.patch
@@ -0,0 +1,43 @@
+From c433ab2ecdde8196d2bbf401cc1fdf5b93c4309f Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 11:47:31 +0100
+Subject: ARM: shmobile: lager defconfig: Enable RSPI and MTD_M25P80
+
+This enables support for the Spansion s25fl512s SPI FLASH on QSPI.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: resolved conflict]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 917163578a3dcfa3bfc05cc3bfc2653e2994971b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/lager_defconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/configs/lager_defconfig b/arch/arm/configs/lager_defconfig
+index b17f48739013..58702440472a 100644
+--- a/arch/arm/configs/lager_defconfig
++++ b/arch/arm/configs/lager_defconfig
+@@ -51,6 +51,8 @@ CONFIG_IP_PNP_DHCP=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
++CONFIG_MTD=y
++CONFIG_MTD_M25P80=y
+ CONFIG_BLK_DEV_SD=y
+ CONFIG_ATA=y
+ CONFIG_SATA_RCAR=y
+@@ -86,6 +88,8 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
+ CONFIG_I2C=y
+ CONFIG_I2C_GPIO=y
+ CONFIG_I2C_RCAR=y
++CONFIG_SPI=y
++CONFIG_SPI_RSPI=y
+ CONFIG_GPIO_SH_PFC=y
+ CONFIG_GPIOLIB=y
+ CONFIG_GPIO_RCAR=y
+--
+2.1.2
+
diff --git a/patches.renesas/0291-ARM-shmobile-lager-add-SDHI0-2-support-on-DTS.patch b/patches.renesas/0291-ARM-shmobile-lager-add-SDHI0-2-support-on-DTS.patch
new file mode 100644
index 00000000000000..22ba4638a42236
--- /dev/null
+++ b/patches.renesas/0291-ARM-shmobile-lager-add-SDHI0-2-support-on-DTS.patch
@@ -0,0 +1,117 @@
+From f9ef80cbec5dd0d8bb56820afe49804f9d518fa0 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Wed, 12 Feb 2014 21:43:19 -0800
+Subject: ARM: shmobile: lager: add SDHI0/2 support on DTS
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c6119944a421c416818a9ff11f8bd77aa4d683a5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 78 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 78 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index adff2dc4012d..5466fe4ed43e 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -56,6 +56,54 @@
+ regulator-boot-on;
+ regulator-always-on;
+ };
++
++ vcc_sdhi0: regulator@1 {
++ compatible = "regulator-fixed";
++
++ regulator-name = "SDHI0 Vcc";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
++ vccq_sdhi0: regulator@2 {
++ compatible = "regulator-gpio";
++
++ regulator-name = "SDHI0 VccQ";
++ regulator-min-microvolt = <1800000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
++ gpios-states = <1>;
++ states = <3300000 1
++ 1800000 0>;
++ };
++
++ vcc_sdhi2: regulator@3 {
++ compatible = "regulator-fixed";
++
++ regulator-name = "SDHI2 Vcc";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpio = <&gpio5 25 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
++ vccq_sdhi2: regulator@4 {
++ compatible = "regulator-gpio";
++
++ regulator-name = "SDHI2 VccQ";
++ regulator-min-microvolt = <1800000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpios = <&gpio5 30 GPIO_ACTIVE_HIGH>;
++ gpios-states = <1>;
++ states = <3300000 1
++ 1800000 0>;
++ };
+ };
+
+ &extal_clk {
+@@ -76,6 +124,16 @@
+ renesas,function = "scif1";
+ };
+
++ sdhi0_pins: sd0 {
++ renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
++ renesas,function = "sdhi0";
++ };
++
++ sdhi2_pins: sd2 {
++ renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
++ renesas,function = "sdhi2";
++ };
++
+ mmc1_pins: mmc1 {
+ renesas,groups = "mmc1_data8", "mmc1_ctrl";
+ renesas,function = "mmc1";
+@@ -131,3 +189,23 @@
+ };
+ };
+ };
++
++&sdhi0 {
++ pinctrl-0 = <&sdhi0_pins>;
++ pinctrl-names = "default";
++
++ vmmc-supply = <&vcc_sdhi0>;
++ vqmmc-supply = <&vccq_sdhi0>;
++ cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
++ status = "okay";
++};
++
++&sdhi2 {
++ pinctrl-0 = <&sdhi2_pins>;
++ pinctrl-names = "default";
++
++ vmmc-supply = <&vcc_sdhi2>;
++ vqmmc-supply = <&vccq_sdhi2>;
++ cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
++ status = "okay";
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0292-ARM-shmobile-r8a7778-dtsi-Remove-duplicate-i2c-nodes.patch b/patches.renesas/0292-ARM-shmobile-r8a7778-dtsi-Remove-duplicate-i2c-nodes.patch
new file mode 100644
index 00000000000000..4e2539f2ac5eeb
--- /dev/null
+++ b/patches.renesas/0292-ARM-shmobile-r8a7778-dtsi-Remove-duplicate-i2c-nodes.patch
@@ -0,0 +1,72 @@
+From 4c47024073df1d61639d93b2ab8574f71ba77f35 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Mon, 10 Feb 2014 14:42:19 +0100
+Subject: ARM: shmobile: r8a7778 dtsi: Remove duplicate i2c nodes
+
+"ARM: shmobile: r8a7778: add I2C support on DTSI" was applied twice:
+
+ commit ae4273ec7b25c8b9c895a4aae31f2fced980b7bf
+ commit 3acb51b9215bd99da403ecf8200f8425176b1926
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 08517b212726e90b1755e3c917ba064b24e97cbe)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7778.dtsi | 40 ----------------------------------------
+ 1 file changed, 40 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi
+index ddb3bd7a8838..85c5b3b99f5e 100644
+--- a/arch/arm/boot/dts/r8a7778.dtsi
++++ b/arch/arm/boot/dts/r8a7778.dtsi
+@@ -203,46 +203,6 @@
+ status = "disabled";
+ };
+
+- i2c0: i2c@ffc70000 {
+- #address-cells = <1>;
+- #size-cells = <0>;
+- compatible = "renesas,i2c-r8a7778";
+- reg = <0xffc70000 0x1000>;
+- interrupt-parent = <&gic>;
+- interrupts = <0 67 IRQ_TYPE_LEVEL_HIGH>;
+- status = "disabled";
+- };
+-
+- i2c1: i2c@ffc71000 {
+- #address-cells = <1>;
+- #size-cells = <0>;
+- compatible = "renesas,i2c-r8a7778";
+- reg = <0xffc71000 0x1000>;
+- interrupt-parent = <&gic>;
+- interrupts = <0 78 IRQ_TYPE_LEVEL_HIGH>;
+- status = "disabled";
+- };
+-
+- i2c2: i2c@ffc72000 {
+- #address-cells = <1>;
+- #size-cells = <0>;
+- compatible = "renesas,i2c-r8a7778";
+- reg = <0xffc72000 0x1000>;
+- interrupt-parent = <&gic>;
+- interrupts = <0 76 IRQ_TYPE_LEVEL_HIGH>;
+- status = "disabled";
+- };
+-
+- i2c3: i2c@ffc73000 {
+- #address-cells = <1>;
+- #size-cells = <0>;
+- compatible = "renesas,i2c-r8a7778";
+- reg = <0xffc73000 0x1000>;
+- interrupt-parent = <&gic>;
+- interrupts = <0 77 IRQ_TYPE_LEVEL_HIGH>;
+- status = "disabled";
+- };
+-
+ hspi0: spi@fffc7000 {
+ compatible = "renesas,hspi";
+ reg = <0xfffc7000 0x18>;
+--
+2.1.2
+
diff --git a/patches.renesas/0293-ARM-shmobile-Add-defconfig-for-shmobile-multiplatfor.patch b/patches.renesas/0293-ARM-shmobile-Add-defconfig-for-shmobile-multiplatfor.patch
new file mode 100644
index 00000000000000..90ef99c6ba77f9
--- /dev/null
+++ b/patches.renesas/0293-ARM-shmobile-Add-defconfig-for-shmobile-multiplatfor.patch
@@ -0,0 +1,160 @@
+From dbf4e54cea6b1e4d5e6bd5a6ced7fbf47ceca826 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Fri, 14 Feb 2014 09:15:54 +0900
+Subject: ARM: shmobile: Add defconfig for shmobile multiplatform
+
+This is intended to be a base for a defconfig to cover all
+shmobile multiplatform boards. It currently includes configuration
+for the following boards:
+
+* KZM9D
+* Lager
+* Koelsch
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+Acked-by: Magnus Damm <damm@opensource.se>
+(cherry picked from commit 8a76f048dc7fff769aa899f5ffc7975b57de0b16)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/shmobile_defconfig | 129 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 129 insertions(+)
+ create mode 100644 arch/arm/configs/shmobile_defconfig
+
+diff --git a/arch/arm/configs/shmobile_defconfig b/arch/arm/configs/shmobile_defconfig
+new file mode 100644
+index 000000000000..83b07258a385
+--- /dev/null
++++ b/arch/arm/configs/shmobile_defconfig
+@@ -0,0 +1,129 @@
++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_PERF_EVENTS=y
++CONFIG_SLAB=y
++CONFIG_ARCH_SHMOBILE_MULTI=y
++CONFIG_ARCH_EMEV2=y
++CONFIG_ARCH_R8A7790=y
++CONFIG_ARCH_R8A7791=y
++CONFIG_MACH_KOELSCH=y
++CONFIG_MACH_LAGER=y
++# CONFIG_SWP_EMULATE is not set
++CONFIG_CPU_BPREDICT_DISABLE=y
++CONFIG_PL310_ERRATA_588369=y
++CONFIG_ARM_ERRATA_754322=y
++CONFIG_PCI=y
++CONFIG_PCI_RCAR_GEN2=y
++CONFIG_SMP=y
++CONFIG_SCHED_MC=y
++CONFIG_HAVE_ARM_ARCH_TIMER=y
++CONFIG_NR_CPUS=8
++CONFIG_AEABI=y
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_ARM_APPENDED_DTB=y
++CONFIG_KEXEC=y
++CONFIG_VFP=y
++CONFIG_NEON=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS 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_UEVENT_HELPER_PATH="/sbin/hotplug"
++CONFIG_DEVTMPFS=y
++CONFIG_DEVTMPFS_MOUNT=y
++CONFIG_MTD=y
++CONFIG_MTD_M25P80=y
++CONFIG_BLK_DEV_SD=y
++CONFIG_ATA=y
++CONFIG_SATA_RCAR=y
++CONFIG_NETDEVICES=y
++# CONFIG_NET_VENDOR_ARC is not set
++# CONFIG_NET_CADENCE is not set
++# CONFIG_NET_VENDOR_BROADCOM 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_SH_ETH=y
++# CONFIG_NET_VENDOR_SEEQ is not set
++CONFIG_SMSC911X=y
++# CONFIG_NET_VENDOR_STMICRO is not set
++# CONFIG_NET_VENDOR_VIA is not set
++# CONFIG_NET_VENDOR_WIZNET is not set
++CONFIG_SMSC_PHY=y
++# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
++CONFIG_KEYBOARD_GPIO=y
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_LEGACY_PTYS is not set
++CONFIG_SERIAL_8250=y
++CONFIG_SERIAL_8250_CONSOLE=y
++CONFIG_SERIAL_8250_EXTENDED=y
++CONFIG_SERIAL_8250_EM=y
++CONFIG_SERIAL_SH_SCI=y
++CONFIG_SERIAL_SH_SCI_NR_UARTS=20
++CONFIG_SERIAL_SH_SCI_CONSOLE=y
++CONFIG_I2C_GPIO=y
++CONFIG_I2C_RCAR=y
++CONFIG_SPI=y
++CONFIG_SPI_RSPI=y
++CONFIG_GPIO_EM=y
++CONFIG_GPIO_RCAR=y
++# CONFIG_HWMON is not set
++CONFIG_THERMAL=y
++CONFIG_RCAR_THERMAL=y
++CONFIG_REGULATOR=y
++CONFIG_REGULATOR_FIXED_VOLTAGE=y
++CONFIG_REGULATOR_GPIO=y
++CONFIG_MEDIA_SUPPORT=y
++CONFIG_MEDIA_CAMERA_SUPPORT=y
++CONFIG_V4L_PLATFORM_DRIVERS=y
++CONFIG_SOC_CAMERA=y
++CONFIG_SOC_CAMERA_PLATFORM=y
++CONFIG_VIDEO_RCAR_VIN=y
++# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
++CONFIG_VIDEO_ADV7180=y
++CONFIG_DRM=y
++CONFIG_DRM_RCAR_DU=y
++CONFIG_SOUND=y
++CONFIG_SND=y
++CONFIG_SND_SOC=y
++CONFIG_SND_SOC_RCAR=y
++CONFIG_USB_RCAR_GEN2_PHY=y
++CONFIG_MMC=y
++CONFIG_MMC_SDHI=y
++CONFIG_MMC_SH_MMCIF=y
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++CONFIG_LEDS_GPIO=y
++CONFIG_RTC_CLASS=y
++CONFIG_DMADEVICES=y
++CONFIG_SH_DMAE=y
++# CONFIG_IOMMU_SUPPORT is not set
++# CONFIG_DNOTIFY is not set
++CONFIG_MSDOS_FS=y
++CONFIG_VFAT_FS=y
++CONFIG_TMPFS=y
++CONFIG_CONFIGFS_FS=y
++# CONFIG_MISC_FILESYSTEMS is not set
++CONFIG_NFS_FS=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_ARM_UNWIND is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0294-ARM-shmobile-lager-Add-internal-USB-PCI-support.patch b/patches.renesas/0294-ARM-shmobile-lager-Add-internal-USB-PCI-support.patch
new file mode 100644
index 00000000000000..5658f551892cf1
--- /dev/null
+++ b/patches.renesas/0294-ARM-shmobile-lager-Add-internal-USB-PCI-support.patch
@@ -0,0 +1,96 @@
+From 5bc080b4e62d04746800adef7b74810e739ca6e4 Mon Sep 17 00:00:00 2001
+From: Valentine Barshak <valentine.barshak@cogentembedded.com>
+Date: Fri, 14 Feb 2014 12:29:48 +0900
+Subject: ARM: shmobile: lager: Add internal USB PCI support
+
+This adds internal PCI USB host devices to R-Car H2 Lager board.
+
+Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
+[damm@opensource.se: Rebased and reworked to only include USB1 and USB2]
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 849f7b6c10d8016b55e13b7ad2e9f299e2da817b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 50 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 72886af7b737..193dff0267d8 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -638,6 +638,48 @@ static struct resource sdhi2_resources[] __initdata = {
+ DEFINE_RES_IRQ(gic_spi(167)),
+ };
+
++/* Internal PCI1 */
++static const struct resource pci1_resources[] __initconst = {
++ DEFINE_RES_MEM(0xee0b0000, 0x10000), /* CFG */
++ DEFINE_RES_MEM(0xee0a0000, 0x10000), /* MEM */
++ DEFINE_RES_IRQ(gic_spi(112)),
++};
++
++static const struct platform_device_info pci1_info __initconst = {
++ .parent = &platform_bus,
++ .name = "pci-rcar-gen2",
++ .id = 1,
++ .res = pci1_resources,
++ .num_res = ARRAY_SIZE(pci1_resources),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
++static void __init lager_add_usb1_device(void)
++{
++ platform_device_register_full(&pci1_info);
++}
++
++/* Internal PCI2 */
++static const struct resource pci2_resources[] __initconst = {
++ DEFINE_RES_MEM(0xee0d0000, 0x10000), /* CFG */
++ DEFINE_RES_MEM(0xee0c0000, 0x10000), /* MEM */
++ DEFINE_RES_IRQ(gic_spi(113)),
++};
++
++static const struct platform_device_info pci2_info __initconst = {
++ .parent = &platform_bus,
++ .name = "pci-rcar-gen2",
++ .id = 2,
++ .res = pci2_resources,
++ .num_res = ARRAY_SIZE(pci2_resources),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
++static void __init lager_add_usb2_device(void)
++{
++ platform_device_register_full(&pci2_info);
++}
++
+ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* DU (CN10: ARGB0, CN13: LVDS) */
+ PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790",
+@@ -716,6 +758,12 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
+ /* USB0 */
+ PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs", "pfc-r8a7790",
+ "usb0_ovc_vbus", "usb0"),
++ /* USB1 */
++ PIN_MAP_MUX_GROUP_DEFAULT("pci-rcar-gen2.1", "pfc-r8a7790",
++ "usb1", "usb1"),
++ /* USB2 */
++ PIN_MAP_MUX_GROUP_DEFAULT("pci-rcar-gen2.2", "pfc-r8a7790",
++ "usb2", "usb2"),
+ };
+
+ static void __init lager_add_standard_devices(void)
+@@ -776,6 +824,8 @@ static void __init lager_add_standard_devices(void)
+ &usbhs_phy_pdata,
+ sizeof(usbhs_phy_pdata));
+ lager_register_usbhs();
++ lager_add_usb1_device();
++ lager_add_usb2_device();
+
+ lager_add_rsnd_device();
+
+--
+2.1.2
+
diff --git a/patches.renesas/0295-ARM-shmobile-lager-reference-Refactor-clock-lookup-h.patch b/patches.renesas/0295-ARM-shmobile-lager-reference-Refactor-clock-lookup-h.patch
new file mode 100644
index 00000000000000..f6547e19718f65
--- /dev/null
+++ b/patches.renesas/0295-ARM-shmobile-lager-reference-Refactor-clock-lookup-h.patch
@@ -0,0 +1,77 @@
+From 6b977b7a7a84690242539e1ac13fba46c6540e61 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:31:58 +0100
+Subject: ARM: shmobile: lager-reference: Refactor clock lookup hack
+
+Make the clock lookup hack more generic to ease the addition of more
+devices.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9a8c3ab9c0286a6c81012eaf9e95ec2d3e58d21f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager-reference.c | 37 +++++++++++++++-----------
+ 1 file changed, 22 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
+index dc8d76b9a9f1..634ef15e73e3 100644
+--- a/arch/arm/mach-shmobile/board-lager-reference.c
++++ b/arch/arm/mach-shmobile/board-lager-reference.c
+@@ -31,30 +31,37 @@ static void __init lager_add_standard_devices(void)
+ {
+ #ifdef CONFIG_COMMON_CLK
+ /*
+- * This is a really crude hack to provide clkdev support to the SCIF
+- * and CMT devices until they get moved to DT.
++ * This is a really crude hack to provide clkdev support to platform
++ * devices until they get moved to DT.
+ */
+- static const char * const scif_names[] = {
+- "scifa0", "scifa1", "scifb0", "scifb1",
+- "scifb2", "scifa2", "scif0", "scif1",
+- "hscif0", "hscif1",
++ static const struct clk_name {
++ const char *clk;
++ const char *con_id;
++ const char *dev_id;
++ } clk_names[] = {
++ { "cmt0", NULL, "sh_cmt.0" },
++ { "scifa0", NULL, "sh-sci.0" },
++ { "scifa1", NULL, "sh-sci.1" },
++ { "scifb0", NULL, "sh-sci.2" },
++ { "scifb1", NULL, "sh-sci.3" },
++ { "scifb2", NULL, "sh-sci.4" },
++ { "scifa2", NULL, "sh-sci.5" },
++ { "scif0", NULL, "sh-sci.6" },
++ { "scif1", NULL, "sh-sci.7" },
++ { "hscif0", NULL, "sh-sci.8" },
++ { "hscif1", NULL, "sh-sci.9" },
+ };
+ struct clk *clk;
+ unsigned int i;
+
+- for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
+- clk = clk_get(NULL, scif_names[i]);
++ for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
++ clk = clk_get(NULL, clk_names[i].clk);
+ if (!IS_ERR(clk)) {
+- clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
++ clk_register_clkdev(clk, clk_names[i].con_id,
++ clk_names[i].dev_id);
+ clk_put(clk);
+ }
+ }
+-
+- clk = clk_get(NULL, "cmt0");
+- if (!IS_ERR(clk)) {
+- clk_register_clkdev(clk, NULL, "sh_cmt.0");
+- clk_put(clk);
+- }
+ #else
+ r8a7790_clock_init();
+ #endif
+--
+2.1.2
+
diff --git a/patches.renesas/0296-ARM-shmobile-lager-Add-DU-device-to-DTS.patch b/patches.renesas/0296-ARM-shmobile-lager-Add-DU-device-to-DTS.patch
new file mode 100644
index 00000000000000..ed7454498fbc39
--- /dev/null
+++ b/patches.renesas/0296-ARM-shmobile-lager-Add-DU-device-to-DTS.patch
@@ -0,0 +1,43 @@
+From 67090ae1ba2f95a89271a065ef0ba13be4cabf0f Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:31:59 +0100
+Subject: ARM: shmobile: lager: Add DU device to DTS
+
+The DU device has no DT bindings yet, instantiate it as a platform
+device for now.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: broken out of larger patch that
+ included board changes]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 3024f507e1dc2b30fc64ed6106db6aea6e69cf0b)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index 5466fe4ed43e..26a90106e96c 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -111,9 +111,14 @@
+ };
+
+ &pfc {
+- pinctrl-0 = <&scif0_pins &scif1_pins>;
++ pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
+ pinctrl-names = "default";
+
++ du_pins: du {
++ renesas,groups = "du_rgb666", "du_sync_1", "du_clk_out_0";
++ renesas,function = "du";
++ };
++
+ scif0_pins: serial0 {
+ renesas,groups = "scif0_data";
+ renesas,function = "scif0";
+--
+2.1.2
+
diff --git a/patches.renesas/0297-ARM-shmobile-lager-reference-Add-DU-device.patch b/patches.renesas/0297-ARM-shmobile-lager-reference-Add-DU-device.patch
new file mode 100644
index 00000000000000..0ed0427f5eafec
--- /dev/null
+++ b/patches.renesas/0297-ARM-shmobile-lager-reference-Add-DU-device.patch
@@ -0,0 +1,120 @@
+From 785f5dd6ad42a39b83c75f3363ba29cbb4179e75 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:31:59 +0100
+Subject: ARM: shmobile: lager-reference: Add DU device
+
+The DU device has no DT bindings yet, instantiate it as a platform
+device for now.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: omitted DTS portion]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 433aa851d4b32dc3b3de1e84dc20b57e157b25b9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager-reference.c | 66 ++++++++++++++++++++++++++
+ 1 file changed, 66 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
+index 634ef15e73e3..6ba8b3b41609 100644
+--- a/arch/arm/mach-shmobile/board-lager-reference.c
++++ b/arch/arm/mach-shmobile/board-lager-reference.c
+@@ -20,13 +20,72 @@
+
+ #include <linux/clk.h>
+ #include <linux/clkdev.h>
++#include <linux/dma-mapping.h>
+ #include <linux/init.h>
+ #include <linux/of_platform.h>
++#include <linux/platform_data/rcar-du.h>
+ #include <mach/common.h>
++#include <mach/irqs.h>
+ #include <mach/rcar-gen2.h>
+ #include <mach/r8a7790.h>
+ #include <asm/mach/arch.h>
+
++/* DU */
++static struct rcar_du_encoder_data lager_du_encoders[] = {
++ {
++ .type = RCAR_DU_ENCODER_VGA,
++ .output = RCAR_DU_OUTPUT_DPAD0,
++ }, {
++ .type = RCAR_DU_ENCODER_NONE,
++ .output = RCAR_DU_OUTPUT_LVDS1,
++ .connector.lvds.panel = {
++ .width_mm = 210,
++ .height_mm = 158,
++ .mode = {
++ .clock = 65000,
++ .hdisplay = 1024,
++ .hsync_start = 1048,
++ .hsync_end = 1184,
++ .htotal = 1344,
++ .vdisplay = 768,
++ .vsync_start = 771,
++ .vsync_end = 777,
++ .vtotal = 806,
++ .flags = 0,
++ },
++ },
++ },
++};
++
++static struct rcar_du_platform_data lager_du_pdata = {
++ .encoders = lager_du_encoders,
++ .num_encoders = ARRAY_SIZE(lager_du_encoders),
++};
++
++static const struct resource du_resources[] __initconst = {
++ DEFINE_RES_MEM(0xfeb00000, 0x70000),
++ DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
++ DEFINE_RES_MEM_NAMED(0xfeb94000, 0x1c, "lvds.1"),
++ DEFINE_RES_IRQ(gic_spi(256)),
++ DEFINE_RES_IRQ(gic_spi(268)),
++ DEFINE_RES_IRQ(gic_spi(269)),
++};
++
++static void __init lager_add_du_device(void)
++{
++ struct platform_device_info info = {
++ .name = "rcar-du-r8a7790",
++ .id = -1,
++ .res = du_resources,
++ .num_res = ARRAY_SIZE(du_resources),
++ .data = &lager_du_pdata,
++ .size_data = sizeof(lager_du_pdata),
++ .dma_mask = DMA_BIT_MASK(32),
++ };
++
++ platform_device_register_full(&info);
++}
++
+ static void __init lager_add_standard_devices(void)
+ {
+ #ifdef CONFIG_COMMON_CLK
+@@ -50,6 +109,11 @@ static void __init lager_add_standard_devices(void)
+ { "scif1", NULL, "sh-sci.7" },
+ { "hscif0", NULL, "sh-sci.8" },
+ { "hscif1", NULL, "sh-sci.9" },
++ { "du0", "du.0", "rcar-du-r8a7790" },
++ { "du1", "du.1", "rcar-du-r8a7790" },
++ { "du2", "du.2", "rcar-du-r8a7790" },
++ { "lvds0", "lvds.0", "rcar-du-r8a7790" },
++ { "lvds1", "lvds.1", "rcar-du-r8a7790" },
+ };
+ struct clk *clk;
+ unsigned int i;
+@@ -68,6 +132,8 @@ static void __init lager_add_standard_devices(void)
+
+ r8a7790_add_dt_devices();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
++
++ lager_add_du_device();
+ }
+
+ static const char *lager_boards_compat_dt[] __initdata = {
+--
+2.1.2
+
diff --git a/patches.renesas/0298-ARM-shmobile-koelsch-reference-Refactor-clock-lookup.patch b/patches.renesas/0298-ARM-shmobile-koelsch-reference-Refactor-clock-lookup.patch
new file mode 100644
index 00000000000000..f53cd7a9b93ba7
--- /dev/null
+++ b/patches.renesas/0298-ARM-shmobile-koelsch-reference-Refactor-clock-lookup.patch
@@ -0,0 +1,81 @@
+From f771751a4cc27bfddb1e7293ae093cece086fdc5 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:32:00 +0100
+Subject: ARM: shmobile: koelsch-reference: Refactor clock lookup hack
+
+Make the clock lookup hack more generic to ease the addition of more
+devices.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 189ef3d62df6701e58d216cf81277b88bb4ac7a8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch-reference.c | 42 +++++++++++++++---------
+ 1 file changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
+index feb8d97ea2f7..42c6eb4c3e67 100644
+--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
++++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
+@@ -32,30 +32,42 @@ static void __init koelsch_add_standard_devices(void)
+ {
+ #ifdef CONFIG_COMMON_CLK
+ /*
+- * This is a really crude hack to provide clkdev support to the SCIF
+- * and CMT devices until they get moved to DT.
++ * This is a really crude hack to provide clkdev support to the CMT and
++ * DU devices until they get moved to DT.
+ */
+- static const char * const scif_names[] = {
+- "scifa0", "scifa1", "scifb0", "scifb1", "scifb2", "scifa2",
+- "scif0", "scif1", "scif2", "scif3", "scif4", "scif5", "scifa3",
+- "scifa4", "scifa5",
++ static const struct clk_name {
++ const char *clk;
++ const char *con_id;
++ const char *dev_id;
++ } clk_names[] = {
++ { "cmt0", NULL, "sh_cmt.0" },
++ { "scifa0", NULL, "sh-sci.0" },
++ { "scifa1", NULL, "sh-sci.1" },
++ { "scifb0", NULL, "sh-sci.2" },
++ { "scifb1", NULL, "sh-sci.3" },
++ { "scifb2", NULL, "sh-sci.4" },
++ { "scifa2", NULL, "sh-sci.5" },
++ { "scif0", NULL, "sh-sci.6" },
++ { "scif1", NULL, "sh-sci.7" },
++ { "scif2", NULL, "sh-sci.8" },
++ { "scif3", NULL, "sh-sci.9" },
++ { "scif4", NULL, "sh-sci.10" },
++ { "scif5", NULL, "sh-sci.11" },
++ { "scifa3", NULL, "sh-sci.12" },
++ { "scifa4", NULL, "sh-sci.13" },
++ { "scifa5", NULL, "sh-sci.14" },
+ };
+ struct clk *clk;
+ unsigned int i;
+
+- for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
+- clk = clk_get(NULL, scif_names[i]);
++ for (i = 0; i < ARRAY_SIZE(clk_names); ++i) {
++ clk = clk_get(NULL, clk_names[i].clk);
+ if (!IS_ERR(clk)) {
+- clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
++ clk_register_clkdev(clk, clk_names[i].con_id,
++ clk_names[i].dev_id);
+ clk_put(clk);
+ }
+ }
+-
+- clk = clk_get(NULL, "cmt0");
+- if (!IS_ERR(clk)) {
+- clk_register_clkdev(clk, NULL, "sh_cmt.0");
+- clk_put(clk);
+- }
+ #else
+ r8a7791_clock_init();
+ #endif
+--
+2.1.2
+
diff --git a/patches.renesas/0299-ARM-shmobile-koelsch-reference-Add-DU-device.patch b/patches.renesas/0299-ARM-shmobile-koelsch-reference-Add-DU-device.patch
new file mode 100644
index 00000000000000..6cb83f52bd0f10
--- /dev/null
+++ b/patches.renesas/0299-ARM-shmobile-koelsch-reference-Add-DU-device.patch
@@ -0,0 +1,113 @@
+From 761af436d9e603d675e61c51a04c81bfeecdd14d Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:32:01 +0100
+Subject: ARM: shmobile: koelsch-reference: Add DU device
+
+The DU device has no DT bindings yet, instantiate it as a platform
+device for now.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: omitted DTS portion]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 14c5ce178ee46b205ff4e9087d5ecba298798edc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch-reference.c | 59 ++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
+index 42c6eb4c3e67..267fe8358cfe 100644
+--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
++++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
+@@ -21,13 +21,67 @@
+
+ #include <linux/clk.h>
+ #include <linux/clkdev.h>
++#include <linux/dma-mapping.h>
+ #include <linux/kernel.h>
+ #include <linux/of_platform.h>
++#include <linux/platform_data/rcar-du.h>
+ #include <mach/common.h>
++#include <mach/irqs.h>
+ #include <mach/rcar-gen2.h>
+ #include <mach/r8a7791.h>
+ #include <asm/mach/arch.h>
+
++/* DU */
++static struct rcar_du_encoder_data koelsch_du_encoders[] = {
++ {
++ .type = RCAR_DU_ENCODER_NONE,
++ .output = RCAR_DU_OUTPUT_LVDS0,
++ .connector.lvds.panel = {
++ .width_mm = 210,
++ .height_mm = 158,
++ .mode = {
++ .clock = 65000,
++ .hdisplay = 1024,
++ .hsync_start = 1048,
++ .hsync_end = 1184,
++ .htotal = 1344,
++ .vdisplay = 768,
++ .vsync_start = 771,
++ .vsync_end = 777,
++ .vtotal = 806,
++ .flags = 0,
++ },
++ },
++ },
++};
++
++static struct rcar_du_platform_data koelsch_du_pdata = {
++ .encoders = koelsch_du_encoders,
++ .num_encoders = ARRAY_SIZE(koelsch_du_encoders),
++};
++
++static const struct resource du_resources[] __initconst = {
++ DEFINE_RES_MEM(0xfeb00000, 0x40000),
++ DEFINE_RES_MEM_NAMED(0xfeb90000, 0x1c, "lvds.0"),
++ DEFINE_RES_IRQ(gic_spi(256)),
++ DEFINE_RES_IRQ(gic_spi(268)),
++};
++
++static void __init koelsch_add_du_device(void)
++{
++ struct platform_device_info info = {
++ .name = "rcar-du-r8a7791",
++ .id = -1,
++ .res = du_resources,
++ .num_res = ARRAY_SIZE(du_resources),
++ .data = &koelsch_du_pdata,
++ .size_data = sizeof(koelsch_du_pdata),
++ .dma_mask = DMA_BIT_MASK(32),
++ };
++
++ platform_device_register_full(&info);
++}
++
+ static void __init koelsch_add_standard_devices(void)
+ {
+ #ifdef CONFIG_COMMON_CLK
+@@ -56,6 +110,9 @@ static void __init koelsch_add_standard_devices(void)
+ { "scifa3", NULL, "sh-sci.12" },
+ { "scifa4", NULL, "sh-sci.13" },
+ { "scifa5", NULL, "sh-sci.14" },
++ { "du0", "du.0", "rcar-du-r8a7791" },
++ { "du1", "du.1", "rcar-du-r8a7791" },
++ { "lvds0", "lvds.0", "rcar-du-r8a7791" },
+ };
+ struct clk *clk;
+ unsigned int i;
+@@ -73,6 +130,8 @@ static void __init koelsch_add_standard_devices(void)
+ #endif
+ r8a7791_add_dt_devices();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
++
++ koelsch_add_du_device();
+ }
+
+ static const char * const koelsch_boards_compat_dt[] __initconst = {
+--
+2.1.2
+
diff --git a/patches.renesas/0300-ARM-shmobile-koelsch-reference-Add-DU-device-to-DTS.patch b/patches.renesas/0300-ARM-shmobile-koelsch-reference-Add-DU-device-to-DTS.patch
new file mode 100644
index 00000000000000..42150712f495df
--- /dev/null
+++ b/patches.renesas/0300-ARM-shmobile-koelsch-reference-Add-DU-device-to-DTS.patch
@@ -0,0 +1,43 @@
+From 41fa672d8e597e19c6e33235bd4a8f7600bab27f Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Sun, 16 Feb 2014 22:32:01 +0100
+Subject: ARM: shmobile: koelsch-reference: Add DU device to DTS
+
+The DU device has no DT bindings yet, instantiate it as a platform
+device for now.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: broken out of larger patch that
+ included board changes]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit afba941c18985ffd473f7bad85f89eb7c7121de4)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index d4b9bba38685..f67d2d0abded 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -109,9 +109,14 @@
+ };
+
+ &pfc {
+- pinctrl-0 = <&scif0_pins &scif1_pins>;
++ pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
+ pinctrl-names = "default";
+
++ du_pins: du {
++ renesas,groups = "du_rgb666", "du_sync", "du_clk_out_0";
++ renesas,function = "du";
++ };
++
+ scif0_pins: serial0 {
+ renesas,groups = "scif0_data_d";
+ renesas,function = "scif0";
+--
+2.1.2
+
diff --git a/patches.renesas/0301-ARM-shmobile-r8a7791-remove-superfluous-interrupt-pa.patch b/patches.renesas/0301-ARM-shmobile-r8a7791-remove-superfluous-interrupt-pa.patch
new file mode 100644
index 00000000000000..1f9cbf87b2b44a
--- /dev/null
+++ b/patches.renesas/0301-ARM-shmobile-r8a7791-remove-superfluous-interrupt-pa.patch
@@ -0,0 +1,271 @@
+From 0732ffd18a9cb17a4063cb02e1205805ef1558cc Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Sun, 16 Feb 2014 10:40:54 +0100
+Subject: ARM: shmobile: r8a7791: remove superfluous interrupt-parents
+
+These values are inherited, so don't need to be specified again.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9db389f29e2c9660e22e20bf53aec07c669d0eae)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 31 -------------------------------
+ 1 file changed, 31 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 240c4ece1f0c..41194fe18c3c 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -53,7 +53,6 @@
+ gpio0: gpio@e6050000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6050000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -65,7 +64,6 @@
+ gpio1: gpio@e6051000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6051000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -77,7 +75,6 @@
+ gpio2: gpio@e6052000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6052000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -89,7 +86,6 @@
+ gpio3: gpio@e6053000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6053000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -101,7 +97,6 @@
+ gpio4: gpio@e6054000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6054000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -113,7 +108,6 @@
+ gpio5: gpio@e6055000 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6055000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -125,7 +119,6 @@
+ gpio6: gpio@e6055400 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6055400 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 10 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -137,7 +130,6 @@
+ gpio7: gpio@e6055800 {
+ compatible = "renesas,gpio-r8a7791", "renesas,gpio-rcar";
+ reg = <0 0xe6055800 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -149,7 +141,6 @@
+ thermal@e61f0000 {
+ compatible = "renesas,thermal-r8a7791", "renesas,rcar-thermal";
+ reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp5_clks R8A7791_CLK_THERMAL>;
+ };
+@@ -167,7 +158,6 @@
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ reg = <0 0xe61c0000 0 0x200>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
+ <0 1 IRQ_TYPE_LEVEL_HIGH>,
+ <0 2 IRQ_TYPE_LEVEL_HIGH>,
+@@ -189,7 +179,6 @@
+ scifa0: serial@e6c40000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFA0>;
+ clock-names = "sci_ick";
+@@ -198,7 +187,6 @@
+
+ scifa1: serial@e6c50000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c50000 0 64>;
+ interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFA1>;
+@@ -208,7 +196,6 @@
+
+ scifa2: serial@e6c60000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c60000 0 64>;
+ interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFA2>;
+@@ -218,7 +205,6 @@
+
+ scifa3: serial@e6c70000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c70000 0 64>;
+ interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp11_clks R8A7791_CLK_SCIFA3>;
+@@ -228,7 +214,6 @@
+
+ scifa4: serial@e6c78000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c78000 0 64>;
+ interrupts = <0 30 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp11_clks R8A7791_CLK_SCIFA4>;
+@@ -238,7 +223,6 @@
+
+ scifa5: serial@e6c80000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c80000 0 64>;
+ interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp11_clks R8A7791_CLK_SCIFA5>;
+@@ -248,7 +232,6 @@
+
+ scifb0: serial@e6c20000 {
+ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c20000 0 64>;
+ interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFB0>;
+@@ -258,7 +241,6 @@
+
+ scifb1: serial@e6c30000 {
+ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c30000 0 64>;
+ interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFB1>;
+@@ -268,7 +250,6 @@
+
+ scifb2: serial@e6ce0000 {
+ compatible = "renesas,scifb-r8a7791", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6ce0000 0 64>;
+ interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7791_CLK_SCIFB2>;
+@@ -278,7 +259,6 @@
+
+ scif0: serial@e6e60000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6e60000 0 64>;
+ interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF0>;
+@@ -288,7 +268,6 @@
+
+ scif1: serial@e6e68000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6e68000 0 64>;
+ interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF1>;
+@@ -298,7 +277,6 @@
+
+ scif2: serial@e6e58000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6e58000 0 64>;
+ interrupts = <0 22 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF2>;
+@@ -308,7 +286,6 @@
+
+ scif3: serial@e6ea8000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6ea8000 0 64>;
+ interrupts = <0 23 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF3>;
+@@ -318,7 +295,6 @@
+
+ scif4: serial@e6ee0000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6ee0000 0 64>;
+ interrupts = <0 24 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF4>;
+@@ -328,7 +304,6 @@
+
+ scif5: serial@e6ee8000 {
+ compatible = "renesas,scif-r8a7791", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6ee8000 0 64>;
+ interrupts = <0 25 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_SCIF5>;
+@@ -338,7 +313,6 @@
+
+ hscif0: serial@e62c0000 {
+ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe62c0000 0 96>;
+ interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_HSCIF0>;
+@@ -348,7 +322,6 @@
+
+ hscif1: serial@e62c8000 {
+ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe62c8000 0 96>;
+ interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_HSCIF1>;
+@@ -358,7 +331,6 @@
+
+ hscif2: serial@e62d0000 {
+ compatible = "renesas,hscif-r8a7791", "renesas,hscif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe62d0000 0 96>;
+ interrupts = <0 21 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7791_CLK_HSCIF2>;
+@@ -369,7 +341,6 @@
+ sata0: sata@ee300000 {
+ compatible = "renesas,sata-r8a7791";
+ reg = <0 0xee300000 0 0x2000>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp8_clks R8A7791_CLK_SATA0>;
+ status = "disabled";
+@@ -378,7 +349,6 @@
+ sata1: sata@ee500000 {
+ compatible = "renesas,sata-r8a7791";
+ reg = <0 0xee500000 0 0x2000>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp8_clks R8A7791_CLK_SATA1>;
+ status = "disabled";
+@@ -714,7 +684,6 @@
+ spi: spi@e6b10000 {
+ compatible = "renesas,qspi-r8a7791", "renesas,qspi";
+ reg = <0 0xe6b10000 0 0x2c>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
+ num-cs = <1>;
+--
+2.1.2
+
diff --git a/patches.renesas/0302-ARM-shmobile-r8a7790-remove-superfluous-interrupt-pa.patch b/patches.renesas/0302-ARM-shmobile-r8a7790-remove-superfluous-interrupt-pa.patch
new file mode 100644
index 00000000000000..681d2992d1ffb4
--- /dev/null
+++ b/patches.renesas/0302-ARM-shmobile-r8a7790-remove-superfluous-interrupt-pa.patch
@@ -0,0 +1,271 @@
+From eb84ec43b16d5855c8e98d94d6a249a704e5b7c6 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Sun, 16 Feb 2014 10:40:57 +0100
+Subject: ARM: shmobile: r8a7790: remove superfluous interrupt-parents
+
+These values are inherited, so don't need to be specified again.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 951dc909b22afd52f57e1f74e86415941a057d31)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 31 -------------------------------
+ 1 file changed, 31 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 858fc58c4298..d7bde1ee2bb0 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -94,7 +94,6 @@
+ gpio0: gpio@e6050000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6050000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 4 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -106,7 +105,6 @@
+ gpio1: gpio@e6051000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6051000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 5 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -118,7 +116,6 @@
+ gpio2: gpio@e6052000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6052000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -130,7 +127,6 @@
+ gpio3: gpio@e6053000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6053000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 7 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -142,7 +138,6 @@
+ gpio4: gpio@e6054000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6054000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 8 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -154,7 +149,6 @@
+ gpio5: gpio@e6055000 {
+ compatible = "renesas,gpio-r8a7790", "renesas,gpio-rcar";
+ reg = <0 0xe6055000 0 0x50>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>;
+ #gpio-cells = <2>;
+ gpio-controller;
+@@ -166,7 +160,6 @@
+ thermal@e61f0000 {
+ compatible = "renesas,thermal-r8a7790", "renesas,rcar-thermal";
+ reg = <0 0xe61f0000 0 0x14>, <0 0xe61f0100 0 0x38>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 69 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp5_clks R8A7790_CLK_THERMAL>;
+ };
+@@ -184,7 +177,6 @@
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ reg = <0 0xe61c0000 0 0x200>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 0 IRQ_TYPE_LEVEL_HIGH>,
+ <0 1 IRQ_TYPE_LEVEL_HIGH>,
+ <0 2 IRQ_TYPE_LEVEL_HIGH>,
+@@ -196,7 +188,6 @@
+ #size-cells = <0>;
+ compatible = "renesas,i2c-r8a7790";
+ reg = <0 0xe6508000 0 0x40>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7790_CLK_I2C0>;
+ status = "disabled";
+@@ -207,7 +198,6 @@
+ #size-cells = <0>;
+ compatible = "renesas,i2c-r8a7790";
+ reg = <0 0xe6518000 0 0x40>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7790_CLK_I2C1>;
+ status = "disabled";
+@@ -218,7 +208,6 @@
+ #size-cells = <0>;
+ compatible = "renesas,i2c-r8a7790";
+ reg = <0 0xe6530000 0 0x40>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7790_CLK_I2C2>;
+ status = "disabled";
+@@ -229,7 +218,6 @@
+ #size-cells = <0>;
+ compatible = "renesas,i2c-r8a7790";
+ reg = <0 0xe6540000 0 0x40>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7790_CLK_I2C3>;
+ status = "disabled";
+@@ -238,7 +226,6 @@
+ mmcif0: mmcif@ee200000 {
+ compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
+ reg = <0 0xee200000 0 0x80>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 169 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_MMCIF0>;
+ reg-io-width = <4>;
+@@ -248,7 +235,6 @@
+ mmcif1: mmc@ee220000 {
+ compatible = "renesas,mmcif-r8a7790", "renesas,sh-mmcif";
+ reg = <0 0xee220000 0 0x80>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 170 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_MMCIF1>;
+ reg-io-width = <4>;
+@@ -263,7 +249,6 @@
+ sdhi0: sd@ee100000 {
+ compatible = "renesas,sdhi-r8a7790";
+ reg = <0 0xee100000 0 0x200>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
+ cap-sd-highspeed;
+@@ -273,7 +258,6 @@
+ sdhi1: sd@ee120000 {
+ compatible = "renesas,sdhi-r8a7790";
+ reg = <0 0xee120000 0 0x200>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
+ cap-sd-highspeed;
+@@ -283,7 +267,6 @@
+ sdhi2: sd@ee140000 {
+ compatible = "renesas,sdhi-r8a7790";
+ reg = <0 0xee140000 0 0x100>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
+ cap-sd-highspeed;
+@@ -293,7 +276,6 @@
+ sdhi3: sd@ee160000 {
+ compatible = "renesas,sdhi-r8a7790";
+ reg = <0 0xee160000 0 0x100>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
+ cap-sd-highspeed;
+@@ -303,7 +285,6 @@
+ scifa0: serial@e6c40000 {
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 144 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA0>;
+ clock-names = "sci_ick";
+@@ -312,7 +293,6 @@
+
+ scifa1: serial@e6c50000 {
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c50000 0 64>;
+ interrupts = <0 145 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA1>;
+@@ -322,7 +302,6 @@
+
+ scifa2: serial@e6c60000 {
+ compatible = "renesas,scifa-r8a7790", "renesas,scifa";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c60000 0 64>;
+ interrupts = <0 151 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFA2>;
+@@ -332,7 +311,6 @@
+
+ scifb0: serial@e6c20000 {
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c20000 0 64>;
+ interrupts = <0 148 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB0>;
+@@ -342,7 +320,6 @@
+
+ scifb1: serial@e6c30000 {
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6c30000 0 64>;
+ interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB1>;
+@@ -352,7 +329,6 @@
+
+ scifb2: serial@e6ce0000 {
+ compatible = "renesas,scifb-r8a7790", "renesas,scifb";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6ce0000 0 64>;
+ interrupts = <0 150 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp2_clks R8A7790_CLK_SCIFB2>;
+@@ -362,7 +338,6 @@
+
+ scif0: serial@e6e60000 {
+ compatible = "renesas,scif-r8a7790", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6e60000 0 64>;
+ interrupts = <0 152 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_SCIF0>;
+@@ -372,7 +347,6 @@
+
+ scif1: serial@e6e68000 {
+ compatible = "renesas,scif-r8a7790", "renesas,scif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe6e68000 0 64>;
+ interrupts = <0 153 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_SCIF1>;
+@@ -382,7 +356,6 @@
+
+ hscif0: serial@e62c0000 {
+ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe62c0000 0 96>;
+ interrupts = <0 154 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_HSCIF0>;
+@@ -392,7 +365,6 @@
+
+ hscif1: serial@e62c8000 {
+ compatible = "renesas,hscif-r8a7790", "renesas,hscif";
+- interrupt-parent = <&gic>;
+ reg = <0 0xe62c8000 0 96>;
+ interrupts = <0 155 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp7_clks R8A7790_CLK_HSCIF1>;
+@@ -403,7 +375,6 @@
+ sata0: sata@ee300000 {
+ compatible = "renesas,sata-r8a7790";
+ reg = <0 0xee300000 0 0x2000>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp8_clks R8A7790_CLK_SATA0>;
+ status = "disabled";
+@@ -412,7 +383,6 @@
+ sata1: sata@ee500000 {
+ compatible = "renesas,sata-r8a7790";
+ reg = <0 0xee500000 0 0x2000>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp8_clks R8A7790_CLK_SATA1>;
+ status = "disabled";
+@@ -756,7 +726,6 @@
+ spi: spi@e6b10000 {
+ compatible = "renesas,qspi-r8a7790", "renesas,qspi";
+ reg = <0 0xe6b10000 0 0x2c>;
+- interrupt-parent = <&gic>;
+ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7790_CLK_QSPI_MOD>;
+ num-cs = <1>;
+--
+2.1.2
+
diff --git a/patches.renesas/0303-ARM-shmobile-r8a7790-add-i2c-aliases-to-dtsi.patch b/patches.renesas/0303-ARM-shmobile-r8a7790-add-i2c-aliases-to-dtsi.patch
new file mode 100644
index 00000000000000..20d2d696fe1088
--- /dev/null
+++ b/patches.renesas/0303-ARM-shmobile-r8a7790-add-i2c-aliases-to-dtsi.patch
@@ -0,0 +1,35 @@
+From 5fb0c320be6a0ce9ee02c12a2aa73cc023b721cb Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Sun, 16 Feb 2014 10:40:58 +0100
+Subject: ARM: shmobile: r8a7790: add i2c aliases to dtsi
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 6b1d7c68b255be81ef174d9621869fde5c95bc20)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index d7bde1ee2bb0..6eb9613d9c8d 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -18,6 +18,13 @@
+ #address-cells = <2>;
+ #size-cells = <2>;
+
++ aliases {
++ i2c0 = &i2c0;
++ i2c1 = &i2c1;
++ i2c2 = &i2c2;
++ i2c3 = &i2c3;
++ };
++
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+--
+2.1.2
+
diff --git a/patches.renesas/0304-ARM-shmobile-Armadillo-800-EVA-set-proper-DMA-masks-.patch b/patches.renesas/0304-ARM-shmobile-Armadillo-800-EVA-set-proper-DMA-masks-.patch
new file mode 100644
index 00000000000000..8d676ad38c7beb
--- /dev/null
+++ b/patches.renesas/0304-ARM-shmobile-Armadillo-800-EVA-set-proper-DMA-masks-.patch
@@ -0,0 +1,34 @@
+From d6567a62240ca32a7b4b11ef92eb1ed5ef57ae97 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Feb 2014 04:26:52 +0300
+Subject: ARM: shmobile: Armadillo 800 EVA: set proper DMA masks for Ether
+ device
+
+Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and
+'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing
+ability.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 78060840cd2286c0e382641e60dcd4145f82f881)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-armadillo800eva.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
+index 93533e2710a8..4da3da7be3fa 100644
+--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
++++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
+@@ -383,6 +383,8 @@ static struct platform_device sh_eth_device = {
+ .id = -1,
+ .dev = {
+ .platform_data = &sh_eth_platdata,
++ .dma_mask = &sh_eth_device.dev.coherent_dma_mask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
+ },
+ .resource = sh_eth_resources,
+ .num_resources = ARRAY_SIZE(sh_eth_resources),
+--
+2.1.2
+
diff --git a/patches.renesas/0305-ARM-shmobile-BOCK-W-set-proper-DMA-masks-for-Ether-d.patch b/patches.renesas/0305-ARM-shmobile-BOCK-W-set-proper-DMA-masks-for-Ether-d.patch
new file mode 100644
index 00000000000000..a3f7df7c8f5928
--- /dev/null
+++ b/patches.renesas/0305-ARM-shmobile-BOCK-W-set-proper-DMA-masks-for-Ether-d.patch
@@ -0,0 +1,67 @@
+From dc324a879198844ad7d73b4e53accd6ec9f9a540 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Feb 2014 04:28:43 +0300
+Subject: ARM: shmobile: BOCK-W: set proper DMA masks for Ether device
+
+Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and
+'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing
+ability.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit ca6da5319761308e38bb97af9030d16e223355d1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-bockw.c | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
+index 684a529e400d..aaed215e96b9 100644
+--- a/arch/arm/mach-shmobile/board-bockw.c
++++ b/arch/arm/mach-shmobile/board-bockw.c
+@@ -1,9 +1,9 @@
+ /*
+ * Bock-W board support
+ *
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
+ * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+- * Copyright (C) 2013 Cogent Embedded, Inc.
++ * Copyright (C) 2013-2014 Cogent Embedded, Inc.
+ *
+ * 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
+@@ -235,6 +235,17 @@ static struct sh_eth_plat_data ether_platform_data __initdata = {
+ .no_ether_link = 1,
+ };
+
++static struct platform_device_info ether_info __initdata = {
++ .parent = &platform_bus,
++ .name = "r8a777x-ether",
++ .id = -1,
++ .res = ether_resources,
++ .num_res = ARRAY_SIZE(ether_resources),
++ .data = &ether_platform_data,
++ .size_data = sizeof(ether_platform_data),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ /* I2C */
+ static struct i2c_board_info i2c0_devices[] = {
+ {
+@@ -592,11 +603,7 @@ static void __init bockw_init(void)
+ r8a7778_init_irq_extpin(1);
+ r8a7778_add_standard_devices();
+
+- platform_device_register_resndata(&platform_bus, "r8a777x-ether", -1,
+- ether_resources,
+- ARRAY_SIZE(ether_resources),
+- &ether_platform_data,
+- sizeof(ether_platform_data));
++ platform_device_register_full(&ether_info);
+
+ platform_device_register_full(&vin0_info);
+ /* VIN1 has a pin conflict with Ether */
+--
+2.1.2
+
diff --git a/patches.renesas/0306-ARM-shmobile-Lager-set-proper-DMA-masks-for-Ether-de.patch b/patches.renesas/0306-ARM-shmobile-Lager-set-proper-DMA-masks-for-Ether-de.patch
new file mode 100644
index 00000000000000..3a8eb4848a1e7b
--- /dev/null
+++ b/patches.renesas/0306-ARM-shmobile-Lager-set-proper-DMA-masks-for-Ether-de.patch
@@ -0,0 +1,70 @@
+From fc8175afbf103fd16afa7dd2a00c185dc06cc803 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Feb 2014 04:30:20 +0300
+Subject: ARM: shmobile: Lager: set proper DMA masks for Ether device
+
+Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and
+'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing
+ability.
+
+Currently, the code works without DMA masks but as we would have to enable
+CONFIG_HIGHMEM to access the full board memory in the future, when support for
+NETIF_F_SG would be added to the 'sh_eth' driver as well, the correct DMA masks
+should start to matter...
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5d5a87a5b6572426f8eae6e26ebcf9664d2d001a)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index 193dff0267d8..f0104bfe544e 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -1,8 +1,9 @@
+ /*
+ * Lager board support
+ *
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
+ * Copyright (C) 2013 Magnus Damm
++ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * 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
+@@ -275,6 +276,17 @@ static const struct resource ether_resources[] __initconst = {
+ DEFINE_RES_IRQ(gic_spi(162)),
+ };
+
++static const struct platform_device_info ether_info __initconst = {
++ .parent = &platform_bus,
++ .name = "r8a7790-ether",
++ .id = -1,
++ .res = ether_resources,
++ .num_res = ARRAY_SIZE(ether_resources),
++ .data = &ether_pdata,
++ .size_data = sizeof(ether_pdata),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ /* SPI Flash memory (Spansion S25FL512SAGMFIG11 64Mb) */
+ static struct mtd_partition spi_flash_part[] = {
+ /* Reserved for user loader program, read-only */
+@@ -791,10 +803,7 @@ static void __init lager_add_standard_devices(void)
+ mmcif1_resources, ARRAY_SIZE(mmcif1_resources),
+ &mmcif1_pdata, sizeof(mmcif1_pdata));
+
+- platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1,
+- ether_resources,
+- ARRAY_SIZE(ether_resources),
+- &ether_pdata, sizeof(ether_pdata));
++ platform_device_register_full(&ether_info);
+
+ lager_add_du_device();
+
+--
+2.1.2
+
diff --git a/patches.renesas/0307-ARM-shmobile-Koelsch-set-proper-DMA-masks-for-Ether-.patch b/patches.renesas/0307-ARM-shmobile-Koelsch-set-proper-DMA-masks-for-Ether-.patch
new file mode 100644
index 00000000000000..f7fd7ab84b7e32
--- /dev/null
+++ b/patches.renesas/0307-ARM-shmobile-Koelsch-set-proper-DMA-masks-for-Ether-.patch
@@ -0,0 +1,70 @@
+From c12f03d5c12b2b7807b435e1f59d977d6e41cc89 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Feb 2014 04:36:19 +0300
+Subject: ARM: shmobile: Koelsch: set proper DMA masks for Ether device
+
+Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and
+'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing
+ability.
+
+Currently, the code works without DMA masks but as we would have to enable
+CONFIG_HIGHMEM to access the full board memory in the future, when support for
+NETIF_F_SG would be added to the 'sh_eth' driver as well, the correct DMA masks
+should start to matter...
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 379bfd7134bccccf58962b39e504bd639a5e75b2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
+index 893d47c7d7a6..5a034ff405d0 100644
+--- a/arch/arm/mach-shmobile/board-koelsch.c
++++ b/arch/arm/mach-shmobile/board-koelsch.c
+@@ -2,8 +2,9 @@
+ * Koelsch board support
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
+ * Copyright (C) 2013 Magnus Damm
++ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * 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
+@@ -116,6 +117,17 @@ static const struct resource ether_resources[] __initconst = {
+ DEFINE_RES_IRQ(gic_spi(162)),
+ };
+
++static const struct platform_device_info ether_info __initconst = {
++ .parent = &platform_bus,
++ .name = "r8a7791-ether",
++ .id = -1,
++ .res = ether_resources,
++ .num_res = ARRAY_SIZE(ether_resources),
++ .data = &ether_pdata,
++ .size_data = sizeof(ether_pdata),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ /* LEDS */
+ static struct gpio_led koelsch_leds[] = {
+ {
+@@ -426,10 +438,7 @@ static void __init koelsch_add_standard_devices(void)
+ ARRAY_SIZE(koelsch_pinctrl_map));
+ r8a7791_pinmux_init();
+ r8a7791_add_standard_devices();
+- platform_device_register_resndata(&platform_bus, "r8a7791-ether", -1,
+- ether_resources,
+- ARRAY_SIZE(ether_resources),
+- &ether_pdata, sizeof(ether_pdata));
++ platform_device_register_full(&ether_info);
+ platform_device_register_data(&platform_bus, "leds-gpio", -1,
+ &koelsch_leds_pdata,
+ sizeof(koelsch_leds_pdata));
+--
+2.1.2
+
diff --git a/patches.renesas/0308-ARM-shmobile-Genmai-set-proper-DMA-masks-for-Ether-d.patch b/patches.renesas/0308-ARM-shmobile-Genmai-set-proper-DMA-masks-for-Ether-d.patch
new file mode 100644
index 00000000000000..74e9e2a3b094e5
--- /dev/null
+++ b/patches.renesas/0308-ARM-shmobile-Genmai-set-proper-DMA-masks-for-Ether-d.patch
@@ -0,0 +1,65 @@
+From 9647cda80b6ddae3db73a078148f4db9ecb3e1b2 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Sat, 15 Feb 2014 04:37:32 +0300
+Subject: ARM: shmobile: Genmai: set proper DMA masks for Ether device
+
+Ether MAC is a DMA-capable device and so should have 'dev.dma_mask' and
+'dev.coherent_dma_mask' fields set properly, to reflect 32-bit DMA addressing
+ability.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 583e2448629cc9fb3b1a0c850ddbe06819421d3e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-genmai.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
+index e240980cc227..6c328d63b819 100644
+--- a/arch/arm/mach-shmobile/board-genmai.c
++++ b/arch/arm/mach-shmobile/board-genmai.c
+@@ -1,8 +1,9 @@
+ /*
+ * Genmai board support
+ *
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
+ * Copyright (C) 2013 Magnus Damm
++ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * 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
+@@ -43,6 +44,17 @@ static const struct resource ether_resources[] __initconst = {
+ DEFINE_RES_IRQ(gic_iid(359)),
+ };
+
++static const struct platform_device_info ether_info __initconst = {
++ .parent = &platform_bus,
++ .name = "r7s72100-ether",
++ .id = -1,
++ .res = ether_resources,
++ .num_res = ARRAY_SIZE(ether_resources),
++ .data = &ether_pdata,
++ .size_data = sizeof(ether_pdata),
++ .dma_mask = DMA_BIT_MASK(32),
++};
++
+ /* RSPI */
+ #define RSPI_RESOURCE(idx, baseaddr, irq) \
+ static const struct resource rspi##idx##_resources[] __initconst = { \
+@@ -82,10 +94,7 @@ static void __init genmai_add_standard_devices(void)
+ r7s72100_clock_init();
+ r7s72100_add_dt_devices();
+
+- platform_device_register_resndata(&platform_bus, "r7s72100-ether", -1,
+- ether_resources,
+- ARRAY_SIZE(ether_resources),
+- &ether_pdata, sizeof(ether_pdata));
++ platform_device_register_full(&ether_info);
+
+ r7s72100_register_rspi(0);
+ r7s72100_register_rspi(1);
+--
+2.1.2
+
diff --git a/patches.renesas/0309-ARM-shmobile-Get-rid-of-legacy-KZM9D-defconfig.patch b/patches.renesas/0309-ARM-shmobile-Get-rid-of-legacy-KZM9D-defconfig.patch
new file mode 100644
index 00000000000000..0bc7db077a3447
--- /dev/null
+++ b/patches.renesas/0309-ARM-shmobile-Get-rid-of-legacy-KZM9D-defconfig.patch
@@ -0,0 +1,118 @@
+From ceb1e6b080fcf968f8f9f3ee29d4c558623b5fb9 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 13 Feb 2014 17:26:28 +0900
+Subject: ARM: shmobile: Get rid of legacy KZM9D defconfig
+
+Get rid of the kzm9d_defconfig. The KZM9D is now supported
+as DT only in case of EMEV2 is selected in the kernel
+configuration.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 30023bb4fae3eb30106c5f8986fc7ac87387aebc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/kzm9d_defconfig | 91 ----------------------------------------
+ 1 file changed, 91 deletions(-)
+ delete mode 100644 arch/arm/configs/kzm9d_defconfig
+
+diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig
+deleted file mode 100644
+index 1cc330b06bf6..000000000000
+--- a/arch/arm/configs/kzm9d_defconfig
++++ /dev/null
+@@ -1,91 +0,0 @@
+-# 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_PERF_EVENTS=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_LEGACY=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_AUTO_ZRELADDR=y
+-CONFIG_VFP=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_WIRELESS is not set
+-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+-CONFIG_DEVTMPFS=y
+-CONFIG_DEVTMPFS_MOUNT=y
+-# 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
+--
+2.1.2
+
diff --git a/patches.renesas/0310-ARM-shmobile-koelsch-Enable-SDHI-GPIO-and-regulators.patch b/patches.renesas/0310-ARM-shmobile-koelsch-Enable-SDHI-GPIO-and-regulators.patch
new file mode 100644
index 00000000000000..f9cbfd6decb601
--- /dev/null
+++ b/patches.renesas/0310-ARM-shmobile-koelsch-Enable-SDHI-GPIO-and-regulators.patch
@@ -0,0 +1,56 @@
+From 5784792a2f757b86549adb5d7c6bfea1281988e4 Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Thu, 13 Feb 2014 15:39:47 +0900
+Subject: ARM: shmobile: koelsch: Enable SDHI, GPIO and regulators in defconfig
+
+Enable the following:
+* regulators (needed for SDHI)
+* SDHI
+* GPIO
+* GPIO keys
+* GPIO LEDs
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 62f95adf45722e14338d80d2bcfce2e00ad86026)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/koelsch_defconfig | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/arch/arm/configs/koelsch_defconfig b/arch/arm/configs/koelsch_defconfig
+index 95611392a20e..86faab565a96 100644
+--- a/arch/arm/configs/koelsch_defconfig
++++ b/arch/arm/configs/koelsch_defconfig
+@@ -59,6 +59,7 @@ CONFIG_SH_ETH=y
+ # CONFIG_NET_VENDOR_VIA is not set
+ # CONFIG_NET_VENDOR_WIZNET is not set
+ # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
++CONFIG_KEYBOARD_GPIO=y
+ # CONFIG_INPUT_MOUSE is not set
+ # CONFIG_LEGACY_PTYS is not set
+ CONFIG_SERIAL_SH_SCI=y
+@@ -68,13 +69,21 @@ CONFIG_I2C=y
+ CONFIG_I2C_RCAR=y
+ CONFIG_SPI=y
+ CONFIG_SPI_RSPI=y
++CONFIG_GPIOLIB=y
++CONFIG_GPIO_RCAR=y
+ # CONFIG_HWMON is not set
+ CONFIG_THERMAL=y
+ CONFIG_RCAR_THERMAL=y
++CONFIG_REGULATOR=y
++CONFIG_REGULATOR_FIXED_VOLTAGE=y
++CONFIG_REGULATOR_GPIO=y
+ # CONFIG_HID is not set
+ # CONFIG_USB_SUPPORT is not set
++CONFIG_MMC=y
++CONFIG_MMC_SDHI=y
+ CONFIG_NEW_LEDS=y
+ CONFIG_LEDS_CLASS=y
++CONFIG_LEDS_GPIO=y
+ # CONFIG_IOMMU_SUPPORT is not set
+ # CONFIG_DNOTIFY is not set
+ CONFIG_TMPFS=y
+--
+2.1.2
+
diff --git a/patches.renesas/0311-ARM-shmobile-Remove-KZM9D-board-code.patch b/patches.renesas/0311-ARM-shmobile-Remove-KZM9D-board-code.patch
new file mode 100644
index 00000000000000..c3e93681269d5a
--- /dev/null
+++ b/patches.renesas/0311-ARM-shmobile-Remove-KZM9D-board-code.patch
@@ -0,0 +1,106 @@
+From 88202c18dd83fb741a05460ac153d305ee44ed26 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 17 Feb 2014 16:24:19 +0900
+Subject: ARM: shmobile: Remove KZM9D board code
+
+Get rid of KZM9D board code written in C. This version of the
+C board code was used in the case of multiplatform, but these
+days DT can be used instead, so because of that simply get rid
+of the C code to simplify and save space.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 1ee101d9c416823f960a4841ef81044d461034b5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 6 ----
+ arch/arm/mach-shmobile/Makefile | 1 -
+ arch/arm/mach-shmobile/board-kzm9d-reference.c | 47 --------------------------
+ 3 files changed, 54 deletions(-)
+ delete mode 100644 arch/arm/mach-shmobile/board-kzm9d-reference.c
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index deb6dc884bf0..2f5c6f319a71 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -47,12 +47,6 @@ config MACH_KOELSCH
+ depends on ARCH_R8A7791
+ select MICREL_PHY if SH_ETH
+
+-config MACH_KZM9D
+- bool "KZM9D board"
+- depends on ARCH_EMEV2
+- select REGULATOR_FIXED_VOLTAGE if REGULATOR
+- select SMSC_PHY if SMSC911X
+-
+ config MACH_LAGER
+ bool "Lager board"
+ depends on ARCH_R8A7790
+diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
+index fe7d4ff706e4..1402d602f5a4 100644
+--- a/arch/arm/mach-shmobile/Makefile
++++ b/arch/arm/mach-shmobile/Makefile
+@@ -58,7 +58,6 @@ obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
+ ifdef CONFIG_ARCH_SHMOBILE_MULTI
+ obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o
+ obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o
+-obj-$(CONFIG_MACH_KZM9D) += board-kzm9d-reference.o
+ obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o
+ else
+ obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o
+diff --git a/arch/arm/mach-shmobile/board-kzm9d-reference.c b/arch/arm/mach-shmobile/board-kzm9d-reference.c
+deleted file mode 100644
+index 853003c8988a..000000000000
+--- a/arch/arm/mach-shmobile/board-kzm9d-reference.c
++++ /dev/null
+@@ -1,47 +0,0 @@
+-/*
+- * kzm9d board support - Reference DT implementation
+- *
+- * Copyright (C) 2013 Renesas Solutions Corp.
+- * Copyright (C) 2013 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/of_platform.h>
+-#include <linux/clk-provider.h>
+-#include <mach/emev2.h>
+-#include <mach/common.h>
+-#include <asm/mach/arch.h>
+-
+-static void __init kzm9d_add_standard_devices(void)
+-{
+- of_clk_init(NULL);
+- of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+-}
+-
+-static const char *kzm9d_boards_compat_dt[] __initdata = {
+- "renesas,kzm9d",
+- "renesas,kzm9d-reference",
+- NULL,
+-};
+-
+-DT_MACHINE_START(KZM9D_DT, "kzm9d")
+- .smp = smp_ops(emev2_smp_ops),
+- .map_io = emev2_map_io,
+- .init_early = emev2_init_delay,
+- .init_machine = kzm9d_add_standard_devices,
+- .init_late = shmobile_init_late,
+- .dt_compat = kzm9d_boards_compat_dt,
+-MACHINE_END
+--
+2.1.2
+
diff --git a/patches.renesas/0312-ARM-shmobile-Remove-Koelsch-DT-reference-legacy-cloc.patch b/patches.renesas/0312-ARM-shmobile-Remove-Koelsch-DT-reference-legacy-cloc.patch
new file mode 100644
index 00000000000000..055455c9c1551f
--- /dev/null
+++ b/patches.renesas/0312-ARM-shmobile-Remove-Koelsch-DT-reference-legacy-cloc.patch
@@ -0,0 +1,44 @@
+From dd8c9b74ae07db85558e533fca30f83ee5b46bbf Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 17 Feb 2014 16:21:28 +0900
+Subject: ARM: shmobile: Remove Koelsch DT reference legacy clock bits
+
+Koelsch DT reference is these days built for multiplatform
+only which means that CCF comes with the package. Remove
+unused legacy code ifdefs to clean up the code.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 34b6a241de1d965b1c047a97fad602687218a866)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-koelsch-reference.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
+index 267fe8358cfe..a3fd30242bd8 100644
+--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
++++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
+@@ -84,7 +84,6 @@ static void __init koelsch_add_du_device(void)
+
+ static void __init koelsch_add_standard_devices(void)
+ {
+-#ifdef CONFIG_COMMON_CLK
+ /*
+ * This is a really crude hack to provide clkdev support to the CMT and
+ * DU devices until they get moved to DT.
+@@ -125,9 +124,7 @@ static void __init koelsch_add_standard_devices(void)
+ clk_put(clk);
+ }
+ }
+-#else
+- r8a7791_clock_init();
+-#endif
++
+ r8a7791_add_dt_devices();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0313-ARM-shmobile-Remove-Lager-DT-reference-legacy-clock-.patch b/patches.renesas/0313-ARM-shmobile-Remove-Lager-DT-reference-legacy-clock-.patch
new file mode 100644
index 00000000000000..c3bc50999c5a74
--- /dev/null
+++ b/patches.renesas/0313-ARM-shmobile-Remove-Lager-DT-reference-legacy-clock-.patch
@@ -0,0 +1,43 @@
+From 3924d1936ab4b8b75458844ec1b86a5608a07f6e Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 17 Feb 2014 16:19:45 +0900
+Subject: ARM: shmobile: Remove Lager DT reference legacy clock bits
+
+Lager DT reference is these days built for multiplatform
+only which means that CCF comes with the package. Remove
+unused legacy code ifdefs to clean up the code.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 6197c08ab81cf1430cbe7346fd6ca0b5a18580bf)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager-reference.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
+index 6ba8b3b41609..440aac36d693 100644
+--- a/arch/arm/mach-shmobile/board-lager-reference.c
++++ b/arch/arm/mach-shmobile/board-lager-reference.c
+@@ -88,7 +88,6 @@ static void __init lager_add_du_device(void)
+
+ static void __init lager_add_standard_devices(void)
+ {
+-#ifdef CONFIG_COMMON_CLK
+ /*
+ * This is a really crude hack to provide clkdev support to platform
+ * devices until they get moved to DT.
+@@ -126,9 +125,6 @@ static void __init lager_add_standard_devices(void)
+ clk_put(clk);
+ }
+ }
+-#else
+- r8a7790_clock_init();
+-#endif
+
+ r8a7790_add_dt_devices();
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+--
+2.1.2
+
diff --git a/patches.renesas/0314-ARM-shmobile-r8a7791-add-i2c-master-nodes-to-dtsi.patch b/patches.renesas/0314-ARM-shmobile-r8a7791-add-i2c-master-nodes-to-dtsi.patch
new file mode 100644
index 00000000000000..e58b66371be42d
--- /dev/null
+++ b/patches.renesas/0314-ARM-shmobile-r8a7791-add-i2c-master-nodes-to-dtsi.patch
@@ -0,0 +1,104 @@
+From 4f0e0162dd52c97f44ef16628e984ebadd5af79c Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 17 Feb 2014 11:44:41 +0100
+Subject: ARM: shmobile: r8a7791: add i2c master nodes to dtsi
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 5bd3de7ba7b28c885d534260800693fe57e55ec8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 69 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 69 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 41194fe18c3c..1ab4f3d5a8c2 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -19,6 +19,15 @@
+ #address-cells = <2>;
+ #size-cells = <2>;
+
++ aliases {
++ i2c0 = &i2c0;
++ i2c1 = &i2c1;
++ i2c2 = &i2c2;
++ i2c3 = &i2c3;
++ i2c4 = &i2c4;
++ i2c5 = &i2c5;
++ };
++
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+@@ -170,6 +179,66 @@
+ <0 17 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
++ i2c0: i2c@e6508000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6508000 0 0x40>;
++ interrupts = <0 287 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C0>;
++ status = "disabled";
++ };
++
++ i2c1: i2c@e6518000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6518000 0 0x40>;
++ interrupts = <0 288 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C1>;
++ status = "disabled";
++ };
++
++ i2c2: i2c@e6530000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6530000 0 0x40>;
++ interrupts = <0 286 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C2>;
++ status = "disabled";
++ };
++
++ i2c3: i2c@e6540000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6540000 0 0x40>;
++ interrupts = <0 290 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C3>;
++ status = "disabled";
++ };
++
++ i2c4: i2c@e6520000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6520000 0 0x40>;
++ interrupts = <0 19 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C4>;
++ status = "disabled";
++ };
++
++ i2c5: i2c@e6528000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,i2c-r8a7791";
++ reg = <0 0xe6528000 0 0x40>;
++ interrupts = <0 20 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp9_clks R8A7791_CLK_I2C5>;
++ status = "disabled";
++ };
++
+ pfc: pfc@e6060000 {
+ compatible = "renesas,pfc-r8a7791";
+ reg = <0 0xe6060000 0 0x250>;
+--
+2.1.2
+
diff --git a/patches.renesas/0315-ARM-shmobile-r8a7791-add-i2c2-bus-to-koelsch-dt.patch b/patches.renesas/0315-ARM-shmobile-r8a7791-add-i2c2-bus-to-koelsch-dt.patch
new file mode 100644
index 00000000000000..9e5e51abc17a0e
--- /dev/null
+++ b/patches.renesas/0315-ARM-shmobile-r8a7791-add-i2c2-bus-to-koelsch-dt.patch
@@ -0,0 +1,53 @@
+From 5507755d638c2adef9307dad002fbd9c4e42b4a0 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 17 Feb 2014 11:44:42 +0100
+Subject: ARM: shmobile: r8a7791: add i2c2 bus to koelsch dt
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+[horms+renesas@verge.net.au: resolved conflict]
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 38c53516729925d2123ed800e5f4182d77e450a6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index f67d2d0abded..bf6ba0c7faa0 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -108,10 +108,29 @@
+ clock-frequency = <20000000>;
+ };
+
++&i2c2 {
++ pinctrl-0 = <&i2c2_pins>;
++ pinctrl-names = "default";
++
++ status = "okay";
++ clock-frequency = <400000>;
++
++ eeprom@50 {
++ compatible = "renesas,24c02";
++ reg = <0x50>;
++ pagesize = <16>;
++ };
++};
++
+ &pfc {
+ pinctrl-0 = <&du_pins &scif0_pins &scif1_pins>;
+ pinctrl-names = "default";
+
++ i2c2_pins: i2c {
++ renesas,groups = "i2c2";
++ renesas,function = "i2c2";
++ };
++
+ du_pins: du {
+ renesas,groups = "du_rgb666", "du_sync", "du_clk_out_0";
+ renesas,function = "du";
+--
+2.1.2
+
diff --git a/patches.renesas/0316-ARM-shmobile-r7s72100-add-nodes-for-i2c-controllers-.patch b/patches.renesas/0316-ARM-shmobile-r7s72100-add-nodes-for-i2c-controllers-.patch
new file mode 100644
index 00000000000000..d5a20e1abad2f9
--- /dev/null
+++ b/patches.renesas/0316-ARM-shmobile-r7s72100-add-nodes-for-i2c-controllers-.patch
@@ -0,0 +1,107 @@
+From 04709d6d5eee52219e01c9983ec1e80c1916a806 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 17 Feb 2014 22:19:17 +0100
+Subject: ARM: shmobile: r7s72100: add nodes for i2c controllers to dtsi
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c81a4d3dfd33e097d3eef89e4eb830effb8b8d31)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r7s72100.dtsi | 72 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
+index 9be67a16fc6f..ee700717a34b 100644
+--- a/arch/arm/boot/dts/r7s72100.dtsi
++++ b/arch/arm/boot/dts/r7s72100.dtsi
+@@ -17,6 +17,10 @@
+ #size-cells = <1>;
+
+ aliases {
++ i2c0 = &i2c0;
++ i2c1 = &i2c1;
++ i2c2 = &i2c2;
++ i2c3 = &i2c3;
+ spi0 = &spi0;
+ spi1 = &spi1;
+ spi2 = &spi2;
+@@ -44,6 +48,74 @@
+ <0xe8202000 0x1000>;
+ };
+
++ i2c0: i2c@fcfee000 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
++ reg = <0xfcfee000 0x44>;
++ interrupts = <0 157 IRQ_TYPE_LEVEL_HIGH>,
++ <0 158 IRQ_TYPE_EDGE_RISING>,
++ <0 159 IRQ_TYPE_EDGE_RISING>,
++ <0 160 IRQ_TYPE_LEVEL_HIGH>,
++ <0 161 IRQ_TYPE_LEVEL_HIGH>,
++ <0 162 IRQ_TYPE_LEVEL_HIGH>,
++ <0 163 IRQ_TYPE_LEVEL_HIGH>,
++ <0 164 IRQ_TYPE_LEVEL_HIGH>;
++ clock-frequency = <100000>;
++ status = "disabled";
++ };
++
++ i2c1: i2c@fcfee400 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
++ reg = <0xfcfee400 0x44>;
++ interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>,
++ <0 166 IRQ_TYPE_EDGE_RISING>,
++ <0 167 IRQ_TYPE_EDGE_RISING>,
++ <0 168 IRQ_TYPE_LEVEL_HIGH>,
++ <0 169 IRQ_TYPE_LEVEL_HIGH>,
++ <0 170 IRQ_TYPE_LEVEL_HIGH>,
++ <0 171 IRQ_TYPE_LEVEL_HIGH>,
++ <0 172 IRQ_TYPE_LEVEL_HIGH>;
++ clock-frequency = <100000>;
++ status = "disabled";
++ };
++
++ i2c2: i2c@fcfee800 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
++ reg = <0xfcfee800 0x44>;
++ interrupts = <0 173 IRQ_TYPE_LEVEL_HIGH>,
++ <0 174 IRQ_TYPE_EDGE_RISING>,
++ <0 175 IRQ_TYPE_EDGE_RISING>,
++ <0 176 IRQ_TYPE_LEVEL_HIGH>,
++ <0 177 IRQ_TYPE_LEVEL_HIGH>,
++ <0 178 IRQ_TYPE_LEVEL_HIGH>,
++ <0 179 IRQ_TYPE_LEVEL_HIGH>,
++ <0 180 IRQ_TYPE_LEVEL_HIGH>;
++ clock-frequency = <100000>;
++ status = "disabled";
++ };
++
++ i2c3: i2c@fcfeec00 {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ compatible = "renesas,riic-r7s72100", "renesas,riic-rz";
++ reg = <0xfcfeec00 0x44>;
++ interrupts = <0 181 IRQ_TYPE_LEVEL_HIGH>,
++ <0 182 IRQ_TYPE_EDGE_RISING>,
++ <0 183 IRQ_TYPE_EDGE_RISING>,
++ <0 184 IRQ_TYPE_LEVEL_HIGH>,
++ <0 185 IRQ_TYPE_LEVEL_HIGH>,
++ <0 186 IRQ_TYPE_LEVEL_HIGH>,
++ <0 187 IRQ_TYPE_LEVEL_HIGH>,
++ <0 188 IRQ_TYPE_LEVEL_HIGH>;
++ clock-frequency = <100000>;
++ status = "disabled";
++ };
++
+ spi0: spi@e800c800 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800c800 0x24>;
+--
+2.1.2
+
diff --git a/patches.renesas/0317-ARM-shmobile-genmai-adapt-dts-to-use-native-i2c-driv.patch b/patches.renesas/0317-ARM-shmobile-genmai-adapt-dts-to-use-native-i2c-driv.patch
new file mode 100644
index 00000000000000..31ee59fc6254b1
--- /dev/null
+++ b/patches.renesas/0317-ARM-shmobile-genmai-adapt-dts-to-use-native-i2c-driv.patch
@@ -0,0 +1,39 @@
+From 4680eeab02046c0d994c74c0d67d4dd516731f6b Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 17 Feb 2014 22:19:18 +0100
+Subject: ARM: shmobile: genmai: adapt dts to use native i2c driver
+
+Activate the shiny new riic driver for i2c2. Tested by accessing the
+eeprom on the genmai board.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 367aaaea1d6c6496695ffd06b49590b8cfcb8aa5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r7s72100-genmai-reference.dts | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+index 0849017e9d2f..e664611a47c8 100644
+--- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
++++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+@@ -29,3 +29,14 @@
+ #size-cells = <1>;
+ };
+ };
++
++&i2c2 {
++ status = "okay";
++ clock-frequency = <400000>;
++
++ eeprom@50 {
++ compatible = "renesas,24c128";
++ reg = <0x50>;
++ pagesize = <64>;
++ };
++};
+--
+2.1.2
+
diff --git a/patches.renesas/0318-ARM-shmobile-r7s72100-update-defconfig-for-I2C-usage.patch b/patches.renesas/0318-ARM-shmobile-r7s72100-update-defconfig-for-I2C-usage.patch
new file mode 100644
index 00000000000000..d02cfca74fb3d6
--- /dev/null
+++ b/patches.renesas/0318-ARM-shmobile-r7s72100-update-defconfig-for-I2C-usage.patch
@@ -0,0 +1,42 @@
+From 1090b7547952ed11da187c16b48940c32f18ff56 Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Mon, 17 Feb 2014 22:19:19 +0100
+Subject: ARM: shmobile: r7s72100: update defconfig for I2C usage
+
+Select the correct I2C driver and activate EEPROM support to have a
+slave device for testing. Also activate i2c-dev, so i2c-tools will work.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 7573e89ba1fcbe492c52d5b1e72fcf5d23da21d1)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/configs/genmai_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/configs/genmai_defconfig b/arch/arm/configs/genmai_defconfig
+index 5ee6ac0931f7..d238fafb6762 100644
+--- a/arch/arm/configs/genmai_defconfig
++++ b/arch/arm/configs/genmai_defconfig
+@@ -52,6 +52,7 @@ CONFIG_IP_PNP_DHCP=y
+ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+ CONFIG_DEVTMPFS=y
+ CONFIG_DEVTMPFS_MOUNT=y
++CONFIG_EEPROM_AT24=y
+ CONFIG_NETDEVICES=y
+ # CONFIG_NET_CORE is not set
+ # CONFIG_NET_VENDOR_ARC is not set
+@@ -80,7 +81,8 @@ CONFIG_SERIAL_SH_SCI=y
+ CONFIG_SERIAL_SH_SCI_NR_UARTS=10
+ CONFIG_SERIAL_SH_SCI_CONSOLE=y
+ # CONFIG_HW_RANDOM is not set
+-CONFIG_I2C_SH_MOBILE=y
++CONFIG_I2C_CHARDEV=y
++CONFIG_I2C_RIIC=y
+ CONFIG_SPI=y
+ CONFIG_SPI_RSPI=y
+ # CONFIG_HWMON is not set
+--
+2.1.2
+
diff --git a/patches.renesas/0319-usb-host-remove-selects-of-USB_ARCH_HAS_-HCI.patch b/patches.renesas/0319-usb-host-remove-selects-of-USB_ARCH_HAS_-HCI.patch
new file mode 100644
index 00000000000000..0028c54d7174b4
--- /dev/null
+++ b/patches.renesas/0319-usb-host-remove-selects-of-USB_ARCH_HAS_-HCI.patch
@@ -0,0 +1,310 @@
+From 3c89ce3c9e853c91d9ab004a3021e66c708df310 Mon Sep 17 00:00:00 2001
+From: Paul Bolle <pebolle@tiscali.nl>
+Date: Sun, 16 Feb 2014 20:46:20 +0100
+Subject: usb: host: remove selects of USB_ARCH_HAS_?HCI
+
+USB_ARCH_HAS_EHCI, USB_ARCH_HAS_OHCI, and USB_ARCH_HAS_XHCI were just
+removed. Selecting them is a nop. The select statements for these
+symbols can be removed too.
+
+Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit f6723b569a67aa4042b4ddc72822bf7f4395f3d2)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/Kconfig | 3 ---
+ arch/arm/mach-exynos/Kconfig | 1 -
+ arch/arm/mach-omap2/Kconfig | 2 --
+ arch/arm/mach-shmobile/Kconfig | 4 ----
+ arch/arm/mach-tegra/Kconfig | 1 -
+ arch/mips/Kconfig | 7 -------
+ arch/mips/ath79/Kconfig | 8 --------
+ arch/mips/ralink/Kconfig | 6 ------
+ arch/powerpc/platforms/44x/Kconfig | 1 -
+ arch/powerpc/platforms/ps3/Kconfig | 2 --
+ arch/sh/Kconfig | 9 ---------
+ 11 files changed, 44 deletions(-)
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 4733d327cfb1..3d58483486c1 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -535,7 +535,6 @@ config ARCH_DOVE
+ select PINCTRL
+ select PINCTRL_DOVE
+ select PLAT_ORION_LEGACY
+- select USB_ARCH_HAS_EHCI
+ help
+ Support for the Marvell Dove SoC 88AP510
+
+@@ -634,7 +633,6 @@ config ARCH_LPC32XX
+ select GENERIC_CLOCKEVENTS
+ select HAVE_IDE
+ select HAVE_PWM
+- select USB_ARCH_HAS_OHCI
+ select USE_OF
+ help
+ Support for the NXP LPC32XX family of processors
+@@ -771,7 +769,6 @@ config ARCH_S3C64XX
+ select SAMSUNG_ATAGS
+ select SAMSUNG_WAKEMASK
+ select SAMSUNG_WDT_RESET
+- select USB_ARCH_HAS_OHCI
+ help
+ Samsung S3C64XX series based systems
+
+diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
+index 4c414af75ef0..8d197dcdd2c0 100644
+--- a/arch/arm/mach-exynos/Kconfig
++++ b/arch/arm/mach-exynos/Kconfig
+@@ -36,7 +36,6 @@ config ARCH_EXYNOS5
+ select HAVE_ARM_SCU if SMP
+ select HAVE_SMP
+ select PINCTRL
+- select USB_ARCH_HAS_XHCI
+ help
+ Samsung EXYNOS5 (Cortex-A15) SoC based systems
+
+diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
+index 0af7ca02314d..6fb91fb604a0 100644
+--- a/arch/arm/mach-omap2/Kconfig
++++ b/arch/arm/mach-omap2/Kconfig
+@@ -21,7 +21,6 @@ config ARCH_OMAP3
+ select PM_OPP if PM
+ select PM_RUNTIME if CPU_IDLE
+ select SOC_HAS_OMAP2_SDRC
+- select USB_ARCH_HAS_EHCI if USB_SUPPORT
+
+ config ARCH_OMAP4
+ bool "TI OMAP4"
+@@ -42,7 +41,6 @@ config ARCH_OMAP4
+ select PL310_ERRATA_727915
+ select PM_OPP if PM
+ select PM_RUNTIME if CPU_IDLE
+- select USB_ARCH_HAS_EHCI if USB_SUPPORT
+ select ARM_ERRATA_754322
+ select ARM_ERRATA_775420
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 2f5c6f319a71..5e3fb956ff08 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -99,8 +99,6 @@ config ARCH_R8A7778
+ select CPU_V7
+ select SH_CLK_CPG
+ select ARM_GIC
+- select USB_ARCH_HAS_EHCI
+- select USB_ARCH_HAS_OHCI
+
+ config ARCH_R8A7779
+ bool "R-Car H1 (R8A77790)"
+@@ -108,8 +106,6 @@ config ARCH_R8A7779
+ select ARM_GIC
+ select CPU_V7
+ select SH_CLK_CPG
+- select USB_ARCH_HAS_EHCI
+- select USB_ARCH_HAS_OHCI
+ select RENESAS_INTC_IRQPIN
+
+ config ARCH_R8A7790
+diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
+index b1232d8be6f5..4926bd11f190 100644
+--- a/arch/arm/mach-tegra/Kconfig
++++ b/arch/arm/mach-tegra/Kconfig
+@@ -19,7 +19,6 @@ config ARCH_TEGRA
+ select RESET_CONTROLLER
+ select SOC_BUS
+ select SPARSE_IRQ
+- select USB_ARCH_HAS_EHCI if USB_SUPPORT
+ select USB_ULPI if USB_PHY
+ select USB_ULPI_VIEWPORT if USB_PHY
+ select USE_OF
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
+index 95fa1f1d5c8b..cb1da372346c 100644
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -67,8 +67,6 @@ config MIPS_ALCHEMY
+ select SYS_SUPPORTS_APM_EMULATION
+ select ARCH_REQUIRE_GPIOLIB
+ select SYS_SUPPORTS_ZBOOT
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+
+ config AR7
+ bool "Texas Instruments AR7"
+@@ -360,7 +358,6 @@ config MIPS_SEAD3
+ select SYS_SUPPORTS_LITTLE_ENDIAN
+ select SYS_SUPPORTS_SMARTMIPS
+ select SYS_SUPPORTS_MICROMIPS
+- select USB_ARCH_HAS_EHCI
+ select USB_EHCI_BIG_ENDIAN_DESC
+ select USB_EHCI_BIG_ENDIAN_MMIO
+ select USE_OF
+@@ -718,8 +715,6 @@ config CAVIUM_OCTEON_SOC
+ select SWAP_IO_SPACE
+ select HW_HAS_PCI
+ select ZONE_DMA32
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+ select HOLES_IN_ZONE
+ select ARCH_REQUIRE_GPIOLIB
+ help
+@@ -756,8 +751,6 @@ config NLM_XLR_BOARD
+ select ZONE_DMA32 if 64BIT
+ select SYNC_R4K
+ select SYS_HAS_EARLY_PRINTK
+- select USB_ARCH_HAS_OHCI if USB_SUPPORT
+- select USB_ARCH_HAS_EHCI if USB_SUPPORT
+ select SYS_SUPPORTS_ZBOOT
+ select SYS_SUPPORTS_ZBOOT_UART16550
+ help
+diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig
+index 3995e31a73e2..dfc60209dc63 100644
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -74,34 +74,26 @@ config ATH79_MACH_UBNT_XM
+ endmenu
+
+ config SOC_AR71XX
+- select USB_ARCH_HAS_EHCI
+- select USB_ARCH_HAS_OHCI
+ select HW_HAS_PCI
+ def_bool n
+
+ config SOC_AR724X
+- select USB_ARCH_HAS_EHCI
+- select USB_ARCH_HAS_OHCI
+ select HW_HAS_PCI
+ select PCI_AR724X if PCI
+ def_bool n
+
+ config SOC_AR913X
+- select USB_ARCH_HAS_EHCI
+ def_bool n
+
+ config SOC_AR933X
+- select USB_ARCH_HAS_EHCI
+ def_bool n
+
+ config SOC_AR934X
+- select USB_ARCH_HAS_EHCI
+ select HW_HAS_PCI
+ select PCI_AR724X if PCI
+ def_bool n
+
+ config SOC_QCA955X
+- select USB_ARCH_HAS_EHCI
+ select HW_HAS_PCI
+ select PCI_AR724X if PCI
+ def_bool n
+diff --git a/arch/mips/ralink/Kconfig b/arch/mips/ralink/Kconfig
+index 1bfd1c17b3c2..4a296655f446 100644
+--- a/arch/mips/ralink/Kconfig
++++ b/arch/mips/ralink/Kconfig
+@@ -20,19 +20,13 @@ choice
+ config SOC_RT305X
+ bool "RT305x"
+ select USB_ARCH_HAS_HCD
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+
+ config SOC_RT3883
+ bool "RT3883"
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+ select HW_HAS_PCI
+
+ config SOC_MT7620
+ bool "MT7620"
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+
+ endchoice
+
+diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
+index d6c7506ec7d9..dc1a264ec6e6 100644
+--- a/arch/powerpc/platforms/44x/Kconfig
++++ b/arch/powerpc/platforms/44x/Kconfig
+@@ -265,7 +265,6 @@ config 440EP
+ select PPC_FPU
+ select IBM440EP_ERR42
+ select IBM_EMAC_ZMII
+- select USB_ARCH_HAS_OHCI
+
+ config 440EPX
+ bool
+diff --git a/arch/powerpc/platforms/ps3/Kconfig b/arch/powerpc/platforms/ps3/Kconfig
+index e87c19473973..56f274064d6c 100644
+--- a/arch/powerpc/platforms/ps3/Kconfig
++++ b/arch/powerpc/platforms/ps3/Kconfig
+@@ -2,10 +2,8 @@ config PPC_PS3
+ bool "Sony PS3"
+ depends on PPC64 && PPC_BOOK3S
+ select PPC_CELL
+- select USB_ARCH_HAS_OHCI
+ select USB_OHCI_LITTLE_ENDIAN
+ select USB_OHCI_BIG_ENDIAN_MMIO
+- select USB_ARCH_HAS_EHCI
+ select USB_EHCI_BIG_ENDIAN_MMIO
+ select PPC_PCI_CHOICE
+ help
+diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
+index 6357710753d5..64455daa63a1 100644
+--- a/arch/sh/Kconfig
++++ b/arch/sh/Kconfig
+@@ -356,7 +356,6 @@ config CPU_SUBTYPE_SH7720
+ select CPU_HAS_DSP
+ select SYS_SUPPORTS_CMT
+ select ARCH_WANT_OPTIONAL_GPIOLIB
+- select USB_ARCH_HAS_OHCI
+ select USB_OHCI_SH if USB_OHCI_HCD
+ select PINCTRL
+ help
+@@ -367,7 +366,6 @@ config CPU_SUBTYPE_SH7721
+ select CPU_SH3
+ select CPU_HAS_DSP
+ select SYS_SUPPORTS_CMT
+- select USB_ARCH_HAS_OHCI
+ select USB_OHCI_SH if USB_OHCI_HCD
+ help
+ Select SH7721 if you have a SH3-DSP SH7721 CPU.
+@@ -445,8 +443,6 @@ config CPU_SUBTYPE_SH7734
+ select CPU_SH4A
+ select CPU_SHX2
+ select ARCH_WANT_OPTIONAL_GPIOLIB
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+ select PINCTRL
+ help
+ Select SH7734 if you have a SH4A SH7734 CPU.
+@@ -456,8 +452,6 @@ config CPU_SUBTYPE_SH7757
+ select CPU_SH4A
+ select CPU_SHX2
+ select ARCH_WANT_OPTIONAL_GPIOLIB
+- select USB_ARCH_HAS_OHCI
+- select USB_ARCH_HAS_EHCI
+ select PINCTRL
+ help
+ Select SH7757 if you have a SH4A SH7757 CPU.
+@@ -465,7 +459,6 @@ config CPU_SUBTYPE_SH7757
+ config CPU_SUBTYPE_SH7763
+ bool "Support SH7763 processor"
+ select CPU_SH4A
+- select USB_ARCH_HAS_OHCI
+ select USB_OHCI_SH if USB_OHCI_HCD
+ help
+ Select SH7763 if you have a SH4A SH7763(R5S77631) CPU.
+@@ -494,9 +487,7 @@ config CPU_SUBTYPE_SH7786
+ select CPU_HAS_PTEAEX
+ select GENERIC_CLOCKEVENTS_BROADCAST if SMP
+ select ARCH_WANT_OPTIONAL_GPIOLIB
+- select USB_ARCH_HAS_OHCI
+ select USB_OHCI_SH if USB_OHCI_HCD
+- select USB_ARCH_HAS_EHCI
+ select USB_EHCI_SH if USB_EHCI_HCD
+ select PINCTRL
+
+--
+2.1.2
+
diff --git a/patches.renesas/0320-ARM-centralize-common-multi-platform-kconfig-options.patch b/patches.renesas/0320-ARM-centralize-common-multi-platform-kconfig-options.patch
new file mode 100644
index 00000000000000..c6baa82b4c6dc2
--- /dev/null
+++ b/patches.renesas/0320-ARM-centralize-common-multi-platform-kconfig-options.patch
@@ -0,0 +1,768 @@
+From e883df7b70824763bae3860cfcbbaffef6b5da94 Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh@kernel.org>
+Date: Fri, 22 Nov 2013 09:29:37 -0600
+Subject: ARM: centralize common multi-platform kconfig options
+
+Multi-platform requires various kconfig options to be selected, so
+platforms don't need to select them individually.
+
+Signed-off-by: Rob Herring <robh@kernel.org>
+Acked-by: Linus Walleij <linus.walleij@linaro.org>
+Cc: Russell King <linux@arm.linux.org.uk>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Tested-by: Stephen Warren <swarren@wwwdotorg.org>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+(cherry picked from commit ddb902cc34593ecb88c368f6e15db3cf829c56fe)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+Conflicts:
+ arch/arm/mach-omap2/Kconfig
+ arch/arm/mach-tegra/Kconfig
+---
+ arch/arm/Kconfig | 2 ++
+ arch/arm/mach-bcm/Kconfig | 5 -----
+ arch/arm/mach-bcm2835/Kconfig | 3 ---
+ arch/arm/mach-berlin/Kconfig | 3 ---
+ arch/arm/mach-cns3xxx/Kconfig | 1 -
+ arch/arm/mach-highbank/Kconfig | 6 ------
+ arch/arm/mach-hisi/Kconfig | 3 ---
+ arch/arm/mach-imx/Kconfig | 11 -----------
+ arch/arm/mach-keystone/Kconfig | 3 ---
+ arch/arm/mach-moxart/Kconfig | 5 -----
+ arch/arm/mach-mvebu/Kconfig | 5 -----
+ arch/arm/mach-mxs/Kconfig | 4 ----
+ arch/arm/mach-nomadik/Kconfig | 5 -----
+ arch/arm/mach-nspire/Kconfig | 5 -----
+ arch/arm/mach-omap2/Kconfig | 15 ---------------
+ arch/arm/mach-picoxcell/Kconfig | 4 ----
+ arch/arm/mach-prima2/Kconfig | 4 ----
+ arch/arm/mach-rockchip/Kconfig | 2 --
+ arch/arm/mach-shmobile/Kconfig | 3 ---
+ arch/arm/mach-socfpga/Kconfig | 6 ------
+ arch/arm/mach-spear/Kconfig | 8 --------
+ arch/arm/mach-sti/Kconfig | 2 --
+ arch/arm/mach-sunxi/Kconfig | 4 ----
+ arch/arm/mach-tegra/Kconfig | 6 ------
+ arch/arm/mach-u300/Kconfig | 6 ------
+ arch/arm/mach-ux500/Kconfig | 4 ----
+ arch/arm/mach-vexpress/Kconfig | 3 ---
+ arch/arm/mach-virt/Kconfig | 4 ----
+ arch/arm/mach-vt8500/Kconfig | 3 ---
+ arch/arm/mach-zynq/Kconfig | 5 -----
+ 30 files changed, 2 insertions(+), 138 deletions(-)
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 3d58483486c1..f7717d4ce420 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -307,9 +307,11 @@ choice
+ config ARCH_MULTIPLATFORM
+ bool "Allow multiple platforms to be selected"
+ depends on MMU
++ select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_PATCH_PHYS_VIRT
+ select AUTO_ZRELADDR
+ select COMMON_CLK
++ select GENERIC_CLOCKEVENTS
+ select MULTI_IRQ_HANDLER
+ select SPARSE_IRQ
+ select USE_OF
+diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
+index b1aa6a9b3bd1..af4f2dfda40c 100644
+--- a/arch/arm/mach-bcm/Kconfig
++++ b/arch/arm/mach-bcm/Kconfig
+@@ -16,12 +16,7 @@ config ARCH_BCM_MOBILE
+ select ARM_ERRATA_754322
+ select ARM_ERRATA_764369 if SMP
+ select ARM_GIC
+- select CPU_V7
+- select CLKSRC_OF
+- select GENERIC_CLOCKEVENTS
+- select GENERIC_TIME
+ select GPIO_BCM_KONA
+- select SPARSE_IRQ
+ select TICK_ONESHOT
+ select CACHE_L2X0
+ select HAVE_ARM_ARCH_TIMER
+diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig
+index d1f9612f8c15..1c0decd7e07a 100644
+--- a/arch/arm/mach-bcm2835/Kconfig
++++ b/arch/arm/mach-bcm2835/Kconfig
+@@ -4,10 +4,7 @@ config ARCH_BCM2835
+ select ARM_AMBA
+ select ARM_ERRATA_411920
+ select ARM_TIMER_SP804
+- select CLKDEV_LOOKUP
+- select CLKSRC_OF
+ select CPU_V6
+- select GENERIC_CLOCKEVENTS
+ select PINCTRL
+ select PINCTRL_BCM2835
+ help
+diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig
+index 7a02d222c378..b346f598a595 100644
+--- a/arch/arm/mach-berlin/Kconfig
++++ b/arch/arm/mach-berlin/Kconfig
+@@ -1,9 +1,7 @@
+ config ARCH_BERLIN
+ bool "Marvell Berlin SoCs" if ARCH_MULTI_V7
+ select ARM_GIC
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+- select COMMON_CLK
+ select DW_APB_ICTL
+ select DW_APB_TIMER_OF
+
+@@ -21,7 +19,6 @@ config MACH_BERLIN_BG2
+ config MACH_BERLIN_BG2CD
+ bool "Marvell Armada 1500-mini (BG2CD)"
+ select CACHE_L2X0
+- select CPU_V7
+ select HAVE_ARM_TWD if SMP
+
+ endmenu
+diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
+index dbf0df8bb0ac..e3466887f62c 100644
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -2,7 +2,6 @@ config ARCH_CNS3XXX
+ bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
+ select ARM_GIC
+ select CPU_V6K
+- select GENERIC_CLOCKEVENTS
+ select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+ select PCI_DOMAINS if PCI
+diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
+index 0aded64a9ebc..59274a7fd7c5 100644
+--- a/arch/arm/mach-highbank/Kconfig
++++ b/arch/arm/mach-highbank/Kconfig
+@@ -5,7 +5,6 @@ config ARCH_HIGHBANK
+ select ARCH_HAS_HOLES_MEMORYMODEL
+ select ARCH_HAS_OPP
+ select ARCH_SUPPORTS_BIG_ENDIAN
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_AMBA
+ select ARM_ERRATA_764369 if SMP
+ select ARM_ERRATA_775420
+@@ -14,14 +13,9 @@ config ARCH_HIGHBANK
+ select ARM_PSCI
+ select ARM_TIMER_SP804
+ select CACHE_L2X0
+- select COMMON_CLK
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+ select MAILBOX
+ select PL320_MBOX
+- select SPARSE_IRQ
+- select USE_OF
+ select ZONE_DMA if ARM_LPAE
+diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
+index 1abae5f6a418..95492d715166 100644
+--- a/arch/arm/mach-hisi/Kconfig
++++ b/arch/arm/mach-hisi/Kconfig
+@@ -3,10 +3,7 @@ config ARCH_HI3xxx
+ select ARM_AMBA
+ select ARM_GIC
+ select ARM_TIMER_SP804
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+ select CACHE_L2X0
+- select CLKSRC_OF
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
+index 33567aa5880f..3dd2c601fea2 100644
+--- a/arch/arm/mach-imx/Kconfig
++++ b/arch/arm/mach-imx/Kconfig
+@@ -2,18 +2,12 @@ config ARCH_MXC
+ bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_CPU_SUSPEND if PM
+- select ARM_PATCH_PHYS_VIRT
+ select CLKSRC_MMIO
+- select COMMON_CLK
+ select GENERIC_ALLOCATOR
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+ select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
+- select MULTI_IRQ_HANDLER
+ select PINCTRL
+ select SOC_BUS
+- select SPARSE_IRQ
+- select USE_OF
+ help
+ Support for Freescale MXC/iMX-based family of processors
+
+@@ -132,7 +126,6 @@ config SOC_IMX5
+ select ARCH_HAS_CPUFREQ
+ select ARCH_HAS_OPP
+ select ARCH_MXC_IOMUX_V3
+- select CPU_V7
+ select MXC_TZIC
+
+ config SOC_IMX51
+@@ -792,7 +785,6 @@ config SOC_IMX6Q
+ select ARM_ERRATA_764369 if SMP
+ select ARM_ERRATA_775420
+ select ARM_GIC
+- select CPU_V7
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_IMX_ANATOP
+@@ -817,7 +809,6 @@ config SOC_IMX6SL
+ select ARM_ERRATA_754322
+ select ARM_ERRATA_775420
+ select ARM_GIC
+- select CPU_V7
+ select HAVE_IMX_ANATOP
+ select HAVE_IMX_GPC
+ select HAVE_IMX_MMDC
+@@ -833,9 +824,7 @@ config SOC_IMX6SL
+
+ config SOC_VF610
+ bool "Vybrid Family VF610 support"
+- select CPU_V7
+ select ARM_GIC
+- select CLKSRC_OF
+ select PINCTRL_VF610
+ select VF_PIT_TIMER
+ select PL310_ERRATA_588369 if CACHE_PL310
+diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
+index 90a708fef541..00ed74473eaf 100644
+--- a/arch/arm/mach-keystone/Kconfig
++++ b/arch/arm/mach-keystone/Kconfig
+@@ -1,13 +1,10 @@
+ config ARCH_KEYSTONE
+ bool "Texas Instruments Keystone Devices"
+ depends on ARCH_MULTI_V7
+- select CPU_V7
+ select ARM_GIC
+ select HAVE_ARM_ARCH_TIMER
+ select HAVE_SMP
+ select CLKSRC_MMIO
+- select GENERIC_CLOCKEVENTS
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_ERRATA_798181 if SMP
+ select COMMON_CLK_KEYSTONE
+ select ARCH_SUPPORTS_BIG_ENDIAN
+diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
+index 3795ae28a613..95a6a4b43c37 100644
+--- a/arch/arm/mach-moxart/Kconfig
++++ b/arch/arm/mach-moxart/Kconfig
+@@ -2,14 +2,9 @@ config ARCH_MOXART
+ bool "MOXA ART SoC" if ARCH_MULTI_V4T
+ select CPU_FA526
+ select ARM_DMA_MEM_BUFFERABLE
+- select USE_OF
+- select CLKSRC_OF
+ select CLKSRC_MMIO
+- select HAVE_CLK
+- select COMMON_CLK
+ select GENERIC_IRQ_CHIP
+ select ARCH_REQUIRE_GPIOLIB
+- select GENERIC_CLOCKEVENTS
+ select PHYLIB if NETDEVICES
+ help
+ Say Y here if you want to run your kernel on hardware with a
+diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
+index 5e269d7263ce..d581e846d922 100644
+--- a/arch/arm/mach-mvebu/Kconfig
++++ b/arch/arm/mach-mvebu/Kconfig
+@@ -2,15 +2,10 @@ config ARCH_MVEBU
+ bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7
+ select ARCH_SUPPORTS_BIG_ENDIAN
+ select CLKSRC_MMIO
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+ select IRQ_DOMAIN
+- select MULTI_IRQ_HANDLER
+ select PINCTRL
+ select PLAT_ORION
+- select SPARSE_IRQ
+- select CLKDEV_LOOKUP
+ select MVEBU_MBUS
+ select ZONE_DMA if ARM_LPAE
+ select ARCH_REQUIRE_GPIOLIB
+diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
+index 8cde9e05b5d6..84794137b175 100644
+--- a/arch/arm/mach-mxs/Kconfig
++++ b/arch/arm/mach-mxs/Kconfig
+@@ -16,11 +16,7 @@ config ARCH_MXS
+ bool "Freescale MXS (i.MX23, i.MX28) support"
+ depends on ARCH_MULTI_V5
+ select ARCH_REQUIRE_GPIOLIB
+- select CLKDEV_LOOKUP
+ select CLKSRC_MMIO
+- select CLKSRC_OF
+- select GENERIC_CLOCKEVENTS
+- select HAVE_CLK_PREPARE
+ select PINCTRL
+ select SOC_BUS
+ select SOC_IMX23
+diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig
+index 4d42da49753c..486d301f43fd 100644
+--- a/arch/arm/mach-nomadik/Kconfig
++++ b/arch/arm/mach-nomadik/Kconfig
+@@ -6,16 +6,11 @@ config ARCH_NOMADIK
+ select ARM_VIC
+ select CLKSRC_NOMADIK_MTU
+ select CLKSRC_NOMADIK_MTU_SCHED_CLOCK
+- select CLKSRC_OF
+- select COMMON_CLK
+ select CPU_ARM926T
+- select GENERIC_CLOCKEVENTS
+ select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+ select PINCTRL_NOMADIK
+ select PINCTRL_STN8815
+- select SPARSE_IRQ
+- select USE_OF
+ help
+ Support for the Nomadik platform by ST-Ericsson
+
+diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig
+index 59d8f0a70919..bc41f26c1a12 100644
+--- a/arch/arm/mach-nspire/Kconfig
++++ b/arch/arm/mach-nspire/Kconfig
+@@ -3,14 +3,9 @@ config ARCH_NSPIRE
+ depends on ARCH_MULTI_V4_V5
+ depends on MMU
+ select CPU_ARM926T
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+- select SPARSE_IRQ
+ select ARM_AMBA
+ select ARM_VIC
+ select ARM_TIMER_SP804
+- select USE_OF
+- select CLKSRC_OF
+ help
+ This enables support for systems using the TI-NSPIRE CPU
+diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
+index 6fb91fb604a0..d54bddb9c093 100644
+--- a/arch/arm/mach-omap2/Kconfig
++++ b/arch/arm/mach-omap2/Kconfig
+@@ -6,7 +6,6 @@ config ARCH_OMAP2
+ depends on ARCH_MULTI_V6
+ select ARCH_OMAP2PLUS
+ select CPU_V6
+- select MULTI_IRQ_HANDLER
+ select SOC_HAS_OMAP2_SDRC
+
+ config ARCH_OMAP3
+@@ -15,8 +14,6 @@ config ARCH_OMAP3
+ select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
+ select ARM_CPU_SUSPEND if PM
+- select CPU_V7
+- select MULTI_IRQ_HANDLER
+ select OMAP_INTERCONNECT
+ select PM_OPP if PM
+ select PM_RUNTIME if CPU_IDLE
+@@ -32,7 +29,6 @@ config ARCH_OMAP4
+ select ARM_ERRATA_720789
+ select ARM_GIC
+ select CACHE_L2X0
+- select CPU_V7
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+@@ -51,7 +47,6 @@ config SOC_OMAP5
+ select ARCH_HAS_OPP
+ select ARM_CPU_SUSPEND if PM
+ select ARM_GIC
+- select CPU_V7
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+@@ -64,16 +59,12 @@ config SOC_AM33XX
+ select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
+ select ARM_CPU_SUSPEND if PM
+- select CPU_V7
+- select MULTI_IRQ_HANDLER
+
+ config SOC_AM43XX
+ bool "TI AM43x"
+ depends on ARCH_MULTI_V7
+- select CPU_V7
+ select ARCH_OMAP2PLUS
+ select ARCH_HAS_OPP
+- select MULTI_IRQ_HANDLER
+ select ARM_GIC
+ select MACH_OMAP_GENERIC
+
+@@ -84,8 +75,6 @@ config SOC_DRA7XX
+ select ARCH_HAS_OPP
+ select ARM_CPU_SUSPEND if PM
+ select ARM_GIC
+- select CPU_V7
+- select HAVE_SMP
+ select HAVE_ARM_ARCH_TIMER
+
+ config ARCH_OMAP2PLUS
+@@ -96,17 +85,13 @@ config ARCH_OMAP2PLUS
+ select ARCH_OMAP
+ select ARCH_REQUIRE_GPIOLIB
+ select CLKSRC_MMIO
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+ select MACH_OMAP_GENERIC
+ select OMAP_DM_TIMER
+ select PINCTRL
+ select PROC_DEVICETREE if PROC_FS
+ select SOC_BUS
+- select SPARSE_IRQ
+ select TI_PRIV_EDMA
+- select USE_OF
+ help
+ Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
+
+diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
+index b1022f4315f7..c88ff74d86fe 100644
+--- a/arch/arm/mach-picoxcell/Kconfig
++++ b/arch/arm/mach-picoxcell/Kconfig
+@@ -1,12 +1,8 @@
+ config ARCH_PICOXCELL
+ bool "Picochip PicoXcell" if ARCH_MULTI_V6
+ select ARCH_REQUIRE_GPIOLIB
+- select ARM_PATCH_PHYS_VIRT
+ select ARM_VIC
+ select CPU_V6K
+ select DW_APB_TIMER_OF
+- select GENERIC_CLOCKEVENTS
+ select HAVE_TCM
+ select NO_IOPORT
+- select SPARSE_IRQ
+- select USE_OF
+diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
+index 6988b117fc17..16c2d90762f0 100644
+--- a/arch/arm/mach-prima2/Kconfig
++++ b/arch/arm/mach-prima2/Kconfig
+@@ -1,7 +1,6 @@
+ config ARCH_SIRF
+ bool "CSR SiRF" if ARCH_MULTI_V7
+ select ARCH_REQUIRE_GPIOLIB
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+ select MIGHT_HAVE_CACHE_L2X0
+ select NO_IOPORT
+@@ -17,7 +16,6 @@ menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features"
+ config ARCH_ATLAS6
+ bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
+ default y
+- select CPU_V7
+ select SIRF_IRQ
+ help
+ Support for CSR SiRFSoC ARM Cortex A9 Platform
+@@ -25,7 +23,6 @@ config ARCH_ATLAS6
+ config ARCH_PRIMA2
+ bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
+ default y
+- select CPU_V7
+ select SIRF_IRQ
+ select ZONE_DMA
+ help
+@@ -35,7 +32,6 @@ config ARCH_MARCO
+ bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
+ default y
+ select ARM_GIC
+- select CPU_V7
+ select HAVE_ARM_SCU if SMP
+ select HAVE_SMP
+ select SMP_ON_UP if SMP
+diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
+index cf073dea5784..2a695bc977b2 100644
+--- a/arch/arm/mach-rockchip/Kconfig
++++ b/arch/arm/mach-rockchip/Kconfig
+@@ -7,8 +7,6 @@ config ARCH_ROCKCHIP
+ select CACHE_L2X0
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+ select DW_APB_TIMER_OF
+ select ARM_GLOBAL_TIMER
+ select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 5e3fb956ff08..30bfa25e3dbe 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -5,8 +5,6 @@ config ARCH_SHMOBILE_MULTI
+ bool "Renesas ARM SoCs" if ARCH_MULTI_V7
+ depends on MMU
+ select ARCH_SHMOBILE
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+@@ -16,7 +14,6 @@ config ARCH_SHMOBILE_MULTI
+ select NO_IOPORT
+ select PINCTRL
+ select ARCH_REQUIRE_GPIOLIB
+- select CLKDEV_LOOKUP
+
+ if ARCH_SHMOBILE_MULTI
+
+diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
+index aee77f06f887..224913770509 100644
+--- a/arch/arm/mach-socfpga/Kconfig
++++ b/arch/arm/mach-socfpga/Kconfig
+@@ -1,17 +1,11 @@
+ config ARCH_SOCFPGA
+ bool "Altera SOCFPGA family" if ARCH_MULTI_V7
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_AMBA
+ select ARM_GIC
+ select CACHE_L2X0
+- select COMMON_CLK
+- select CPU_V7
+ select DW_APB_TIMER_OF
+- select GENERIC_CLOCKEVENTS
+ select GPIO_PL061 if GPIOLIB
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+ select MFD_SYSCON
+- select SPARSE_IRQ
+- select USE_OF
+diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
+index ac1710e64d9a..a7a28eadd93c 100644
+--- a/arch/arm/mach-spear/Kconfig
++++ b/arch/arm/mach-spear/Kconfig
+@@ -8,8 +8,6 @@ menuconfig PLAT_SPEAR
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_AMBA
+ select CLKSRC_MMIO
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+
+ if PLAT_SPEAR
+
+@@ -18,14 +16,12 @@ config ARCH_SPEAR13XX
+ depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE
+ select ARCH_HAS_CPUFREQ
+ select ARM_GIC
+- select CPU_V7
+ select GPIO_SPEAR_SPICS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+ select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+- select USE_OF
+ help
+ Supports for ARM's SPEAR13XX family
+
+@@ -50,9 +46,7 @@ config ARCH_SPEAR3XX
+ depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
+ depends on !ARCH_SPEAR13XX
+ select ARM_VIC
+- select CPU_ARM926T
+ select PINCTRL
+- select USE_OF
+ help
+ Supports for ARM's SPEAR3XX family
+
+@@ -83,14 +77,12 @@ config ARCH_SPEAR6XX
+ depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE
+ depends on !ARCH_SPEAR13XX
+ select ARM_VIC
+- select CPU_ARM926T
+ help
+ Supports for ARM's SPEAR6XX family
+
+ config MACH_SPEAR600
+ def_bool y
+ depends on ARCH_SPEAR6XX
+- select USE_OF
+ help
+ Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig"
+
+diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
+index d71654bc8d54..9c6dda85d587 100644
+--- a/arch/arm/mach-sti/Kconfig
++++ b/arch/arm/mach-sti/Kconfig
+@@ -1,7 +1,5 @@
+ menuconfig ARCH_STI
+ bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7
+- select GENERIC_CLOCKEVENTS
+- select CLKDEV_LOOKUP
+ select ARM_GIC
+ select ARM_GLOBAL_TIMER
+ select PINCTRL
+diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
+index b9d6cad8669b..201ef9b526fd 100644
+--- a/arch/arm/mach-sunxi/Kconfig
++++ b/arch/arm/mach-sunxi/Kconfig
+@@ -5,14 +5,10 @@ config ARCH_SUNXI
+ select ARM_GIC
+ select ARM_PSCI
+ select CLKSRC_MMIO
+- select CLKSRC_OF
+- select COMMON_CLK
+- select GENERIC_CLOCKEVENTS
+ select GENERIC_IRQ_CHIP
+ select HAVE_SMP
+ select PINCTRL
+ select PINCTRL_SUNXI
+ select RESET_CONTROLLER
+- select SPARSE_IRQ
+ select SUN4I_TIMER
+ select SUN5I_HSTIMER
+diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
+index 4926bd11f190..b3a1dab90604 100644
+--- a/arch/arm/mach-tegra/Kconfig
++++ b/arch/arm/mach-tegra/Kconfig
+@@ -5,10 +5,6 @@ config ARCH_TEGRA
+ select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS
+ select ARM_GIC
+ select CLKSRC_MMIO
+- select CLKSRC_OF
+- select COMMON_CLK
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+@@ -18,10 +14,8 @@ config ARCH_TEGRA
+ select ARCH_HAS_RESET_CONTROLLER
+ select RESET_CONTROLLER
+ select SOC_BUS
+- select SPARSE_IRQ
+ select USB_ULPI if USB_PHY
+ select USB_ULPI_VIEWPORT if USB_PHY
+- select USE_OF
+ help
+ This enables support for NVIDIA Tegra based systems.
+
+diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
+index 8e23071bd1b3..e3a96d7302e9 100644
+--- a/arch/arm/mach-u300/Kconfig
++++ b/arch/arm/mach-u300/Kconfig
+@@ -3,20 +3,14 @@ config ARCH_U300
+ depends on MMU
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_AMBA
+- select ARM_PATCH_PHYS_VIRT
+ select ARM_VIC
+ select CLKSRC_MMIO
+- select CLKSRC_OF
+- select COMMON_CLK
+ select CPU_ARM926T
+- select GENERIC_CLOCKEVENTS
+ select HAVE_TCM
+ select PINCTRL
+ select PINCTRL_COH901
+ select PINCTRL_U300
+- select SPARSE_IRQ
+ select MFD_SYSCON
+- select USE_OF
+ help
+ Support for ST-Ericsson U300 series mobile platforms.
+
+diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
+index 0034d2cd6973..5d71c825e9d5 100644
+--- a/arch/arm/mach-ux500/Kconfig
++++ b/arch/arm/mach-ux500/Kconfig
+@@ -11,9 +11,6 @@ config ARCH_U8500
+ select ARM_GIC
+ select CACHE_L2X0
+ select CLKSRC_NOMADIK_MTU
+- select COMMON_CLK
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_SMP
+@@ -76,7 +73,6 @@ config UX500_AUTO_PLATFORM
+ config MACH_UX500_DT
+ bool "Generic U8500 support using device tree"
+ depends on MACH_MOP500
+- select USE_OF
+
+ endmenu
+
+diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
+index 4a70be485ff8..fa2922292a58 100644
+--- a/arch/arm/mach-vexpress/Kconfig
++++ b/arch/arm/mach-vexpress/Kconfig
+@@ -5,10 +5,7 @@ config ARCH_VEXPRESS
+ select ARM_AMBA
+ select ARM_GIC
+ select ARM_TIMER_SP804
+- select COMMON_CLK
+ select COMMON_CLK_VERSATILE
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_PATA_PLATFORM
+diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig
+index 081d46929436..eaad072c725b 100644
+--- a/arch/arm/mach-virt/Kconfig
++++ b/arch/arm/mach-virt/Kconfig
+@@ -1,10 +1,6 @@
+ config ARCH_VIRT
+ bool "Dummy Virtual Machine" if ARCH_MULTI_V7
+- select ARCH_WANT_OPTIONAL_GPIOLIB
+ select ARM_GIC
+ select HAVE_ARM_ARCH_TIMER
+ select ARM_PSCI
+ select HAVE_SMP
+- select CPU_V7
+- select SPARSE_IRQ
+- select USE_OF
+diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig
+index 927be93b692e..c581ed290dfd 100644
+--- a/arch/arm/mach-vt8500/Kconfig
++++ b/arch/arm/mach-vt8500/Kconfig
+@@ -3,8 +3,6 @@ config ARCH_VT8500
+ select ARCH_HAS_CPUFREQ
+ select ARCH_REQUIRE_GPIOLIB
+ select CLKDEV_LOOKUP
+- select CLKSRC_OF
+- select GENERIC_CLOCKEVENTS
+ select VT8500_TIMER
+ select PINCTRL
+ help
+@@ -29,6 +27,5 @@ config ARCH_WM8850
+ bool "WonderMedia WM8850"
+ depends on ARCH_MULTI_V7
+ select ARCH_VT8500
+- select CPU_V7
+ help
+ Support for WonderMedia WM8850 System-on-Chip.
+diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
+index 6b04260aa142..85d180583402 100644
+--- a/arch/arm/mach-zynq/Kconfig
++++ b/arch/arm/mach-zynq/Kconfig
+@@ -2,16 +2,11 @@ config ARCH_ZYNQ
+ bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7
+ select ARM_AMBA
+ select ARM_GIC
+- select COMMON_CLK
+- select CPU_V7
+- select GENERIC_CLOCKEVENTS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select ICST
+ select MIGHT_HAVE_CACHE_L2X0
+- select USE_OF
+ select HAVE_SMP
+- select SPARSE_IRQ
+ select CADENCE_TTC_TIMER
+ select ARM_GLOBAL_TIMER
+ help
+--
+2.1.2
+
diff --git a/patches.renesas/0321-ARM-select-HAVE_SMP-for-V7-multi-platform.patch b/patches.renesas/0321-ARM-select-HAVE_SMP-for-V7-multi-platform.patch
new file mode 100644
index 00000000000000..0cdb73787dc0cf
--- /dev/null
+++ b/patches.renesas/0321-ARM-select-HAVE_SMP-for-V7-multi-platform.patch
@@ -0,0 +1,272 @@
+From fe67ea0fd226a4b5fca0c755bbe6009a31b68771 Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh@kernel.org>
+Date: Fri, 31 Jan 2014 15:32:02 -0600
+Subject: ARM: select HAVE_SMP for V7 multi-platform
+
+All V7 platforms can run SMP kernels, so make CONFIG_SMP visible for V7
+multi-platform builds.
+
+Signed-off-by: Rob Herring <robh@kernel.org>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+(cherry picked from commit 90bc8ac77dc85d2184da3d5280215b33253adffc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/Kconfig | 1 +
+ arch/arm/mach-berlin/Kconfig | 1 -
+ arch/arm/mach-highbank/Kconfig | 1 -
+ arch/arm/mach-hisi/Kconfig | 1 -
+ arch/arm/mach-imx/Kconfig | 1 -
+ arch/arm/mach-keystone/Kconfig | 1 -
+ arch/arm/mach-mvebu/Kconfig | 1 -
+ arch/arm/mach-omap2/Kconfig | 2 --
+ arch/arm/mach-prima2/Kconfig | 1 -
+ arch/arm/mach-rockchip/Kconfig | 1 -
+ arch/arm/mach-shmobile/Kconfig | 1 -
+ arch/arm/mach-socfpga/Kconfig | 1 -
+ arch/arm/mach-spear/Kconfig | 1 -
+ arch/arm/mach-sti/Kconfig | 1 -
+ arch/arm/mach-sunxi/Kconfig | 1 -
+ arch/arm/mach-tegra/Kconfig | 1 -
+ arch/arm/mach-ux500/Kconfig | 1 -
+ arch/arm/mach-vexpress/Kconfig | 1 -
+ arch/arm/mach-zynq/Kconfig | 1 -
+ 19 files changed, 1 insertion(+), 19 deletions(-)
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index f7717d4ce420..145c9cb8a422 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -915,6 +915,7 @@ config ARCH_MULTI_V7
+ default y
+ select ARCH_MULTI_V6_V7
+ select CPU_V7
++ select HAVE_SMP
+
+ config ARCH_MULTI_V6_V7
+ bool
+diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig
+index b346f598a595..b0cb0722acd2 100644
+--- a/arch/arm/mach-berlin/Kconfig
++++ b/arch/arm/mach-berlin/Kconfig
+@@ -14,7 +14,6 @@ config MACH_BERLIN_BG2
+ select CACHE_L2X0
+ select CPU_PJ4B
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+
+ config MACH_BERLIN_BG2CD
+ bool "Marvell Armada 1500-mini (BG2CD)"
+diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
+index 59274a7fd7c5..830b76e70250 100644
+--- a/arch/arm/mach-highbank/Kconfig
++++ b/arch/arm/mach-highbank/Kconfig
+@@ -15,7 +15,6 @@ config ARCH_HIGHBANK
+ select CACHE_L2X0
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select MAILBOX
+ select PL320_MBOX
+ select ZONE_DMA if ARM_LPAE
+diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
+index 95492d715166..9d0a87b025e3 100644
+--- a/arch/arm/mach-hisi/Kconfig
++++ b/arch/arm/mach-hisi/Kconfig
+@@ -6,7 +6,6 @@ config ARCH_HI3xxx
+ select CACHE_L2X0
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select PINCTRL
+ select PINCTRL_SINGLE
+ help
+diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
+index 3dd2c601fea2..1a6a843aad66 100644
+--- a/arch/arm/mach-imx/Kconfig
++++ b/arch/arm/mach-imx/Kconfig
+@@ -791,7 +791,6 @@ config SOC_IMX6Q
+ select HAVE_IMX_GPC
+ select HAVE_IMX_MMDC
+ select HAVE_IMX_SRC
+- select HAVE_SMP
+ select MFD_SYSCON
+ select MIGHT_HAVE_PCI
+ select PCI_DOMAINS if PCI
+diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig
+index 00ed74473eaf..f50bc936cb84 100644
+--- a/arch/arm/mach-keystone/Kconfig
++++ b/arch/arm/mach-keystone/Kconfig
+@@ -3,7 +3,6 @@ config ARCH_KEYSTONE
+ depends on ARCH_MULTI_V7
+ select ARM_GIC
+ select HAVE_ARM_ARCH_TIMER
+- select HAVE_SMP
+ select CLKSRC_MMIO
+ select ARM_ERRATA_798181 if SMP
+ select COMMON_CLK_KEYSTONE
+diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
+index d581e846d922..875a35263dc3 100644
+--- a/arch/arm/mach-mvebu/Kconfig
++++ b/arch/arm/mach-mvebu/Kconfig
+@@ -19,7 +19,6 @@ menu "Marvell SOC with device tree"
+ config MACH_ARMADA_370_XP
+ bool
+ select ARMADA_370_XP_TIMER
+- select HAVE_SMP
+ select CACHE_L2X0
+ select CPU_PJ4B
+
+diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
+index d54bddb9c093..0dc337d02f69 100644
+--- a/arch/arm/mach-omap2/Kconfig
++++ b/arch/arm/mach-omap2/Kconfig
+@@ -31,7 +31,6 @@ config ARCH_OMAP4
+ select CACHE_L2X0
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select OMAP_INTERCONNECT
+ select PL310_ERRATA_588369
+ select PL310_ERRATA_727915
+@@ -49,7 +48,6 @@ config SOC_OMAP5
+ select ARM_GIC
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select HAVE_ARM_ARCH_TIMER
+ select ARM_ERRATA_798181 if SMP
+
+diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
+index 16c2d90762f0..59aa3ea8ccaf 100644
+--- a/arch/arm/mach-prima2/Kconfig
++++ b/arch/arm/mach-prima2/Kconfig
+@@ -33,7 +33,6 @@ config ARCH_MARCO
+ default y
+ select ARM_GIC
+ select HAVE_ARM_SCU if SMP
+- select HAVE_SMP
+ select SMP_ON_UP if SMP
+ help
+ Support for CSR SiRFSoC ARM Cortex A9 Platform
+diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
+index 2a695bc977b2..6b2f58645a73 100644
+--- a/arch/arm/mach-rockchip/Kconfig
++++ b/arch/arm/mach-rockchip/Kconfig
+@@ -6,7 +6,6 @@ config ARCH_ROCKCHIP
+ select ARM_GIC
+ select CACHE_L2X0
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select DW_APB_TIMER_OF
+ select ARM_GLOBAL_TIMER
+ select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 30bfa25e3dbe..76e450aceb46 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -7,7 +7,6 @@ config ARCH_SHMOBILE_MULTI
+ select ARCH_SHMOBILE
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select ARM_GIC
+ select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
+index 224913770509..b5f8d75d51a0 100644
+--- a/arch/arm/mach-socfpga/Kconfig
++++ b/arch/arm/mach-socfpga/Kconfig
+@@ -7,5 +7,4 @@ config ARCH_SOCFPGA
+ select GPIO_PL061 if GPIOLIB
+ select HAVE_ARM_SCU
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select MFD_SYSCON
+diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
+index a7a28eadd93c..601b8d831a56 100644
+--- a/arch/arm/mach-spear/Kconfig
++++ b/arch/arm/mach-spear/Kconfig
+@@ -19,7 +19,6 @@ config ARCH_SPEAR13XX
+ select GPIO_SPEAR_SPICS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+ help
+diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
+index 9c6dda85d587..c3fdceee4ecb 100644
+--- a/arch/arm/mach-sti/Kconfig
++++ b/arch/arm/mach-sti/Kconfig
+@@ -6,7 +6,6 @@ menuconfig ARCH_STI
+ select PINCTRL_ST
+ select MFD_SYSCON
+ select MIGHT_HAVE_CACHE_L2X0
+- select HAVE_SMP
+ select HAVE_ARM_SCU if SMP
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_ERRATA_754322
+diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
+index 201ef9b526fd..9de27cfa688f 100644
+--- a/arch/arm/mach-sunxi/Kconfig
++++ b/arch/arm/mach-sunxi/Kconfig
+@@ -6,7 +6,6 @@ config ARCH_SUNXI
+ select ARM_PSCI
+ select CLKSRC_MMIO
+ select GENERIC_IRQ_CHIP
+- select HAVE_SMP
+ select PINCTRL
+ select PINCTRL_SUNXI
+ select RESET_CONTROLLER
+diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
+index b3a1dab90604..d58022939d5d 100644
+--- a/arch/arm/mach-tegra/Kconfig
++++ b/arch/arm/mach-tegra/Kconfig
+@@ -7,7 +7,6 @@ config ARCH_TEGRA
+ select CLKSRC_MMIO
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+ select PINCTRL
+diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
+index 5d71c825e9d5..731b9197e0e3 100644
+--- a/arch/arm/mach-ux500/Kconfig
++++ b/arch/arm/mach-ux500/Kconfig
+@@ -13,7 +13,6 @@ config ARCH_U8500
+ select CLKSRC_NOMADIK_MTU
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select HAVE_SMP
+ select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+ select PINCTRL_ABX500
+diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
+index fa2922292a58..6cbddb825fee 100644
+--- a/arch/arm/mach-vexpress/Kconfig
++++ b/arch/arm/mach-vexpress/Kconfig
+@@ -9,7 +9,6 @@ config ARCH_VEXPRESS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select HAVE_PATA_PLATFORM
+- select HAVE_SMP
+ select ICST
+ select MIGHT_HAVE_CACHE_L2X0
+ select NO_IOPORT
+diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
+index 85d180583402..70e247dd1f08 100644
+--- a/arch/arm/mach-zynq/Kconfig
++++ b/arch/arm/mach-zynq/Kconfig
+@@ -6,7 +6,6 @@ config ARCH_ZYNQ
+ select HAVE_ARM_TWD if SMP
+ select ICST
+ select MIGHT_HAVE_CACHE_L2X0
+- select HAVE_SMP
+ select CADENCE_TTC_TIMER
+ select ARM_GLOBAL_TIMER
+ help
+--
+2.1.2
+
diff --git a/patches.renesas/0322-ARM-select-MIGHT_HAVE_CACHE_L2X0-for-V6-and-V7-multi.patch b/patches.renesas/0322-ARM-select-MIGHT_HAVE_CACHE_L2X0-for-V6-and-V7-multi.patch
new file mode 100644
index 00000000000000..0346afbe308c1e
--- /dev/null
+++ b/patches.renesas/0322-ARM-select-MIGHT_HAVE_CACHE_L2X0-for-V6-and-V7-multi.patch
@@ -0,0 +1,163 @@
+From 9bda71e48b826434f1a6231956603cd724c2aeba Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh@kernel.org>
+Date: Fri, 31 Jan 2014 15:36:10 -0600
+Subject: ARM: select MIGHT_HAVE_CACHE_L2X0 for V6 and V7 multi-platform
+
+Many V6 and V7 platforms have an L2x0 cache, so make
+CONFIG_MIGHT_HAVE_CACHE_L2X0 visible for V6 and V7 multi-platform
+builds.
+
+Signed-off-by: Rob Herring <robh@kernel.org>
+Acked-by: Stephen Warren <swarren@nvidia.com>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+(cherry picked from commit 9352b05b6e4ef1aae53744cbd0adc0491fae5be0)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/Kconfig | 1 +
+ arch/arm/mach-cns3xxx/Kconfig | 1 -
+ arch/arm/mach-imx/Kconfig | 1 -
+ arch/arm/mach-prima2/Kconfig | 1 -
+ arch/arm/mach-shmobile/Kconfig | 1 -
+ arch/arm/mach-spear/Kconfig | 1 -
+ arch/arm/mach-sti/Kconfig | 1 -
+ arch/arm/mach-tegra/Kconfig | 1 -
+ arch/arm/mach-ux500/Kconfig | 1 -
+ arch/arm/mach-vexpress/Kconfig | 1 -
+ arch/arm/mach-zynq/Kconfig | 1 -
+ 11 files changed, 1 insertion(+), 10 deletions(-)
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 145c9cb8a422..a5a497f43719 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -919,6 +919,7 @@ config ARCH_MULTI_V7
+
+ config ARCH_MULTI_V6_V7
+ bool
++ select MIGHT_HAVE_CACHE_L2X0
+
+ config ARCH_MULTI_CPU_AUTO
+ def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
+diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig
+index e3466887f62c..c6f58a15c95e 100644
+--- a/arch/arm/mach-cns3xxx/Kconfig
++++ b/arch/arm/mach-cns3xxx/Kconfig
+@@ -2,7 +2,6 @@ config ARCH_CNS3XXX
+ bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6
+ select ARM_GIC
+ select CPU_V6K
+- select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+ select PCI_DOMAINS if PCI
+ help
+diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
+index 1a6a843aad66..ff2447389f27 100644
+--- a/arch/arm/mach-imx/Kconfig
++++ b/arch/arm/mach-imx/Kconfig
+@@ -5,7 +5,6 @@ config ARCH_MXC
+ select CLKSRC_MMIO
+ select GENERIC_ALLOCATOR
+ select GENERIC_IRQ_CHIP
+- select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7
+ select PINCTRL
+ select SOC_BUS
+ help
+diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
+index 59aa3ea8ccaf..2c726b4f9356 100644
+--- a/arch/arm/mach-prima2/Kconfig
++++ b/arch/arm/mach-prima2/Kconfig
+@@ -2,7 +2,6 @@ config ARCH_SIRF
+ bool "CSR SiRF" if ARCH_MULTI_V7
+ select ARCH_REQUIRE_GPIOLIB
+ select GENERIC_IRQ_CHIP
+- select MIGHT_HAVE_CACHE_L2X0
+ select NO_IOPORT
+ select PINCTRL
+ select PINCTRL_SIRF
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 76e450aceb46..1ebf839fa2b8 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -8,7 +8,6 @@ config ARCH_SHMOBILE_MULTI
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select ARM_GIC
+- select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+ select NO_IOPORT
+ select PINCTRL
+diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig
+index 601b8d831a56..5c57262b97e9 100644
+--- a/arch/arm/mach-spear/Kconfig
++++ b/arch/arm/mach-spear/Kconfig
+@@ -19,7 +19,6 @@ config ARCH_SPEAR13XX
+ select GPIO_SPEAR_SPICS
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+ help
+ Supports for ARM's SPEAR13XX family
+diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig
+index c3fdceee4ecb..d2c13ba1190b 100644
+--- a/arch/arm/mach-sti/Kconfig
++++ b/arch/arm/mach-sti/Kconfig
+@@ -5,7 +5,6 @@ menuconfig ARCH_STI
+ select PINCTRL
+ select PINCTRL_ST
+ select MFD_SYSCON
+- select MIGHT_HAVE_CACHE_L2X0
+ select HAVE_ARM_SCU if SMP
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_ERRATA_754322
+diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
+index d58022939d5d..92d660f9610f 100644
+--- a/arch/arm/mach-tegra/Kconfig
++++ b/arch/arm/mach-tegra/Kconfig
+@@ -7,7 +7,6 @@ config ARCH_TEGRA
+ select CLKSRC_MMIO
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select MIGHT_HAVE_CACHE_L2X0
+ select MIGHT_HAVE_PCI
+ select PINCTRL
+ select ARCH_HAS_RESET_CONTROLLER
+diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
+index 731b9197e0e3..8052bd52450d 100644
+--- a/arch/arm/mach-ux500/Kconfig
++++ b/arch/arm/mach-ux500/Kconfig
+@@ -13,7 +13,6 @@ config ARCH_U8500
+ select CLKSRC_NOMADIK_MTU
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+- select MIGHT_HAVE_CACHE_L2X0
+ select PINCTRL
+ select PINCTRL_ABX500
+ select PINCTRL_NOMADIK
+diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
+index 6cbddb825fee..80b4be36f10a 100644
+--- a/arch/arm/mach-vexpress/Kconfig
++++ b/arch/arm/mach-vexpress/Kconfig
+@@ -10,7 +10,6 @@ config ARCH_VEXPRESS
+ select HAVE_ARM_TWD if SMP
+ select HAVE_PATA_PLATFORM
+ select ICST
+- select MIGHT_HAVE_CACHE_L2X0
+ select NO_IOPORT
+ select PLAT_VERSATILE
+ select PLAT_VERSATILE_CLCD
+diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
+index 70e247dd1f08..105d39b72a25 100644
+--- a/arch/arm/mach-zynq/Kconfig
++++ b/arch/arm/mach-zynq/Kconfig
+@@ -5,7 +5,6 @@ config ARCH_ZYNQ
+ select HAVE_ARM_SCU if SMP
+ select HAVE_ARM_TWD if SMP
+ select ICST
+- select MIGHT_HAVE_CACHE_L2X0
+ select CADENCE_TTC_TIMER
+ select ARM_GLOBAL_TIMER
+ help
+--
+2.1.2
+
diff --git a/patches.renesas/0323-ARM-shmobile-r8a7778-add-audio-clock-in-new-style.patch b/patches.renesas/0323-ARM-shmobile-r8a7778-add-audio-clock-in-new-style.patch
new file mode 100644
index 00000000000000..142b21ac09d638
--- /dev/null
+++ b/patches.renesas/0323-ARM-shmobile-r8a7778-add-audio-clock-in-new-style.patch
@@ -0,0 +1,39 @@
+From e9a842e5acf53805d1713a065bdd4a116c5fd067 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 13 Jan 2014 18:25:27 -0800
+Subject: ARM: shmobile: r8a7778: add audio clock in new style
+
+Current audio clock doesn't have dependency to device/driver,
+but, it is not good design for DT support.
+To avoid branch merge conflict issue,
+it uses this load map, and this patch is 1) part.
+ 1) add new style clock in platform
+ 2) add new style clock method in driver
+ 3) remove old tyle clock from platform
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit ba349c08bea1bfddddb7cfc0af140d368274f869)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7778.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
+index 9783945f8bc7..2009a9bc6356 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7778.c
++++ b/arch/arm/mach-shmobile/clock-r8a7778.c
+@@ -221,6 +221,10 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */
+ CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */
+
++ CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
++ CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
++ CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
++ CLKDEV_ICK_ID("clk_i", "rcar_sound", &s1_clk),
+ CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]),
+ CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]),
+ CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]),
+--
+2.1.2
+
diff --git a/patches.renesas/0324-ARM-shmobile-r8a7790-add-audio-clock.patch b/patches.renesas/0324-ARM-shmobile-r8a7790-add-audio-clock.patch
new file mode 100644
index 00000000000000..190f985c653a29
--- /dev/null
+++ b/patches.renesas/0324-ARM-shmobile-r8a7790-add-audio-clock.patch
@@ -0,0 +1,111 @@
+From 84c6b713da2db8e6aba5d419a1c5d7c27e422487 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Mon, 13 Jan 2014 18:25:39 -0800
+Subject: ARM: shmobile: r8a7790: add audio clock
+
+Current audio clock doesn't have dependency to device/driver,
+but, it is not good design for DT support.
+To avoid branch merge conflict issue,
+it uses this load map, and this patch is 1) part.
+ 1) add old/new style clock in platform
+ 2) add new style clock method in driver
+ 3) remove old tyle clock from platform
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c7c2ec3a1881b93c211d0754b39f08b5a75459d8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 23 +++++++++++++++++++++++
+ arch/arm/mach-shmobile/clock-r8a7790.c | 20 ++++++++++++++++++++
+ 2 files changed, 43 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index 6eb9613d9c8d..a1e7c396afea 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -409,6 +409,29 @@
+ clock-output-names = "extal";
+ };
+
++ /*
++ * The external audio clocks are configured as 0 Hz fixed frequency clocks by
++ * default. Boards that provide audio clocks should override them.
++ */
++ audio_clk_a: audio_clk_a {
++ compatible = "fixed-clock";
++ #clock-cells = <0>;
++ clock-frequency = <0>;
++ clock-output-names = "audio_clk_a";
++ };
++ audio_clk_b: audio_clk_b {
++ compatible = "fixed-clock";
++ #clock-cells = <0>;
++ clock-frequency = <0>;
++ clock-output-names = "audio_clk_b";
++ };
++ audio_clk_c: audio_clk_c {
++ compatible = "fixed-clock";
++ #clock-cells = <0>;
++ clock-frequency = <0>;
++ clock-output-names = "audio_clk_c";
++ };
++
+ /* Special CPG clocks */
+ cpg_clocks: cpg_clocks@e6150000 {
+ compatible = "renesas,r8a7790-cpg-clocks",
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index 507073e9d455..08a28034ca1d 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -91,6 +91,15 @@ static struct clk main_clk = {
+ .ops = &followparent_clk_ops,
+ };
+
++static struct clk audio_clk_a = {
++};
++
++static struct clk audio_clk_b = {
++};
++
++static struct clk audio_clk_c = {
++};
++
+ /*
+ * clock ratio of these clock will be updated
+ * on r8a7790_clock_init()
+@@ -124,6 +133,9 @@ SH_FIXED_RATIO_CLK_SET(ddr_clk, pll3_clk, 1, 8);
+ SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
+
+ static struct clk *main_clks[] = {
++ &audio_clk_a,
++ &audio_clk_b,
++ &audio_clk_c,
+ &extal_clk,
+ &extal_div2_clk,
+ &main_clk,
+@@ -267,6 +279,10 @@ static struct clk mstp_clks[MSTP_NR] = {
+ static struct clk_lookup lookups[] = {
+
+ /* main clocks */
++ CLKDEV_CON_ID("audio_clk_a", &audio_clk_a),
++ CLKDEV_CON_ID("audio_clk_b", &audio_clk_b),
++ CLKDEV_CON_ID("audio_clk_c", &audio_clk_c),
++ CLKDEV_CON_ID("audio_clk_internal", &m2_clk),
+ CLKDEV_CON_ID("extal", &extal_clk),
+ CLKDEV_CON_ID("extal_div2", &extal_div2_clk),
+ CLKDEV_CON_ID("main", &main_clk),
+@@ -357,6 +373,10 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_ICK_ID("du.0", "rcar-du-r8a7790", &mstp_clks[MSTP724]),
+ CLKDEV_ICK_ID("du.1", "rcar-du-r8a7790", &mstp_clks[MSTP723]),
+ CLKDEV_ICK_ID("du.2", "rcar-du-r8a7790", &mstp_clks[MSTP722]),
++ CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
++ CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
++ CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
++ CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk),
+ CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]),
+ CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]),
+ CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]),
+--
+2.1.2
+
diff --git a/patches.renesas/0325-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks.patch b/patches.renesas/0325-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks.patch
new file mode 100644
index 00000000000000..15d678fcee5f08
--- /dev/null
+++ b/patches.renesas/0325-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks.patch
@@ -0,0 +1,71 @@
+From e499bf373ddf18b1e8cf2d503302b2a9a4b2a3c6 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:23:55 +0100
+Subject: ARM: shmobile: r7s72100 clock: Add RSPI clocks
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d9409fb8f30437b68647613e1f0d61b332de30be)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r7s72100.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
+index dd8ce87596de..ffb0fff41375 100644
+--- a/arch/arm/mach-shmobile/clock-r7s72100.c
++++ b/arch/arm/mach-shmobile/clock-r7s72100.c
+@@ -22,12 +22,14 @@
+ #include <mach/common.h>
+ #include <mach/r7s72100.h>
+
+-/* registers */
++/* Frequency Control Registers */
+ #define FRQCR 0xfcfe0010
+ #define FRQCR2 0xfcfe0014
++/* Standby Control Registers */
+ #define STBCR3 0xfcfe0420
+ #define STBCR4 0xfcfe0424
+ #define STBCR9 0xfcfe0438
++#define STBCR10 0xfcfe043c
+
+ #define PLL_RATE 30
+
+@@ -145,11 +147,19 @@ struct clk div4_clks[DIV4_NR] = {
+ | CLK_ENABLE_ON_INIT),
+ };
+
+-enum { MSTP97, MSTP96, MSTP95, MSTP94,
++enum {
++ MSTP107, MSTP106, MSTP105, MSTP104, MSTP103,
++ MSTP97, MSTP96, MSTP95, MSTP94,
+ MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
+- MSTP33, MSTP_NR };
++ MSTP33, MSTP_NR
++};
+
+ static struct clk mstp_clks[MSTP_NR] = {
++ [MSTP107] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 7, 0), /* RSPI0 */
++ [MSTP106] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 6, 0), /* RSPI1 */
++ [MSTP105] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 5, 0), /* RSPI2 */
++ [MSTP104] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 4, 0), /* RSPI3 */
++ [MSTP103] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 3, 0), /* RSPI4 */
+ [MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */
+ [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */
+ [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */
+@@ -176,6 +186,11 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
+
+ /* MSTP clocks */
++ CLKDEV_DEV_ID("rspi-rz.0", &mstp_clks[MSTP107]),
++ CLKDEV_DEV_ID("rspi-rz.1", &mstp_clks[MSTP106]),
++ CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]),
++ CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]),
++ CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]),
+ CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
+ CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
+ CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
+--
+2.1.2
+
diff --git a/patches.renesas/0326-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks-for-DT.patch b/patches.renesas/0326-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks-for-DT.patch
new file mode 100644
index 00000000000000..f74ac5e6d729a9
--- /dev/null
+++ b/patches.renesas/0326-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks-for-DT.patch
@@ -0,0 +1,36 @@
+From c35dd9109cc49c490ef31f812b6352cbef3ac46f Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:23:58 +0100
+Subject: ARM: shmobile: r7s72100 clock: Add RSPI clocks for DT
+
+Add DT-style ("%08x.spi") clocks, as Genmai doesn't use the common
+clock framework yet.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 3fc3e908d25ad04de1a01b3f659ecabefcca74c5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r7s72100.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
+index ffb0fff41375..71c99feeff01 100644
+--- a/arch/arm/mach-shmobile/clock-r7s72100.c
++++ b/arch/arm/mach-shmobile/clock-r7s72100.c
+@@ -191,6 +191,11 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]),
+ CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]),
+ CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]),
++ CLKDEV_DEV_ID("e800c800.spi", &mstp_clks[MSTP107]),
++ CLKDEV_DEV_ID("e800d000.spi", &mstp_clks[MSTP106]),
++ CLKDEV_DEV_ID("e800d800.spi", &mstp_clks[MSTP105]),
++ CLKDEV_DEV_ID("e800e000.spi", &mstp_clks[MSTP104]),
++ CLKDEV_DEV_ID("e800e800.spi", &mstp_clks[MSTP103]),
+ CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
+ CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
+ CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
+--
+2.1.2
+
diff --git a/patches.renesas/0327-ARM-shmobile-r8a7791-clock-add-QSPI-clocks.patch b/patches.renesas/0327-ARM-shmobile-r8a7791-clock-add-QSPI-clocks.patch
new file mode 100644
index 00000000000000..9099a039fb405c
--- /dev/null
+++ b/patches.renesas/0327-ARM-shmobile-r8a7791-clock-add-QSPI-clocks.patch
@@ -0,0 +1,85 @@
+From 22d48d8573115f81c99a8816f78c4141cbeb8fa7 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Tue, 4 Feb 2014 16:24:00 +0100
+Subject: ARM: shmobile: r8a7791 clock: add QSPI clocks
+
+The QSPI clock divider value depends on the MD1, MD2, and MD3 mode
+switches.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Acked-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d2eec3d5251216942e1d425300686f1a18bc615d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index e4e4dfac85e9..c8227b334e61 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -101,6 +101,7 @@ static struct clk main_clk = {
+ */
+ SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1);
+ SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1);
++SH_FIXED_RATIO_CLK_SET(qspi_clk, pll1_clk, 1, 1);
+
+ /* fixed ratio clock */
+ SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2);
+@@ -124,6 +125,7 @@ static struct clk *main_clks[] = {
+ &pll3_clk,
+ &hp_clk,
+ &p_clk,
++ &qspi_clk,
+ &rclk_clk,
+ &mp_clk,
+ &cp_clk,
+@@ -135,6 +137,7 @@ static struct clk *main_clks[] = {
+ /* MSTP */
+ enum {
+ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
++ MSTP917,
+ MSTP815, MSTP814,
+ MSTP813,
+ MSTP811, MSTP810, MSTP809,
+@@ -154,6 +157,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
+ [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
+ [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
++ [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
+ [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
+ [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
+ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
+@@ -195,6 +199,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_CON_ID("zs", &zs_clk),
+ CLKDEV_CON_ID("hp", &hp_clk),
+ CLKDEV_CON_ID("p", &p_clk),
++ CLKDEV_CON_ID("qspi", &qspi_clk),
+ CLKDEV_CON_ID("rclk", &rclk_clk),
+ CLKDEV_CON_ID("mp", &mp_clk),
+ CLKDEV_CON_ID("cp", &cp_clk),
+@@ -220,6 +225,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */
+ CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
++ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+ CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
+@@ -271,6 +277,11 @@ void __init r8a7791_clock_init(void)
+ break;
+ }
+
++ if ((mode & (MD(3) | MD(2) | MD(1))) == MD(2))
++ SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 16);
++ else
++ SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 20);
++
+ for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
+ ret = clk_register(main_clks[k]);
+
+--
+2.1.2
+
diff --git a/patches.renesas/0328-ARM-shmobile-r7s72100-Add-clock-for-r7s72100-ether.patch b/patches.renesas/0328-ARM-shmobile-r7s72100-Add-clock-for-r7s72100-ether.patch
new file mode 100644
index 00000000000000..b426564c726d5f
--- /dev/null
+++ b/patches.renesas/0328-ARM-shmobile-r7s72100-Add-clock-for-r7s72100-ether.patch
@@ -0,0 +1,52 @@
+From 8c3328000e0d62a128eaf51b80c5383091044bda Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Sun, 15 Dec 2013 16:24:53 +0900
+Subject: ARM: shmobile: r7s72100: Add clock for r7s72100-ether
+
+Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 0e7ed0c1613aea101205b4e0413f75ef8141bf3d)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r7s72100.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
+index 71c99feeff01..f17a5db00221 100644
+--- a/arch/arm/mach-shmobile/clock-r7s72100.c
++++ b/arch/arm/mach-shmobile/clock-r7s72100.c
+@@ -28,6 +28,7 @@
+ /* Standby Control Registers */
+ #define STBCR3 0xfcfe0420
+ #define STBCR4 0xfcfe0424
++#define STBCR7 0xfcfe0430
+ #define STBCR9 0xfcfe0438
+ #define STBCR10 0xfcfe043c
+
+@@ -150,6 +151,7 @@ struct clk div4_clks[DIV4_NR] = {
+ enum {
+ MSTP107, MSTP106, MSTP105, MSTP104, MSTP103,
+ MSTP97, MSTP96, MSTP95, MSTP94,
++ MSTP74,
+ MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
+ MSTP33, MSTP_NR
+ };
+@@ -164,6 +166,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */
+ [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */
+ [MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */
++ [MSTP74] = SH_CLK_MSTP8(&peripheral1_clk, STBCR7, 4, 0), /* Ether */
+ [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
+ [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
+ [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
+@@ -200,6 +203,7 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
+ CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
+ CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
++ CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]),
+ CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
+
+ /* ICK */
+--
+2.1.2
+
diff --git a/patches.renesas/0329-ARM-shmobile-Add-r8a7791-legacy-SDHI-clocks.patch b/patches.renesas/0329-ARM-shmobile-Add-r8a7791-legacy-SDHI-clocks.patch
new file mode 100644
index 00000000000000..0b32747ae60a72
--- /dev/null
+++ b/patches.renesas/0329-ARM-shmobile-Add-r8a7791-legacy-SDHI-clocks.patch
@@ -0,0 +1,123 @@
+From 52fc15bbd07f9b47c4f12e593ce71da0450820e3 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 12 Feb 2014 13:26:01 +0900
+Subject: ARM: shmobile: Add r8a7791 legacy SDHI clocks
+
+Add legacy r8a7791 SDHI clocks. This to allow the SDHI devices
+to be used by legacy Koelsch board support.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4bfb358b1d6cdeff8c6a13677f01ed78e9696b98)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 51 ++++++++++++++++++++++++++++++++--
+ 1 file changed, 49 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index c8227b334e61..3e1b6b699184 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -61,6 +61,7 @@
+
+ #define MSTPSR1 IOMEM(0xe6150038)
+ #define MSTPSR2 IOMEM(0xe6150040)
++#define MSTPSR3 IOMEM(0xe6150048)
+ #define MSTPSR5 IOMEM(0xe615003c)
+ #define MSTPSR7 IOMEM(0xe61501c4)
+ #define MSTPSR8 IOMEM(0xe61509a0)
+@@ -69,8 +70,8 @@
+
+ #define MODEMR 0xE6160060
+ #define SDCKCR 0xE6150074
+-#define SD2CKCR 0xE6150078
+-#define SD3CKCR 0xE615007C
++#define SD1CKCR 0xE6150078
++#define SD2CKCR 0xE615026c
+ #define MMC0CKCR 0xE6150240
+ #define MMC1CKCR 0xE6150244
+ #define SSPCKCR 0xE6150248
+@@ -134,6 +135,39 @@ static struct clk *main_clks[] = {
+ &zs_clk,
+ };
+
++/* SDHI (DIV4) clock */
++static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10 };
++
++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,
++};
++
++enum {
++ DIV4_SDH, DIV4_SD0,
++ DIV4_NR
++};
++
++static struct clk div4_clks[DIV4_NR] = {
++ [DIV4_SDH] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 8, 0x0dff, CLK_ENABLE_ON_INIT),
++ [DIV4_SD0] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 4, 0x1de0, CLK_ENABLE_ON_INIT),
++};
++
++/* DIV6 clocks */
++enum {
++ DIV6_SD1, DIV6_SD2,
++ DIV6_NR
++};
++
++static struct clk div6_clks[DIV6_NR] = {
++ [DIV6_SD1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
++ [DIV6_SD2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
++};
++
+ /* MSTP */
+ enum {
+ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
+@@ -144,6 +178,7 @@ enum {
+ MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
+ MSTP719, MSTP718, MSTP715, MSTP714,
+ MSTP522,
++ MSTP314, MSTP312, MSTP311,
+ MSTP216, MSTP207, MSTP206,
+ MSTP204, MSTP203, MSTP202, MSTP1105, MSTP1106, MSTP1107,
+ MSTP124,
+@@ -174,6 +209,9 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP715] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 15, MSTPSR7, 0), /* SCIF4 */
+ [MSTP714] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 14, MSTPSR7, 0), /* SCIF5 */
+ [MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
++ [MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
++ [MSTP312] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD1], SMSTPCR3, 12, MSTPSR3, 0), /* SDHI1 */
++ [MSTP311] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD2], SMSTPCR3, 11, MSTPSR3, 0), /* SDHI2 */
+ [MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
+ [MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
+ [MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
+@@ -224,6 +262,9 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */
+ CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */
+ CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */
++ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
++ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]),
++ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+ CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+@@ -286,6 +327,12 @@ void __init r8a7791_clock_init(void)
+ 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_mstp_register(mstp_clks, MSTP_NR);
+
+ clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+--
+2.1.2
+
diff --git a/patches.renesas/0330-ARM-shmobile-Remove-legacy-r8a7790-DT-clocks.patch b/patches.renesas/0330-ARM-shmobile-Remove-legacy-r8a7790-DT-clocks.patch
new file mode 100644
index 00000000000000..79f2374502ed4a
--- /dev/null
+++ b/patches.renesas/0330-ARM-shmobile-Remove-legacy-r8a7790-DT-clocks.patch
@@ -0,0 +1,58 @@
+From ffa959f023de76584d09885823c32a2aaf18d420 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 12 Feb 2014 13:09:37 +0900
+Subject: ARM: shmobile: Remove legacy r8a7790 DT clocks
+
+The DT device case is handled by CCF these days, so get
+rid of DT devices from the legacy clocks for r8a7790.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit df55f6685a04a259cf59cd3fde02212b294461cc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index 08a28034ca1d..02b940361a66 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -328,34 +328,23 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
+ CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
+ CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
+- CLKDEV_DEV_ID("e6508000.i2c", &mstp_clks[MSTP931]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
+- CLKDEV_DEV_ID("e6518000.i2c", &mstp_clks[MSTP930]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
+- CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP929]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]),
+- CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP928]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
+ CLKDEV_DEV_ID("r8a7790-ether", &mstp_clks[MSTP813]),
+ CLKDEV_DEV_ID("r8a7790-vin.0", &mstp_clks[MSTP811]),
+ CLKDEV_DEV_ID("r8a7790-vin.1", &mstp_clks[MSTP810]),
+ CLKDEV_DEV_ID("r8a7790-vin.2", &mstp_clks[MSTP809]),
+ CLKDEV_DEV_ID("r8a7790-vin.3", &mstp_clks[MSTP808]),
+- CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP502]),
+ CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP501]),
+- CLKDEV_DEV_ID("ee200000.mmc", &mstp_clks[MSTP315]),
+ CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
+- CLKDEV_DEV_ID("ee100000.sd", &mstp_clks[MSTP314]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
+- CLKDEV_DEV_ID("ee120000.sd", &mstp_clks[MSTP313]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
+- CLKDEV_DEV_ID("ee140000.sd", &mstp_clks[MSTP312]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
+- CLKDEV_DEV_ID("ee160000.sd", &mstp_clks[MSTP311]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]),
+- CLKDEV_DEV_ID("ee220000.mmc", &mstp_clks[MSTP305]),
+ CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+--
+2.1.2
+
diff --git a/patches.renesas/0331-ARM-shmobile-Use-64-bit-dma_addr_t-on-r8a7790-r8a779.patch b/patches.renesas/0331-ARM-shmobile-Use-64-bit-dma_addr_t-on-r8a7790-r8a779.patch
new file mode 100644
index 00000000000000..0f06c379256ac4
--- /dev/null
+++ b/patches.renesas/0331-ARM-shmobile-Use-64-bit-dma_addr_t-on-r8a7790-r8a779.patch
@@ -0,0 +1,49 @@
+From 262a29e6602a74abfc6115e48c9204659301a720 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 5 Feb 2014 14:36:28 +0900
+Subject: ARM: shmobile: Use 64-bit dma_addr_t on r8a7790/r8a7791
+
+Some on-chip devices on r8a7790 and r8a7791 can do
+bus mastering and access more than 32-bits of address
+space. Select ARCH_DMA_ADDR_T_64BIT when LPAE is set
+in case of multiplatform and legacy SoC support.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 4a51856b42672cfcb7d6fbab22dcf2caba2be5ab)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Kconfig | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 1ebf839fa2b8..08ec4ffc17ee 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -9,6 +9,7 @@ config ARCH_SHMOBILE_MULTI
+ select HAVE_ARM_TWD if SMP
+ select ARM_GIC
+ select MIGHT_HAVE_PCI
++ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+ select NO_IOPORT
+ select PINCTRL
+ select ARCH_REQUIRE_GPIOLIB
+@@ -111,6 +112,7 @@ config ARCH_R8A7790
+ select MIGHT_HAVE_PCI
+ select SH_CLK_CPG
+ select RENESAS_IRQC
++ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+
+ config ARCH_R8A7791
+ bool "R-Car M2 (R8A77910)"
+@@ -120,6 +122,7 @@ config ARCH_R8A7791
+ select MIGHT_HAVE_PCI
+ select SH_CLK_CPG
+ select RENESAS_IRQC
++ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+
+ config ARCH_EMEV2
+ bool "Emma Mobile EV2"
+--
+2.1.2
+
diff --git a/patches.renesas/0332-ARM-shmobile-Break-out-R-Car-SYSC-PM-code.patch b/patches.renesas/0332-ARM-shmobile-Break-out-R-Car-SYSC-PM-code.patch
new file mode 100644
index 00000000000000..1a04e6e6222af1
--- /dev/null
+++ b/patches.renesas/0332-ARM-shmobile-Break-out-R-Car-SYSC-PM-code.patch
@@ -0,0 +1,498 @@
+From 7cf940109b07e934ae9e6e3e74a6a71b23f858d1 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 15 Jan 2014 16:43:08 +0900
+Subject: ARM: shmobile: Break out R-Car SYSC PM code
+
+Break out the R-Car SYSC power management code from
+the r8a7779 SoC code. With this new shared R-Car SYSC
+code base it is possible to hook in Generation 2 SoCs
+as well.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a6557eb795edcf7832b5278a11842c4ca302f4af)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Makefile | 2 +-
+ arch/arm/mach-shmobile/include/mach/pm-rcar.h | 15 +++
+ arch/arm/mach-shmobile/include/mach/r8a7779.h | 13 +--
+ arch/arm/mach-shmobile/pm-r8a7779.c | 131 ++----------------------
+ arch/arm/mach-shmobile/pm-rcar.c | 142 ++++++++++++++++++++++++++
+ arch/arm/mach-shmobile/smp-r8a7779.c | 17 +--
+ 6 files changed, 177 insertions(+), 143 deletions(-)
+ create mode 100644 arch/arm/mach-shmobile/include/mach/pm-rcar.h
+ create mode 100644 arch/arm/mach-shmobile/pm-rcar.c
+
+diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
+index 1402d602f5a4..6a48dee9d1bd 100644
+--- a/arch/arm/mach-shmobile/Makefile
++++ b/arch/arm/mach-shmobile/Makefile
+@@ -52,7 +52,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
+ obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
+ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
+ obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o
+-obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o
++obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o
+
+ # Board objects
+ ifdef CONFIG_ARCH_SHMOBILE_MULTI
+diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/include/mach/pm-rcar.h
+new file mode 100644
+index 000000000000..ef3a1ef628f1
+--- /dev/null
++++ b/arch/arm/mach-shmobile/include/mach/pm-rcar.h
+@@ -0,0 +1,15 @@
++#ifndef PM_RCAR_H
++#define PM_RCAR_H
++
++struct rcar_sysc_ch {
++ unsigned long chan_offs;
++ unsigned int chan_bit;
++ unsigned int isr_bit;
++};
++
++int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch);
++int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch);
++bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch);
++void __iomem *rcar_sysc_init(phys_addr_t base);
++
++#endif /* PM_RCAR_H */
+diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
+index b40e13631f6a..88eeceaf1088 100644
+--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
++++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
+@@ -3,6 +3,7 @@
+
+ #include <linux/sh_clk.h>
+ #include <linux/pm_domain.h>
++#include <mach/pm-rcar.h>
+
+ /* HPB-DMA slave IDs */
+ enum {
+@@ -11,18 +12,12 @@ enum {
+ HPBDMA_SLAVE_SDHI0_RX,
+ };
+
+-struct r8a7779_pm_ch {
+- unsigned long chan_offs;
+- unsigned int chan_bit;
+- unsigned int isr_bit;
+-};
+-
+ struct r8a7779_pm_domain {
+ struct generic_pm_domain genpd;
+- struct r8a7779_pm_ch ch;
++ struct rcar_sysc_ch ch;
+ };
+
+-static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d)
++static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d)
+ {
+ return &container_of(d, struct r8a7779_pm_domain, genpd)->ch;
+ }
+@@ -41,8 +36,6 @@ extern void r8a7779_clock_init(void);
+ extern void r8a7779_pinmux_init(void);
+ extern void r8a7779_pm_init(void);
+ extern void r8a7779_register_twd(void);
+-extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch);
+-extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch);
+
+ #ifdef CONFIG_PM
+ extern void __init r8a7779_init_pm_domains(void);
+diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c
+index d50a8e9b94a4..d6fe189b2df6 100644
+--- a/arch/arm/mach-shmobile/pm-r8a7779.c
++++ b/arch/arm/mach-shmobile/pm-r8a7779.c
+@@ -20,132 +20,22 @@
+ #include <linux/console.h>
+ #include <asm/io.h>
+ #include <mach/common.h>
++#include <mach/pm-rcar.h>
+ #include <mach/r8a7779.h>
+
+-static void __iomem *r8a7779_sysc_base;
+-
+ /* SYSC */
+-#define SYSCSR 0x00
+-#define SYSCISR 0x04
+-#define SYSCISCR 0x08
+ #define SYSCIER 0x0c
+ #define SYSCIMR 0x10
+-#define PWRSR0 0x40
+-#define PWRSR1 0x80
+-#define PWRSR2 0xc0
+-#define PWRSR3 0x100
+-#define PWRSR4 0x140
+-
+-#define PWRSR_OFFS 0x00
+-#define PWROFFCR_OFFS 0x04
+-#define PWRONCR_OFFS 0x0c
+-#define PWRER_OFFS 0x14
+-
+-#define SYSCSR_RETRIES 100
+-#define SYSCSR_DELAY_US 1
+-
+-#define SYSCISR_RETRIES 1000
+-#define SYSCISR_DELAY_US 1
+
+ #if defined(CONFIG_PM) || defined(CONFIG_SMP)
+
+-static DEFINE_SPINLOCK(r8a7779_sysc_lock); /* SMP CPUs + I/O devices */
+-
+-static int r8a7779_sysc_pwr_on_off(struct r8a7779_pm_ch *r8a7779_ch,
+- int sr_bit, int reg_offs)
+-{
+- int k;
+-
+- for (k = 0; k < SYSCSR_RETRIES; k++) {
+- if (ioread32(r8a7779_sysc_base + SYSCSR) & (1 << sr_bit))
+- break;
+- udelay(SYSCSR_DELAY_US);
+- }
+-
+- if (k == SYSCSR_RETRIES)
+- return -EAGAIN;
+-
+- iowrite32(1 << r8a7779_ch->chan_bit,
+- r8a7779_sysc_base + r8a7779_ch->chan_offs + reg_offs);
+-
+- return 0;
+-}
+-
+-static int r8a7779_sysc_pwr_off(struct r8a7779_pm_ch *r8a7779_ch)
+-{
+- return r8a7779_sysc_pwr_on_off(r8a7779_ch, 0, PWROFFCR_OFFS);
+-}
+-
+-static int r8a7779_sysc_pwr_on(struct r8a7779_pm_ch *r8a7779_ch)
+-{
+- return r8a7779_sysc_pwr_on_off(r8a7779_ch, 1, PWRONCR_OFFS);
+-}
+-
+-static int r8a7779_sysc_update(struct r8a7779_pm_ch *r8a7779_ch,
+- int (*on_off_fn)(struct r8a7779_pm_ch *))
+-{
+- unsigned int isr_mask = 1 << r8a7779_ch->isr_bit;
+- unsigned int chan_mask = 1 << r8a7779_ch->chan_bit;
+- unsigned int status;
+- unsigned long flags;
+- int ret = 0;
+- int k;
+-
+- spin_lock_irqsave(&r8a7779_sysc_lock, flags);
+-
+- iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR);
+-
+- do {
+- ret = on_off_fn(r8a7779_ch);
+- if (ret)
+- goto out;
+-
+- status = ioread32(r8a7779_sysc_base +
+- r8a7779_ch->chan_offs + PWRER_OFFS);
+- } while (status & chan_mask);
+-
+- for (k = 0; k < SYSCISR_RETRIES; k++) {
+- if (ioread32(r8a7779_sysc_base + SYSCISR) & isr_mask)
+- break;
+- udelay(SYSCISR_DELAY_US);
+- }
+-
+- if (k == SYSCISR_RETRIES)
+- ret = -EIO;
+-
+- iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR);
+-
+- out:
+- spin_unlock_irqrestore(&r8a7779_sysc_lock, flags);
+-
+- pr_debug("r8a7779 power domain %d: %02x %02x %02x %02x %02x -> %d\n",
+- r8a7779_ch->isr_bit, ioread32(r8a7779_sysc_base + PWRSR0),
+- ioread32(r8a7779_sysc_base + PWRSR1),
+- ioread32(r8a7779_sysc_base + PWRSR2),
+- ioread32(r8a7779_sysc_base + PWRSR3),
+- ioread32(r8a7779_sysc_base + PWRSR4), ret);
+- return ret;
+-}
+-
+-int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch)
+-{
+- return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_off);
+-}
+-
+-int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch)
+-{
+- return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_on);
+-}
+-
+ static void __init r8a7779_sysc_init(void)
+ {
+- r8a7779_sysc_base = ioremap_nocache(0xffd85000, PAGE_SIZE);
+- if (!r8a7779_sysc_base)
+- panic("unable to ioremap r8a7779 SYSC hardware block\n");
++ void __iomem *base = rcar_sysc_init(0xffd85000);
+
+ /* enable all interrupt sources, but do not use interrupt handler */
+- iowrite32(0x0131000e, r8a7779_sysc_base + SYSCIER);
+- iowrite32(0, r8a7779_sysc_base + SYSCIMR);
++ iowrite32(0x0131000e, base + SYSCIER);
++ iowrite32(0, base + SYSCIMR);
+ }
+
+ #else /* CONFIG_PM || CONFIG_SMP */
+@@ -158,24 +48,17 @@ static inline void r8a7779_sysc_init(void) {}
+
+ static int pd_power_down(struct generic_pm_domain *genpd)
+ {
+- return r8a7779_sysc_power_down(to_r8a7779_ch(genpd));
++ return rcar_sysc_power_down(to_r8a7779_ch(genpd));
+ }
+
+ static int pd_power_up(struct generic_pm_domain *genpd)
+ {
+- return r8a7779_sysc_power_up(to_r8a7779_ch(genpd));
++ return rcar_sysc_power_up(to_r8a7779_ch(genpd));
+ }
+
+ static bool pd_is_off(struct generic_pm_domain *genpd)
+ {
+- struct r8a7779_pm_ch *r8a7779_ch = to_r8a7779_ch(genpd);
+- unsigned int st;
+-
+- st = ioread32(r8a7779_sysc_base + r8a7779_ch->chan_offs + PWRSR_OFFS);
+- if (st & (1 << r8a7779_ch->chan_bit))
+- return true;
+-
+- return false;
++ return rcar_sysc_power_is_off(to_r8a7779_ch(genpd));
+ }
+
+ static bool pd_active_wakeup(struct device *dev)
+diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c
+new file mode 100644
+index 000000000000..17225db09558
+--- /dev/null
++++ b/arch/arm/mach-shmobile/pm-rcar.c
+@@ -0,0 +1,142 @@
++/*
++ * R-Car SYSC Power management support
++ *
++ * Copyright (C) 2014 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/delay.h>
++#include <linux/err.h>
++#include <linux/mm.h>
++#include <linux/spinlock.h>
++#include <asm/io.h>
++#include <mach/pm-rcar.h>
++
++static void __iomem *rcar_sysc_base;
++
++/* SYSC */
++#define SYSCSR 0x00
++#define SYSCISR 0x04
++#define SYSCISCR 0x08
++
++#define PWRSR_OFFS 0x00
++#define PWROFFCR_OFFS 0x04
++#define PWRONCR_OFFS 0x0c
++#define PWRER_OFFS 0x14
++
++#define SYSCSR_RETRIES 100
++#define SYSCSR_DELAY_US 1
++
++#define SYSCISR_RETRIES 1000
++#define SYSCISR_DELAY_US 1
++
++#if defined(CONFIG_PM) || defined(CONFIG_SMP)
++
++static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */
++
++static int rcar_sysc_pwr_on_off(struct rcar_sysc_ch *sysc_ch,
++ int sr_bit, int reg_offs)
++{
++ int k;
++
++ for (k = 0; k < SYSCSR_RETRIES; k++) {
++ if (ioread32(rcar_sysc_base + SYSCSR) & (1 << sr_bit))
++ break;
++ udelay(SYSCSR_DELAY_US);
++ }
++
++ if (k == SYSCSR_RETRIES)
++ return -EAGAIN;
++
++ iowrite32(1 << sysc_ch->chan_bit,
++ rcar_sysc_base + sysc_ch->chan_offs + reg_offs);
++
++ return 0;
++}
++
++static int rcar_sysc_pwr_off(struct rcar_sysc_ch *sysc_ch)
++{
++ return rcar_sysc_pwr_on_off(sysc_ch, 0, PWROFFCR_OFFS);
++}
++
++static int rcar_sysc_pwr_on(struct rcar_sysc_ch *sysc_ch)
++{
++ return rcar_sysc_pwr_on_off(sysc_ch, 1, PWRONCR_OFFS);
++}
++
++static int rcar_sysc_update(struct rcar_sysc_ch *sysc_ch,
++ int (*on_off_fn)(struct rcar_sysc_ch *))
++{
++ unsigned int isr_mask = 1 << sysc_ch->isr_bit;
++ unsigned int chan_mask = 1 << sysc_ch->chan_bit;
++ unsigned int status;
++ unsigned long flags;
++ int ret = 0;
++ int k;
++
++ spin_lock_irqsave(&rcar_sysc_lock, flags);
++
++ iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
++
++ do {
++ ret = on_off_fn(sysc_ch);
++ if (ret)
++ goto out;
++
++ status = ioread32(rcar_sysc_base +
++ sysc_ch->chan_offs + PWRER_OFFS);
++ } while (status & chan_mask);
++
++ for (k = 0; k < SYSCISR_RETRIES; k++) {
++ if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask)
++ break;
++ udelay(SYSCISR_DELAY_US);
++ }
++
++ if (k == SYSCISR_RETRIES)
++ ret = -EIO;
++
++ iowrite32(isr_mask, rcar_sysc_base + SYSCISCR);
++
++ out:
++ spin_unlock_irqrestore(&rcar_sysc_lock, flags);
++
++ pr_debug("sysc power domain %d: %08x -> %d\n",
++ sysc_ch->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret);
++ return ret;
++}
++
++int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch)
++{
++ return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_off);
++}
++
++int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch)
++{
++ return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_on);
++}
++
++bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch)
++{
++ unsigned int st;
++
++ st = ioread32(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS);
++ if (st & (1 << sysc_ch->chan_bit))
++ return true;
++
++ return false;
++}
++
++void __iomem *rcar_sysc_init(phys_addr_t base)
++{
++ rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE);
++ if (!rcar_sysc_base)
++ panic("unable to ioremap R-Car SYSC hardware block\n");
++
++ return rcar_sysc_base;
++}
++
++#endif /* CONFIG_PM || CONFIG_SMP */
+diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
+index 627c1f0d9478..e7a3201473d0 100644
+--- a/arch/arm/mach-shmobile/smp-r8a7779.c
++++ b/arch/arm/mach-shmobile/smp-r8a7779.c
+@@ -24,6 +24,7 @@
+ #include <linux/io.h>
+ #include <linux/delay.h>
+ #include <mach/common.h>
++#include <mach/pm-rcar.h>
+ #include <mach/r8a7779.h>
+ #include <asm/cacheflush.h>
+ #include <asm/smp_plat.h>
+@@ -33,25 +34,25 @@
+ #define AVECR IOMEM(0xfe700040)
+ #define R8A7779_SCU_BASE 0xf0000000
+
+-static struct r8a7779_pm_ch r8a7779_ch_cpu1 = {
++static struct rcar_sysc_ch r8a7779_ch_cpu1 = {
+ .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
+ .chan_bit = 1, /* ARM1 */
+ .isr_bit = 1, /* ARM1 */
+ };
+
+-static struct r8a7779_pm_ch r8a7779_ch_cpu2 = {
++static struct rcar_sysc_ch r8a7779_ch_cpu2 = {
+ .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
+ .chan_bit = 2, /* ARM2 */
+ .isr_bit = 2, /* ARM2 */
+ };
+
+-static struct r8a7779_pm_ch r8a7779_ch_cpu3 = {
++static struct rcar_sysc_ch r8a7779_ch_cpu3 = {
+ .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */
+ .chan_bit = 3, /* ARM3 */
+ .isr_bit = 3, /* ARM3 */
+ };
+
+-static struct r8a7779_pm_ch *r8a7779_ch_cpu[4] = {
++static struct rcar_sysc_ch *r8a7779_ch_cpu[4] = {
+ [1] = &r8a7779_ch_cpu1,
+ [2] = &r8a7779_ch_cpu2,
+ [3] = &r8a7779_ch_cpu3,
+@@ -67,7 +68,7 @@ void __init r8a7779_register_twd(void)
+
+ static int r8a7779_platform_cpu_kill(unsigned int cpu)
+ {
+- struct r8a7779_pm_ch *ch = NULL;
++ struct rcar_sysc_ch *ch = NULL;
+ int ret = -EIO;
+
+ cpu = cpu_logical_map(cpu);
+@@ -76,14 +77,14 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu)
+ ch = r8a7779_ch_cpu[cpu];
+
+ if (ch)
+- ret = r8a7779_sysc_power_down(ch);
++ ret = rcar_sysc_power_down(ch);
+
+ return ret ? ret : 1;
+ }
+
+ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
+ {
+- struct r8a7779_pm_ch *ch = NULL;
++ struct rcar_sysc_ch *ch = NULL;
+ unsigned int lcpu = cpu_logical_map(cpu);
+ int ret;
+
+@@ -91,7 +92,7 @@ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle)
+ ch = r8a7779_ch_cpu[lcpu];
+
+ if (ch)
+- ret = r8a7779_sysc_power_up(ch);
++ ret = rcar_sysc_power_up(ch);
+ else
+ ret = -EIO;
+
+--
+2.1.2
+
diff --git a/patches.renesas/0333-ARM-shmobile-r8a7790-SYSC-setup-code.patch b/patches.renesas/0333-ARM-shmobile-r8a7790-SYSC-setup-code.patch
new file mode 100644
index 00000000000000..8c48616fbec547
--- /dev/null
+++ b/patches.renesas/0333-ARM-shmobile-r8a7790-SYSC-setup-code.patch
@@ -0,0 +1,100 @@
+From 66db3d24e32cabb0d7430622c2ac6de01d50840a Mon Sep 17 00:00:00 2001
+From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
+Date: Wed, 15 Jan 2014 21:25:49 +0900
+Subject: ARM: shmobile: r8a7790 SYSC setup code
+
+Add r8a7790 SYSC power management support.
+
+Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
+Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
+[damm@opensource.se: Converted to use broken out SYSC code]
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit a48f165509c18d47f1505888a21918e8a06d590f)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/Makefile | 1 +
+ arch/arm/mach-shmobile/include/mach/r8a7790.h | 1 +
+ arch/arm/mach-shmobile/pm-r8a7790.c | 45 +++++++++++++++++++++++++++
+ 3 files changed, 47 insertions(+)
+ create mode 100644 arch/arm/mach-shmobile/pm-r8a7790.c
+
+diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
+index 6a48dee9d1bd..4caffc912a81 100644
+--- a/arch/arm/mach-shmobile/Makefile
++++ b/arch/arm/mach-shmobile/Makefile
+@@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o
+ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o
+ obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o
+ obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o
++obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o
+
+ # Board objects
+ ifdef CONFIG_ARCH_SHMOBILE_MULTI
+diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h
+index 2177325af22f..0b95babe84ba 100644
+--- a/arch/arm/mach-shmobile/include/mach/r8a7790.h
++++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h
+@@ -32,6 +32,7 @@ void r8a7790_add_standard_devices(void);
+ void r8a7790_add_dt_devices(void);
+ void r8a7790_clock_init(void);
+ void r8a7790_pinmux_init(void);
++void r8a7790_pm_init(void);
+ void r8a7790_init_early(void);
+ extern struct smp_operations r8a7790_smp_ops;
+
+diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c
+new file mode 100644
+index 000000000000..fc82839e2c2a
+--- /dev/null
++++ b/arch/arm/mach-shmobile/pm-r8a7790.c
+@@ -0,0 +1,45 @@
++/*
++ * r8a7790 Power management support
++ *
++ * Copyright (C) 2013 Renesas Electronics Corporation
++ * Copyright (C) 2011 Renesas Solutions Corp.
++ * Copyright (C) 2011 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/kernel.h>
++#include <asm/io.h>
++#include <mach/pm-rcar.h>
++#include <mach/r8a7790.h>
++
++/* SYSC */
++#define SYSCIER 0x0c
++#define SYSCIMR 0x10
++
++#if defined(CONFIG_SMP)
++
++static void __init r8a7790_sysc_init(void)
++{
++ void __iomem *base = rcar_sysc_init(0xe6180000);
++
++ /* enable all interrupt sources, but do not use interrupt handler */
++ iowrite32(0x0131000e, base + SYSCIER);
++ iowrite32(0, base + SYSCIMR);
++}
++
++#else /* CONFIG_SMP */
++
++static inline void r8a7790_sysc_init(void) {}
++
++#endif /* CONFIG_SMP */
++
++void __init r8a7790_pm_init(void)
++{
++ static int once;
++
++ if (!once++)
++ r8a7790_sysc_init();
++}
+--
+2.1.2
+
diff --git a/patches.renesas/0334-ARM-shmobile-r8a7790-CA7-SCU-enablement.patch b/patches.renesas/0334-ARM-shmobile-r8a7790-CA7-SCU-enablement.patch
new file mode 100644
index 00000000000000..b15f006aa48690
--- /dev/null
+++ b/patches.renesas/0334-ARM-shmobile-r8a7790-CA7-SCU-enablement.patch
@@ -0,0 +1,57 @@
+From 7bdfec29a54d500109eadaed76ccef43564aee2e Mon Sep 17 00:00:00 2001
+From: Gaku Inami <gaku.inami.xw@bp.renesas.com>
+Date: Wed, 15 Jan 2014 21:26:04 +0900
+Subject: ARM: shmobile: r8a7790 CA7-SCU enablement
+
+Power on CA7 SCU in case of booting from a CA15 core.
+
+Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
+[damm@opensource.se: Converted to use broken out SYSC code]
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit 0445ded61aac0c1a6f43b4be1a2ca2ca47b77eb8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/smp-r8a7790.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
+index 015e2753de1f..beb47ae9d05a 100644
+--- a/arch/arm/mach-shmobile/smp-r8a7790.c
++++ b/arch/arm/mach-shmobile/smp-r8a7790.c
+@@ -19,6 +19,8 @@
+ #include <linux/io.h>
+ #include <asm/smp_plat.h>
+ #include <mach/common.h>
++#include <mach/pm-rcar.h>
++#include <mach/r8a7790.h>
+
+ #define RST 0xe6160000
+ #define CA15BAR 0x0020
+@@ -27,6 +29,11 @@
+ #define CA7RESCNT 0x0044
+ #define MERAM 0xe8080000
+
++static struct rcar_sysc_ch r8a7790_ca7_scu = {
++ .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
++ .isr_bit = 21, /* CA7-SCU */
++};
++
+ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
+ {
+ void __iomem *p;
+@@ -54,6 +61,10 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
+ writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
+ p + CA7RESCNT);
+ iounmap(p);
++
++ /* turn on power to SCU */
++ r8a7790_pm_init();
++ rcar_sysc_power_up(&r8a7790_ca7_scu);
+ }
+
+ struct smp_operations r8a7790_smp_ops __initdata = {
+--
+2.1.2
+
diff --git a/patches.renesas/0335-ARM-shmobile-r8a7790-CA15-SCU-enablement.patch b/patches.renesas/0335-ARM-shmobile-r8a7790-CA15-SCU-enablement.patch
new file mode 100644
index 00000000000000..52b1ad0c5f74f0
--- /dev/null
+++ b/patches.renesas/0335-ARM-shmobile-r8a7790-CA15-SCU-enablement.patch
@@ -0,0 +1,45 @@
+From 5ca09bd090c714057b5ca0dde536f296750d40b1 Mon Sep 17 00:00:00 2001
+From: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
+Date: Wed, 15 Jan 2014 21:26:13 +0900
+Subject: ARM: shmobile: r8a7790 CA15-SCU enablement
+
+Power on CA15 SCU in case of booting from a CA7 core.
+
+Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
+[damm@opensource.se: Converted to use broken out SYSC code]
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit c2c97ec513b503b9e0d28ffd98d54c9e9bf3ea3e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/smp-r8a7790.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
+index beb47ae9d05a..591052799e8f 100644
+--- a/arch/arm/mach-shmobile/smp-r8a7790.c
++++ b/arch/arm/mach-shmobile/smp-r8a7790.c
+@@ -29,6 +29,11 @@
+ #define CA7RESCNT 0x0044
+ #define MERAM 0xe8080000
+
++static struct rcar_sysc_ch r8a7790_ca15_scu = {
++ .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
++ .isr_bit = 12, /* CA15-SCU */
++};
++
+ static struct rcar_sysc_ch r8a7790_ca7_scu = {
+ .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
+ .isr_bit = 21, /* CA7-SCU */
+@@ -64,6 +69,7 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
+
+ /* turn on power to SCU */
+ r8a7790_pm_init();
++ rcar_sysc_power_up(&r8a7790_ca15_scu);
+ rcar_sysc_power_up(&r8a7790_ca7_scu);
+ }
+
+--
+2.1.2
+
diff --git a/patches.renesas/0336-ARM-shmobile-Remove-__init-from-rcar_gen2_read_mode_.patch b/patches.renesas/0336-ARM-shmobile-Remove-__init-from-rcar_gen2_read_mode_.patch
new file mode 100644
index 00000000000000..f21551f6727bf3
--- /dev/null
+++ b/patches.renesas/0336-ARM-shmobile-Remove-__init-from-rcar_gen2_read_mode_.patch
@@ -0,0 +1,34 @@
+From aedd3e4430266d9fb49b55a9848fd858edd6e973 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 17 Feb 2014 15:35:10 +0900
+Subject: ARM: shmobile: Remove __init from rcar_gen2_read_mode_pins()
+
+Remove __init from rcar_gen2_read_mode_pins() to allow
+it to be used after boot. For instance the R-Car Gen2
+MD21 check is needed even in the case of CPU Hotplug.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit e7509f6eca10cff3933f8a71f4ca9d8be8447ec3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
+index 69ccc6c6fd33..10604480f325 100644
+--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
++++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
+@@ -28,7 +28,7 @@
+
+ #define MODEMR 0xe6160060
+
+-u32 __init rcar_gen2_read_mode_pins(void)
++u32 rcar_gen2_read_mode_pins(void)
+ {
+ void __iomem *modemr = ioremap_nocache(MODEMR, 4);
+ u32 mode;
+--
+2.1.2
+
diff --git a/patches.renesas/0337-ARM-shmobile-r8a7791-Remove-legacy-clock-aliases-for.patch b/patches.renesas/0337-ARM-shmobile-r8a7791-Remove-legacy-clock-aliases-for.patch
new file mode 100644
index 00000000000000..67707b0e955e70
--- /dev/null
+++ b/patches.renesas/0337-ARM-shmobile-r8a7791-Remove-legacy-clock-aliases-for.patch
@@ -0,0 +1,33 @@
+From 125bf198453551d0f815fafd20997a8eda5b2d6a Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Wed, 19 Feb 2014 18:03:31 +0100
+Subject: ARM: shmobile: r8a7791: Remove legacy clock aliases for DT devices
+
+Now that the r8a7791 DT platforms use the common clock framework,
+there's no need to manually create clock aliases for devices
+instantiated through DT, as those devices will reference their clocks
+directly in the device tree. Remove those aliases.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a8a8266229787241e1dfdb075a416e31da2fa1d7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index 3e1b6b699184..605fc778e3e2 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -267,7 +267,6 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
+ CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
+ CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
+- CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
+ CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
+--
+2.1.2
+
diff --git a/patches.renesas/0338-ARM-shmobile-r8a7790-add-sound-SCU-clock-support.patch b/patches.renesas/0338-ARM-shmobile-r8a7790-add-sound-SCU-clock-support.patch
new file mode 100644
index 00000000000000..5a4f185de21be3
--- /dev/null
+++ b/patches.renesas/0338-ARM-shmobile-r8a7790-add-sound-SCU-clock-support.patch
@@ -0,0 +1,70 @@
+From b88b79286044958e4bef2c67d77eba91a741d395 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Tue, 18 Feb 2014 19:28:11 -0800
+Subject: ARM: shmobile: r8a7790: add sound SCU clock support
+
+This is needed to use SRC (= Sampling Rate Converter).
+MSTP1017 is defined top of MSTPxxx list to avoid runtime error,
+since it is parent clock of MSTP1031 - MSTP1022
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9ced1d47719b5f32e4231338dd362c136518ed08)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7790.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
+index 02b940361a66..3f93503f5b96 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7790.c
++++ b/arch/arm/mach-shmobile/clock-r8a7790.c
+@@ -204,6 +204,10 @@ static struct clk div6_clks[DIV6_NR] = {
+
+ /* MSTP */
+ enum {
++ MSTP1017, /* parent of SCU */
++
++ MSTP1031, MSTP1030,
++ MSTP1029, MSTP1028, MSTP1027, MSTP1026, MSTP1025, MSTP1024, MSTP1023, MSTP1022,
+ MSTP1015, MSTP1014, MSTP1013, MSTP1012, MSTP1011, MSTP1010,
+ MSTP1009, MSTP1008, MSTP1007, MSTP1006, MSTP1005,
+ MSTP931, MSTP930, MSTP929, MSTP928,
+@@ -223,6 +227,17 @@ enum {
+ };
+
+ static struct clk mstp_clks[MSTP_NR] = {
++ [MSTP1031] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 31, MSTPSR10, 0), /* SCU0 */
++ [MSTP1030] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 30, MSTPSR10, 0), /* SCU1 */
++ [MSTP1029] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 29, MSTPSR10, 0), /* SCU2 */
++ [MSTP1028] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 28, MSTPSR10, 0), /* SCU3 */
++ [MSTP1027] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 27, MSTPSR10, 0), /* SCU4 */
++ [MSTP1026] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 26, MSTPSR10, 0), /* SCU5 */
++ [MSTP1025] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 25, MSTPSR10, 0), /* SCU6 */
++ [MSTP1024] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 24, MSTPSR10, 0), /* SCU7 */
++ [MSTP1023] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 23, MSTPSR10, 0), /* SCU8 */
++ [MSTP1022] = SH_CLK_MSTP32_STS(&mstp_clks[MSTP1017], SMSTPCR10, 22, MSTPSR10, 0), /* SCU9 */
++ [MSTP1017] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 17, MSTPSR10, 0), /* SCU */
+ [MSTP1015] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 15, MSTPSR10, 0), /* SSI0 */
+ [MSTP1014] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 14, MSTPSR10, 0), /* SSI1 */
+ [MSTP1013] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 13, MSTPSR10, 0), /* SSI2 */
+@@ -366,6 +381,16 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
+ CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
+ CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk),
++ CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP1031]),
++ CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP1030]),
++ CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP1029]),
++ CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP1028]),
++ CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP1027]),
++ CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP1026]),
++ CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP1025]),
++ CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP1024]),
++ CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP1023]),
++ CLKDEV_ICK_ID("scu.9", "rcar_sound", &mstp_clks[MSTP1022]),
+ CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]),
+ CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]),
+ CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]),
+--
+2.1.2
+
diff --git a/patches.renesas/0339-ARM-shmobile-r8a7790-add-Ether-DT-support.patch b/patches.renesas/0339-ARM-shmobile-r8a7790-add-Ether-DT-support.patch
new file mode 100644
index 00000000000000..87768ee6cc8536
--- /dev/null
+++ b/patches.renesas/0339-ARM-shmobile-r8a7790-add-Ether-DT-support.patch
@@ -0,0 +1,50 @@
+From 22f2fef23ccc45528a408d46132f2a6ad5d0a4e5 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Thu, 20 Feb 2014 02:20:43 +0300
+Subject: ARM: shmobile: r8a7790: add Ether DT support
+
+Define the generic R8A7790 part of the Ether device node.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d8913c6799ed776d096a7f41d83afce815f93819)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790.dtsi | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
+index a1e7c396afea..618e5b537eaf 100644
+--- a/arch/arm/boot/dts/r8a7790.dtsi
++++ b/arch/arm/boot/dts/r8a7790.dtsi
+@@ -1,7 +1,8 @@
+ /*
+ * Device Tree Source for the r8a7790 SoC
+ *
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
++ * Copyright (C) 2014 Cogent Embedded Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+@@ -379,6 +380,17 @@
+ status = "disabled";
+ };
+
++ ether: ethernet@ee700000 {
++ compatible = "renesas,ether-r8a7790";
++ reg = <0 0xee700000 0 0x400>;
++ interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7790_CLK_ETHER>;
++ phy-mode = "rmii";
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
+ sata0: sata@ee300000 {
+ compatible = "renesas,sata-r8a7790";
+ reg = <0 0xee300000 0 0x2000>;
+--
+2.1.2
+
diff --git a/patches.renesas/0340-ARM-shmobile-lager-add-Ether-DT-support.patch b/patches.renesas/0340-ARM-shmobile-lager-add-Ether-DT-support.patch
new file mode 100644
index 00000000000000..7ab5fcf3aaa88b
--- /dev/null
+++ b/patches.renesas/0340-ARM-shmobile-lager-add-Ether-DT-support.patch
@@ -0,0 +1,71 @@
+From 6d5ca6f50c85b552b25716b1afdf200cd6d28049 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Thu, 20 Feb 2014 02:22:31 +0300
+Subject: ARM: shmobile: lager: add Ether DT support
+
+Define the Lager board dependent part of the Ether device node.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit da4ea9514df42f69ec42a098142aaeac8c101da5)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index 26a90106e96c..6e99eb2df076 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -1,7 +1,8 @@
+ /*
+ * Device Tree Source for the Lager board
+ *
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
++ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+@@ -124,6 +125,16 @@
+ renesas,function = "scif0";
+ };
+
++ ether_pins: ether {
++ renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
++ renesas,function = "eth";
++ };
++
++ phy1_pins: phy1 {
++ renesas,groups = "intc_irq0";
++ renesas,function = "intc";
++ };
++
+ scif1_pins: serial1 {
+ renesas,groups = "scif1_data";
+ renesas,function = "scif1";
+@@ -150,6 +161,21 @@
+ };
+ };
+
++&ether {
++ pinctrl-0 = <&ether_pins &phy1_pins>;
++ pinctrl-names = "default";
++
++ phy-handle = <&phy1>;
++ renesas,ether-link-active-low;
++ status = "ok";
++
++ phy1: ethernet-phy@1 {
++ reg = <1>;
++ interrupt-parent = <&irqc0>;
++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
++ };
++};
++
+ &mmcif1 {
+ pinctrl-0 = <&mmc1_pins>;
+ pinctrl-names = "default";
+--
+2.1.2
+
diff --git a/patches.renesas/0341-ARM-shmobile-r8a7791-add-Ether-DT-support.patch b/patches.renesas/0341-ARM-shmobile-r8a7791-add-Ether-DT-support.patch
new file mode 100644
index 00000000000000..860beeb82fcecc
--- /dev/null
+++ b/patches.renesas/0341-ARM-shmobile-r8a7791-add-Ether-DT-support.patch
@@ -0,0 +1,50 @@
+From 764fecfc8a510ae491aaf92b62e28113281739e4 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Thu, 20 Feb 2014 02:27:04 +0300
+Subject: ARM: shmobile: r8a7791: add Ether DT support
+
+Define the generic R8A7791 part of the Ether device node.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 2e5d55ce8910afe136e0f4aa6ada6932e949c1ff)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 1ab4f3d5a8c2..45c369d7f387 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -2,7 +2,8 @@
+ * Device Tree Source for the r8a7791 SoC
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
++ * Copyright (C) 2014 Cogent Embedded Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+@@ -407,6 +408,17 @@
+ status = "disabled";
+ };
+
++ ether: ethernet@ee700000 {
++ compatible = "renesas,ether-r8a7791";
++ reg = <0 0xee700000 0 0x400>;
++ interrupts = <0 162 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp8_clks R8A7791_CLK_ETHER>;
++ phy-mode = "rmii";
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
++
+ sata0: sata@ee300000 {
+ compatible = "renesas,sata-r8a7791";
+ reg = <0 0xee300000 0 0x2000>;
+--
+2.1.2
+
diff --git a/patches.renesas/0342-ARM-shmobile-koelsch-add-Ether-DT-support.patch b/patches.renesas/0342-ARM-shmobile-koelsch-add-Ether-DT-support.patch
new file mode 100644
index 00000000000000..788930a84dc5e5
--- /dev/null
+++ b/patches.renesas/0342-ARM-shmobile-koelsch-add-Ether-DT-support.patch
@@ -0,0 +1,70 @@
+From b52de14cd56f6ff1f78cc42bef4fae4636bac043 Mon Sep 17 00:00:00 2001
+From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Date: Thu, 20 Feb 2014 02:28:59 +0300
+Subject: ARM: shmobile: koelsch: add Ether DT support
+
+Define the Koelsch board dependent part of the Ether device node.
+
+Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 08e8f0f35522bad37556a80c6df0578374f5091c)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 28 +++++++++++++++++++++++++++-
+ 1 file changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index bf6ba0c7faa0..603af8caae5b 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -2,7 +2,8 @@
+ * Device Tree Source for the Koelsch board
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+- * Copyright (C) 2013 Renesas Solutions Corp.
++ * Copyright (C) 2013-2014 Renesas Solutions Corp.
++ * Copyright (C) 2014 Cogent Embedded, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+@@ -146,12 +147,37 @@
+ renesas,function = "scif1";
+ };
+
++ ether_pins: ether {
++ renesas,groups = "eth_link", "eth_mdio", "eth_rmii";
++ renesas,function = "eth";
++ };
++
++ phy1_pins: phy1 {
++ renesas,groups = "intc_irq0";
++ renesas,function = "intc";
++ };
++
+ qspi_pins: spi {
+ renesas,groups = "qspi_ctrl", "qspi_data4";
+ renesas,function = "qspi";
+ };
+ };
+
++&ether {
++ pinctrl-0 = <&ether_pins &phy1_pins>;
++ pinctrl-names = "default";
++
++ phy-handle = <&phy1>;
++ renesas,ether-link-active-low;
++ status = "ok";
++
++ phy1: ethernet-phy@1 {
++ reg = <1>;
++ interrupt-parent = <&irqc0>;
++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
++ };
++};
++
+ &sata0 {
+ status = "okay";
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0343-ARM-shmobile-r8a7791-fix-clock-index-for-i2c5.patch b/patches.renesas/0343-ARM-shmobile-r8a7791-fix-clock-index-for-i2c5.patch
new file mode 100644
index 00000000000000..ce92a1a26bb98b
--- /dev/null
+++ b/patches.renesas/0343-ARM-shmobile-r8a7791-fix-clock-index-for-i2c5.patch
@@ -0,0 +1,30 @@
+From 8bedc6934924ece66150bdc15db659ca7fc0a6ea Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Wed, 19 Feb 2014 22:06:55 +0100
+Subject: ARM: shmobile: r8a7791: fix clock index for i2c5
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 1f662dde5c287c33da84d4aaaec8a75f2aab8ee7)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 45c369d7f387..08527340c527 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -743,7 +743,7 @@
+ #clock-cells = <1>;
+ renesas,clock-indices = <
+ R8A7791_CLK_RCAN1 R8A7791_CLK_RCAN0 R8A7791_CLK_QSPI_MOD
+- R8A7791_CLK_I2C4 R8A7791_CLK_I2C4 R8A7791_CLK_I2C3
++ R8A7791_CLK_I2C5 R8A7791_CLK_I2C4 R8A7791_CLK_I2C3
+ R8A7791_CLK_I2C2 R8A7791_CLK_I2C1 R8A7791_CLK_I2C0
+ >;
+ clock-output-names =
+--
+2.1.2
+
diff --git a/patches.renesas/0344-ARM-shmobile-r8a7791-dtsi-Fix-typo-in-msiof2-clock-o.patch b/patches.renesas/0344-ARM-shmobile-r8a7791-dtsi-Fix-typo-in-msiof2-clock-o.patch
new file mode 100644
index 00000000000000..272632621d2cd5
--- /dev/null
+++ b/patches.renesas/0344-ARM-shmobile-r8a7791-dtsi-Fix-typo-in-msiof2-clock-o.patch
@@ -0,0 +1,33 @@
+From 9e030678c4ca0151cf0c42bc0a826639193a913a Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Thu, 20 Feb 2014 15:49:29 +0100
+Subject: ARM: shmobile: r8a7791 dtsi: Fix typo in msiof2 clock output name
+
+Introduced in commit cded80f869aef94853e056ab9c21e305b0c26138 ("ARM:
+shmobile: r8a7791: Add MSIOF clocks in device tree").
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+(cherry picked from commit 0c002ef8caeff728d4015082cbe998cfdd57f1e0)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index 08527340c527..cde7bc486f22 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -679,7 +679,7 @@
+ R8A7791_CLK_MSIOF1 R8A7791_CLK_SCIFB2
+ >;
+ clock-output-names =
+- "scifa2", "scifa1", "scifa0", "misof2", "scifb0",
++ "scifa2", "scifa1", "scifa0", "msiof2", "scifb0",
+ "scifb1", "msiof1", "scifb2";
+ };
+ mstp3_clks: mstp3_clks@e615013c {
+--
+2.1.2
+
diff --git a/patches.renesas/0345-ARM-shmobile-Move-SYSC-base-variable-to-inside-ifdef.patch b/patches.renesas/0345-ARM-shmobile-Move-SYSC-base-variable-to-inside-ifdef.patch
new file mode 100644
index 00000000000000..b2eb2def9aeaf5
--- /dev/null
+++ b/patches.renesas/0345-ARM-shmobile-Move-SYSC-base-variable-to-inside-ifdef.patch
@@ -0,0 +1,40 @@
+From d15c15edfc4c2388e394708594359f14323d24c2 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 24 Feb 2014 14:52:12 +0900
+Subject: ARM: shmobile: Move SYSC base variable to inside ifdefs
+
+Move the rcar_sysc_base variable to inside #ifdefs to avoid
+triggering build warnings in case PM or SMP is not selected.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit c4ca5d80e03559fd95c526ece5ce39fc732a2511)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/pm-rcar.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c
+index 17225db09558..1f465a12d1b1 100644
+--- a/arch/arm/mach-shmobile/pm-rcar.c
++++ b/arch/arm/mach-shmobile/pm-rcar.c
+@@ -15,8 +15,6 @@
+ #include <asm/io.h>
+ #include <mach/pm-rcar.h>
+
+-static void __iomem *rcar_sysc_base;
+-
+ /* SYSC */
+ #define SYSCSR 0x00
+ #define SYSCISR 0x04
+@@ -35,6 +33,7 @@ static void __iomem *rcar_sysc_base;
+
+ #if defined(CONFIG_PM) || defined(CONFIG_SMP)
+
++static void __iomem *rcar_sysc_base;
+ static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */
+
+ static int rcar_sysc_pwr_on_off(struct rcar_sysc_ch *sysc_ch,
+--
+2.1.2
+
diff --git a/patches.renesas/0346-ARM-shmobile-Add-SDHI-devices-to-r8a7791-DTSI.patch b/patches.renesas/0346-ARM-shmobile-Add-SDHI-devices-to-r8a7791-DTSI.patch
new file mode 100644
index 00000000000000..fa61983067ec8d
--- /dev/null
+++ b/patches.renesas/0346-ARM-shmobile-Add-SDHI-devices-to-r8a7791-DTSI.patch
@@ -0,0 +1,56 @@
+From c8c42cbf2f0f434550ab00b54267175a7377afa4 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 12 Feb 2014 18:53:55 +0900
+Subject: ARM: shmobile: Add SDHI devices to r8a7791 DTSI
+
+Add SDHI0, SDHI1 and SDHI2 to the r8a7791 DTSI.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit b7ed8a0dd4f1d41464c3ab050c3688c4a7fc15b3)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791.dtsi | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
+index cde7bc486f22..46181708e59c 100644
+--- a/arch/arm/boot/dts/r8a7791.dtsi
++++ b/arch/arm/boot/dts/r8a7791.dtsi
+@@ -246,6 +246,33 @@
+ #gpio-range-cells = <3>;
+ };
+
++ sdhi0: sd@ee100000 {
++ compatible = "renesas,sdhi-r8a7791";
++ reg = <0 0xee100000 0 0x200>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
++ status = "disabled";
++ };
++
++ sdhi1: sd@ee140000 {
++ compatible = "renesas,sdhi-r8a7791";
++ reg = <0 0xee140000 0 0x100>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
++ status = "disabled";
++ };
++
++ sdhi2: sd@ee160000 {
++ compatible = "renesas,sdhi-r8a7791";
++ reg = <0 0xee160000 0 0x100>;
++ interrupt-parent = <&gic>;
++ interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>;
++ clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
++ status = "disabled";
++ };
++
+ scifa0: serial@e6c40000 {
+ compatible = "renesas,scifa-r8a7791", "renesas,scifa";
+ reg = <0 0xe6c40000 0 64>;
+--
+2.1.2
+
diff --git a/patches.renesas/0347-ARM-shmobile-Add-SDHI-devices-for-Koelsch-DTS.patch b/patches.renesas/0347-ARM-shmobile-Add-SDHI-devices-for-Koelsch-DTS.patch
new file mode 100644
index 00000000000000..86c34a412e178f
--- /dev/null
+++ b/patches.renesas/0347-ARM-shmobile-Add-SDHI-devices-for-Koelsch-DTS.patch
@@ -0,0 +1,167 @@
+From a20acb03d1dbae2be6ba225493cca43f005995f9 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Wed, 12 Feb 2014 18:54:04 +0900
+Subject: ARM: shmobile: Add SDHI devices for Koelsch DTS
+
+Add DT support for SDHI0, SDHI1 and SDHI2 on Koelsch.
+
+The board specific handling of CD and WP pins are
+using GPIOs. SDHI0 and SDHI1 are hooked up to regular
+SD connectors while SDHI2 is using micro-SD which
+is lacking WP signal.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 2c60a7df72711fb8b4be1e6aa651ab166a8931bc)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 119 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 119 insertions(+)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index 603af8caae5b..bdd73e6657b2 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -103,6 +103,78 @@
+ gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
+ };
+ };
++
++ vcc_sdhi0: regulator@0 {
++ compatible = "regulator-fixed";
++
++ regulator-name = "SDHI0 Vcc";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpio = <&gpio7 17 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
++ vccq_sdhi0: regulator@1 {
++ compatible = "regulator-gpio";
++
++ regulator-name = "SDHI0 VccQ";
++ regulator-min-microvolt = <1800000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
++ gpios-states = <1>;
++ states = <3300000 1
++ 1800000 0>;
++ };
++
++ vcc_sdhi1: regulator@2 {
++ compatible = "regulator-fixed";
++
++ regulator-name = "SDHI1 Vcc";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpio = <&gpio7 18 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
++ vccq_sdhi1: regulator@3 {
++ compatible = "regulator-gpio";
++
++ regulator-name = "SDHI1 VccQ";
++ regulator-min-microvolt = <1800000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
++ gpios-states = <1>;
++ states = <3300000 1
++ 1800000 0>;
++ };
++
++ vcc_sdhi2: regulator@4 {
++ compatible = "regulator-fixed";
++
++ regulator-name = "SDHI2 Vcc";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpio = <&gpio7 19 GPIO_ACTIVE_HIGH>;
++ enable-active-high;
++ };
++
++ vccq_sdhi2: regulator@5 {
++ compatible = "regulator-gpio";
++
++ regulator-name = "SDHI2 VccQ";
++ regulator-min-microvolt = <1800000>;
++ regulator-max-microvolt = <3300000>;
++
++ gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
++ gpios-states = <1>;
++ states = <3300000 1
++ 1800000 0>;
++ };
+ };
+
+ &extal_clk {
+@@ -157,6 +229,21 @@
+ renesas,function = "intc";
+ };
+
++ sdhi0_pins: sd0 {
++ renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
++ renesas,function = "sdhi0";
++ };
++
++ sdhi1_pins: sd1 {
++ renesas,gpios = "sdhi1_data4", "sdhi1_ctrl";
++ renesas,function = "sdhi1";
++ };
++
++ sdhi2_pins: sd2 {
++ renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
++ renesas,function = "sdhi2";
++ };
++
+ qspi_pins: spi {
+ renesas,groups = "qspi_ctrl", "qspi_data4";
+ renesas,function = "qspi";
+@@ -182,6 +269,38 @@
+ status = "okay";
+ };
+
++&sdhi0 {
++ pinctrl-0 = <&sdhi0_pins>;
++ pinctrl-names = "default";
++
++ vmmc-supply = <&vcc_sdhi0>;
++ vqmmc-supply = <&vccq_sdhi0>;
++ cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
++ wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
++ status = "okay";
++};
++
++&sdhi1 {
++ pinctrl-0 = <&sdhi1_pins>;
++ pinctrl-names = "default";
++
++ vmmc-supply = <&vcc_sdhi1>;
++ vqmmc-supply = <&vccq_sdhi1>;
++ cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
++ wp-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
++ status = "okay";
++};
++
++&sdhi2 {
++ pinctrl-0 = <&sdhi2_pins>;
++ pinctrl-names = "default";
++
++ vmmc-supply = <&vcc_sdhi2>;
++ vqmmc-supply = <&vccq_sdhi2>;
++ cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
++ status = "okay";
++};
++
+ &spi {
+ pinctrl-0 = <&qspi_pins>;
+ pinctrl-names = "default";
+--
+2.1.2
+
diff --git a/patches.renesas/0348-ARM-shmobile-APMU-Fix-warnings-due-to-improper-print.patch b/patches.renesas/0348-ARM-shmobile-APMU-Fix-warnings-due-to-improper-print.patch
new file mode 100644
index 00000000000000..45a34cab13b79f
--- /dev/null
+++ b/patches.renesas/0348-ARM-shmobile-APMU-Fix-warnings-due-to-improper-print.patch
@@ -0,0 +1,34 @@
+From bbb1537a1989f9b47449fa0c2757198bb7af2dd1 Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Date: Tue, 4 Mar 2014 19:11:15 +0100
+Subject: ARM: shmobile: APMU: Fix warnings due to improper printk formats
+
+Use the %pr printk specifier to print resource variables. This fixes
+warnings on platforms where resource_size_t has a different size than
+int.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 56ff873122c4baab43df241c7701d043b8ec8a8e)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/platsmp-apmu.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
+index 1da5a72d9642..8cb641c00fdb 100644
+--- a/arch/arm/mach-shmobile/platsmp-apmu.c
++++ b/arch/arm/mach-shmobile/platsmp-apmu.c
+@@ -75,8 +75,7 @@ static void apmu_init_cpu(struct resource *res, int cpu, int bit)
+ apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res));
+ apmu_cpus[cpu].bit = bit;
+
+- pr_debug("apmu ioremap %d %d 0x%08x 0x%08x\n", cpu, bit,
+- res->start, resource_size(res));
++ pr_debug("apmu ioremap %d %d %pr\n", cpu, bit, res);
+ }
+
+ static struct {
+--
+2.1.2
+
diff --git a/patches.renesas/0349-ARM-shmobile-r7s72100-fix-bus-clock-calculation.patch b/patches.renesas/0349-ARM-shmobile-r7s72100-fix-bus-clock-calculation.patch
new file mode 100644
index 00000000000000..25804d04801f11
--- /dev/null
+++ b/patches.renesas/0349-ARM-shmobile-r7s72100-fix-bus-clock-calculation.patch
@@ -0,0 +1,32 @@
+From 6be7abb595447186a90679305f19a1cc0008cacd Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <wsa@sang-engineering.com>
+Date: Fri, 28 Feb 2014 10:32:55 +0100
+Subject: ARM: shmobile: r7s72100: fix bus clock calculation
+
+The picture in the datasheet is a little misleading, yet the divider of
+the bus_clk is 1/3 and not 2/3.
+
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d93023f81d2c79595e64e4f516f03af4e4c73c13)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r7s72100.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
+index f17a5db00221..bee0073c9b64 100644
+--- a/arch/arm/mach-shmobile/clock-r7s72100.c
++++ b/arch/arm/mach-shmobile/clock-r7s72100.c
+@@ -70,7 +70,7 @@ static struct clk pll_clk = {
+
+ static unsigned long bus_recalc(struct clk *clk)
+ {
+- return clk->parent->rate * 2 / 3;
++ return clk->parent->rate / 3;
+ }
+
+ static struct sh_clk_ops bus_clk_ops = {
+--
+2.1.2
+
diff --git a/patches.renesas/0350-ARM-shmobile-Remove-CMT-TMU-and-STI-Kconfig-entries.patch b/patches.renesas/0350-ARM-shmobile-Remove-CMT-TMU-and-STI-Kconfig-entries.patch
new file mode 100644
index 00000000000000..0bf77eeb7db653
--- /dev/null
+++ b/patches.renesas/0350-ARM-shmobile-Remove-CMT-TMU-and-STI-Kconfig-entries.patch
@@ -0,0 +1,162 @@
+From fc208b7c7b43a0ba3a698ee5eb2bf6260ebbf498 Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Thu, 20 Feb 2014 12:54:46 +0100
+Subject: ARM: shmobile: Remove CMT, TMU and STI Kconfig entries
+
+Now when drivers/clocksource/Kconfig has been
+updated with entires for CMT, TMU, MTU2, and STI
+it is safe to remove these from mach-shmobile.
+
+Also select timers per SoC via SYS_SUPPORTS_xxx.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Acked-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
+Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+(cherry picked from commit aeb8fb7910fc7344d0ee0c9306eb45f11327c600)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+Conflicts:
+ arch/arm/mach-shmobile/Kconfig
+---
+ arch/arm/mach-shmobile/Kconfig | 36 ++++++++++++++++++------------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index 08ec4ffc17ee..e265630dfff1 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -20,17 +20,21 @@ comment "Renesas ARM SoCs System Type"
+
+ config ARCH_EMEV2
+ bool "Emma Mobile EV2"
++ select SYS_SUPPORTS_EM_STI
+
+ config ARCH_R7S72100
+ bool "RZ/A1H (R7S72100)"
++ select SYS_SUPPORTS_SH_MTU2
+
+ config ARCH_R8A7790
+ bool "R-Car H2 (R8A77900)"
+ select RENESAS_IRQC
++ select SYS_SUPPORTS_SH_CMT
+
+ config ARCH_R8A7791
+ bool "R-Car M2 (R8A77910)"
+ select RENESAS_IRQC
++ select SYS_SUPPORTS_SH_CMT
+
+ comment "Renesas ARM SoCs Board Type"
+
+@@ -61,6 +65,8 @@ config ARCH_SH7372
+ select ARM_CPU_SUSPEND if PM || CPU_IDLE
+ select CPU_V7
+ select SH_CLK_CPG
++ select SYS_SUPPORTS_SH_CMT
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_SH73A0
+ bool "SH-Mobile AG5 (R8A73A00)"
+@@ -70,6 +76,8 @@ config ARCH_SH73A0
+ select I2C
+ select SH_CLK_CPG
+ select RENESAS_INTC_IRQPIN
++ select SYS_SUPPORTS_SH_CMT
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_R8A73A4
+ bool "R-Mobile APE6 (R8A73A40)"
+@@ -80,6 +88,8 @@ config ARCH_R8A73A4
+ select RENESAS_IRQC
+ select ARCH_HAS_CPUFREQ
+ select ARCH_HAS_OPP
++ select SYS_SUPPORTS_SH_CMT
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_R8A7740
+ bool "R-Mobile A1 (R8A77400)"
+@@ -88,6 +98,8 @@ config ARCH_R8A7740
+ select CPU_V7
+ select SH_CLK_CPG
+ select RENESAS_INTC_IRQPIN
++ select SYS_SUPPORTS_SH_CMT
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_R8A7778
+ bool "R-Car M1A (R8A77781)"
+@@ -95,6 +107,7 @@ config ARCH_R8A7778
+ select CPU_V7
+ select SH_CLK_CPG
+ select ARM_GIC
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_R8A7779
+ bool "R-Car H1 (R8A77790)"
+@@ -103,6 +116,7 @@ config ARCH_R8A7779
+ select CPU_V7
+ select SH_CLK_CPG
+ select RENESAS_INTC_IRQPIN
++ select SYS_SUPPORTS_SH_TMU
+
+ config ARCH_R8A7790
+ bool "R-Car H2 (R8A77900)"
+@@ -113,6 +127,7 @@ config ARCH_R8A7790
+ select SH_CLK_CPG
+ select RENESAS_IRQC
+ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
++ select SYS_SUPPORTS_SH_CMT
+
+ config ARCH_R8A7791
+ bool "R-Car M2 (R8A77910)"
+@@ -123,6 +138,7 @@ config ARCH_R8A7791
+ select SH_CLK_CPG
+ select RENESAS_IRQC
+ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
++ select SYS_SUPPORTS_SH_CMT
+
+ config ARCH_EMEV2
+ bool "Emma Mobile EV2"
+@@ -132,6 +148,7 @@ config ARCH_EMEV2
+ select MIGHT_HAVE_PCI
+ select USE_OF
+ select AUTO_ZRELADDR
++ select SYS_SUPPORTS_EM_STI
+
+ config ARCH_R7S72100
+ bool "RZ/A1H (R7S72100)"
+@@ -139,6 +156,7 @@ config ARCH_R7S72100
+ select ARM_GIC
+ select CPU_V7
+ select SH_CLK_CPG
++ select SYS_SUPPORTS_SH_MTU2
+
+ comment "Renesas ARM SoCs Board Type"
+
+@@ -319,24 +337,6 @@ config SHMOBILE_TIMER_HZ
+ want to select a HZ value such as 128 that can evenly divide RCLK.
+ A HZ value that does not divide evenly may cause timer drift.
+
+-config SH_TIMER_CMT
+- bool "CMT timer driver"
+- default y
+- help
+- This enables build of the CMT timer driver.
+-
+-config SH_TIMER_TMU
+- bool "TMU timer driver"
+- default y
+- 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
+
+ endif
+--
+2.1.2
+
diff --git a/patches.renesas/0351-ARM-shmobile-r8a7791-Fix-SCIFA3-5-clocks.patch b/patches.renesas/0351-ARM-shmobile-r8a7791-Fix-SCIFA3-5-clocks.patch
new file mode 100644
index 00000000000000..92128cd912e08b
--- /dev/null
+++ b/patches.renesas/0351-ARM-shmobile-r8a7791-Fix-SCIFA3-5-clocks.patch
@@ -0,0 +1,72 @@
+From d8b3a174892d2e8bbc1dfe1da89c4b0dfbeb3422 Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Date: Wed, 12 Mar 2014 19:40:39 +0100
+Subject: ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks
+
+The MSTP clocks for SCIFA3-5 are MSTP1106-1108, not MSTP1105-1107
+
+Also reinsert them at the correct position to preserve sort order.
+
+Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit a51a9d67ba061c1263d078c27e8a3020d61fe236)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7791.c | 15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
+index 605fc778e3e2..701383fe3267 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7791.c
++++ b/arch/arm/mach-shmobile/clock-r8a7791.c
+@@ -170,6 +170,7 @@ static struct clk div6_clks[DIV6_NR] = {
+
+ /* MSTP */
+ enum {
++ MSTP1108, MSTP1107, MSTP1106,
+ MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
+ MSTP917,
+ MSTP815, MSTP814,
+@@ -180,12 +181,15 @@ enum {
+ MSTP522,
+ MSTP314, MSTP312, MSTP311,
+ MSTP216, MSTP207, MSTP206,
+- MSTP204, MSTP203, MSTP202, MSTP1105, MSTP1106, MSTP1107,
++ MSTP204, MSTP203, MSTP202,
+ MSTP124,
+ MSTP_NR
+ };
+
+ static struct clk mstp_clks[MSTP_NR] = {
++ [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */
++ [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */
++ [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */
+ [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
+ [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
+ [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
+@@ -218,9 +222,6 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
+ [MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
+ [MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
+- [MSTP1105] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 5, MSTPSR11, 0), /* SCIFA3 */
+- [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA4 */
+- [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA5 */
+ [MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
+ };
+
+@@ -259,9 +260,9 @@ static struct clk_lookup lookups[] = {
+ CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */
+ CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */
+ CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */
+- CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */
+- CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */
+- CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */
++ CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1106]), /* SCIFA3 */
++ CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1107]), /* SCIFA4 */
++ CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1108]), /* SCIFA5 */
+ CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]),
+ CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
+--
+2.1.2
+
diff --git a/patches.renesas/0352-ASoC-fsi-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch b/patches.renesas/0352-ASoC-fsi-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
new file mode 100644
index 00000000000000..ec3c1190f24c55
--- /dev/null
+++ b/patches.renesas/0352-ASoC-fsi-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
@@ -0,0 +1,154 @@
+From 7326ad36b9cd5c1bbe383fb59f398cee42d76d07 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Thu, 13 Mar 2014 17:56:25 -0700
+Subject: ASoC: fsi: fixup SND_SOC_DAIFMT_CBx_CFx flags
+
+SND_SOC_DAIFMT_CBx_CFx means "codec" side master/slave mode.
+Then, FSI will be master mode if it was SND_SOC_DAIFMT_CBS_CFS.
+
+This patch fixup platform settings too.
+Then, it tidyups SND_SOC_DAIFMT_INV settings.
+
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit c7a507eea1db1430476289f525f9c853d5d485e8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-armadillo800eva.c | 4 +---
+ arch/arm/mach-shmobile/board-kzm9g.c | 4 +---
+ arch/arm/mach-shmobile/board-mackerel.c | 6 ++----
+ arch/sh/boards/mach-ecovec24/setup.c | 4 +---
+ arch/sh/boards/mach-se/7724/setup.c | 4 +---
+ sound/soc/sh/fsi.c | 2 +-
+ 6 files changed, 7 insertions(+), 17 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
+index 4da3da7be3fa..2858f380beae 100644
+--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
++++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
+@@ -990,14 +990,12 @@ static struct asoc_simple_card_info fsi_wm8978_info = {
+ .card = "FSI2A-WM8978",
+ .codec = "wm8978.0-001a",
+ .platform = "sh_fsi2",
+- .daifmt = SND_SOC_DAIFMT_I2S,
++ .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "fsia-dai",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
+ },
+ .codec_dai = {
+ .name = "wm8978-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_NB_NF,
+ .sysclk = 12288000,
+ },
+ };
+diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
+index bc40b853ffd3..03dc3ac84502 100644
+--- a/arch/arm/mach-shmobile/board-kzm9g.c
++++ b/arch/arm/mach-shmobile/board-kzm9g.c
+@@ -589,14 +589,12 @@ static struct asoc_simple_card_info fsi2_ak4648_info = {
+ .card = "FSI2A-AK4648",
+ .codec = "ak4642-codec.0-0012",
+ .platform = "sh_fsi2",
+- .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "fsia-dai",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS,
+ },
+ .codec_dai = {
+ .name = "ak4642-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ .sysclk = 11289600,
+ },
+ };
+diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
+index 3aba0372f630..8c4332182b42 100644
+--- a/arch/arm/mach-shmobile/board-mackerel.c
++++ b/arch/arm/mach-shmobile/board-mackerel.c
+@@ -509,9 +509,9 @@ static struct asoc_simple_card_info fsi2_hdmi_info = {
+ .card = "FSI2B-HDMI",
+ .codec = "sh-mobile-hdmi",
+ .platform = "sh_fsi2",
++ .fmt = SND_SOC_DAIFMT_CBS_CFS,
+ .cpu_dai = {
+ .name = "fsib-dai",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_NF,
+ },
+ .codec_dai = {
+ .name = "sh_mobile_hdmi-hifi",
+@@ -905,14 +905,12 @@ static struct asoc_simple_card_info fsi2_ak4643_info = {
+ .card = "FSI2A-AK4643",
+ .codec = "ak4642-codec.0-0013",
+ .platform = "sh_fsi2",
+- .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "fsia-dai",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS,
+ },
+ .codec_dai = {
+ .name = "ak4642-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ .sysclk = 11289600,
+ },
+ };
+diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
+index 5bc3a15465c7..85d5255d259f 100644
+--- a/arch/sh/boards/mach-ecovec24/setup.c
++++ b/arch/sh/boards/mach-ecovec24/setup.c
+@@ -861,14 +861,12 @@ static struct asoc_simple_card_info fsi_da7210_info = {
+ .card = "FSIB-DA7210",
+ .codec = "da7210.0-001a",
+ .platform = "sh_fsi.0",
+- .daifmt = SND_SOC_DAIFMT_I2S,
++ .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "fsib-dai",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
+ },
+ .codec_dai = {
+ .name = "da7210-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ },
+ };
+
+diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
+index 21e4230659a5..1162bc6945a3 100644
+--- a/arch/sh/boards/mach-se/7724/setup.c
++++ b/arch/sh/boards/mach-se/7724/setup.c
+@@ -304,14 +304,12 @@ static struct asoc_simple_card_info fsi_ak4642_info = {
+ .card = "FSIA-AK4642",
+ .codec = "ak4642-codec.0-0012",
+ .platform = "sh_fsi.0",
+- .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "fsia-dai",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_IB_NF,
+ },
+ .codec_dai = {
+ .name = "ak4642-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ .sysclk = 11289600,
+ },
+ };
+diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
+index 1967f44e7cd4..710a079a7377 100644
+--- a/sound/soc/sh/fsi.c
++++ b/sound/soc/sh/fsi.c
+@@ -1711,9 +1711,9 @@ static int fsi_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+- fsi->clk_master = 1;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
++ fsi->clk_master = 1; /* codec is slave, cpu is master */
+ break;
+ default:
+ return -EINVAL;
+--
+2.1.2
+
diff --git a/patches.renesas/0353-ASoC-fsi-fixup-compile-error-for-simple-card.patch b/patches.renesas/0353-ASoC-fsi-fixup-compile-error-for-simple-card.patch
new file mode 100644
index 00000000000000..4fe943c691b8c7
--- /dev/null
+++ b/patches.renesas/0353-ASoC-fsi-fixup-compile-error-for-simple-card.patch
@@ -0,0 +1,38 @@
+From 0ade7f3d6bf1dabe5a74dfae591174656b1a95ec Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 16 Mar 2014 17:37:06 -0700
+Subject: ASoC: fsi: fixup compile error for simple-card
+
+This patches fixes
+c7a507eea1db1430476289f525f9c853d5d485e8
+(ASoC: fsi: fixup SND_SOC_DAIFMT_CBx_CFx flags)
+commit's compie error
+
+arch/arm/mach-shmobile/board-mackerel.c:512:2: \
+ error: unknown field 'fmt' specified in initializer
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Acked-by: Simon Horman <horms+renesas@verge.net.au>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 313c84b2736b26c77af7c7637e7dd72afde1b6cd)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-mackerel.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
+index 8c4332182b42..0ff4d8e45cf7 100644
+--- a/arch/arm/mach-shmobile/board-mackerel.c
++++ b/arch/arm/mach-shmobile/board-mackerel.c
+@@ -509,7 +509,7 @@ static struct asoc_simple_card_info fsi2_hdmi_info = {
+ .card = "FSI2B-HDMI",
+ .codec = "sh-mobile-hdmi",
+ .platform = "sh_fsi2",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS,
++ .daifmt = SND_SOC_DAIFMT_CBS_CFS,
+ .cpu_dai = {
+ .name = "fsib-dai",
+ },
+--
+2.1.2
+
diff --git a/patches.renesas/0354-ARM-bockw-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch b/patches.renesas/0354-ARM-bockw-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
new file mode 100644
index 00000000000000..194e4ea8991f72
--- /dev/null
+++ b/patches.renesas/0354-ARM-bockw-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
@@ -0,0 +1,87 @@
+From 3317b449658df68e23de7f75ca7dea6375f59028 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 23 Mar 2014 20:27:30 -0700
+Subject: ARM: bockw: fixup SND_SOC_DAIFMT_CBx_CFx flags
+
+SND_SOC_DAIFMT_CBx_CFx means "codec" side master/slave mode.
+Then, rcar will be master mode if it was SND_SOC_DAIFMT_CBS_CFS.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 6fa387b2ed268952d50940b0e24c573063a1dcfe)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-bockw.c | 16 +++++-----------
+ 1 file changed, 5 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
+index aaed215e96b9..b4122f8cb8d9 100644
+--- a/arch/arm/mach-shmobile/board-bockw.c
++++ b/arch/arm/mach-shmobile/board-bockw.c
+@@ -450,14 +450,12 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
+ .card = "SSI56-AK4643",
+ .codec = "ak4642-codec.0-0012",
+ .platform = "rcar_sound",
+- .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "rsnd-dai.0",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS,
+ },
+ .codec_dai = {
+ .name = "ak4642-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ .sysclk = 11289600,
+ },
+ },
+@@ -467,10 +465,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
+ .card = "SSI3-AK4554(playback)",
+ .codec = "ak4554-adc-dac.0",
+ .platform = "rcar_sound",
++ .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
+ .cpu_dai = {
+ .name = "rsnd-dai.1",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM |
+- SND_SOC_DAIFMT_RIGHT_J,
+ },
+ .codec_dai = {
+ .name = "ak4554-hifi",
+@@ -482,10 +479,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
+ .card = "SSI4-AK4554(capture)",
+ .codec = "ak4554-adc-dac.0",
+ .platform = "rcar_sound",
++ .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
+ .cpu_dai = {
+ .name = "rsnd-dai.2",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM |
+- SND_SOC_DAIFMT_LEFT_J,
+ },
+ .codec_dai = {
+ .name = "ak4554-hifi",
+@@ -497,10 +493,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
+ .card = "SSI7-AK4554(playback)",
+ .codec = "ak4554-adc-dac.1",
+ .platform = "rcar_sound",
++ .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_RIGHT_J,
+ .cpu_dai = {
+ .name = "rsnd-dai.3",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM |
+- SND_SOC_DAIFMT_RIGHT_J,
+ },
+ .codec_dai = {
+ .name = "ak4554-hifi",
+@@ -512,10 +507,9 @@ static struct asoc_simple_card_info rsnd_card_info[] = {
+ .card = "SSI8-AK4554(capture)",
+ .codec = "ak4554-adc-dac.1",
+ .platform = "rcar_sound",
++ .daifmt = SND_SOC_DAIFMT_CBS_CFS | SND_SOC_DAIFMT_LEFT_J,
+ .cpu_dai = {
+ .name = "rsnd-dai.4",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM |
+- SND_SOC_DAIFMT_LEFT_J,
+ },
+ .codec_dai = {
+ .name = "ak4554-hifi",
+--
+2.1.2
+
diff --git a/patches.renesas/0355-Kconfig-rename-HAS_IOPORT-to-HAS_IOPORT_MAP.patch b/patches.renesas/0355-Kconfig-rename-HAS_IOPORT-to-HAS_IOPORT_MAP.patch
new file mode 100644
index 00000000000000..4e68925db70e0c
--- /dev/null
+++ b/patches.renesas/0355-Kconfig-rename-HAS_IOPORT-to-HAS_IOPORT_MAP.patch
@@ -0,0 +1,763 @@
+From 1fd20ab61b7b84ceedaf82650ba6a6793619081b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Mon, 7 Apr 2014 15:39:19 -0700
+Subject: Kconfig: rename HAS_IOPORT to HAS_IOPORT_MAP
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If the renamed symbol is defined lib/iomap.c implements ioport_map and
+ioport_unmap and currently (nearly) all platforms define the port
+accessor functions outb/inb and friend unconditionally. So
+HAS_IOPORT_MAP is the better name for this.
+
+Consequently NO_IOPORT is renamed to NO_IOPORT_MAP.
+
+The motivation for this change is to reintroduce a symbol HAS_IOPORT
+that signals if outb/int et al are available. I will address that at
+least one merge window later though to keep surprises to a minimum and
+catch new introductions of (HAS|NO)_IOPORT.
+
+The changes in this commit were done using:
+
+ $ git grep -l -E '(NO|HAS)_IOPORT' | xargs perl -p -i -e 's/\b((?:CONFIG_)?(?:NO|HAS)_IOPORT)\b/$1_MAP/'
+
+Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+Acked-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+(cherry picked from commit ce816fa88cca083c47ab9000b2138a83043a78be)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arc/Kconfig | 2 +-
+ arch/arm/Kconfig | 12 ++++++------
+ arch/arm/mach-picoxcell/Kconfig | 2 +-
+ arch/arm/mach-prima2/Kconfig | 2 +-
+ arch/arm/mach-s3c24xx/Kconfig | 2 +-
+ arch/arm/mach-shmobile/Kconfig | 2 +-
+ arch/arm/mach-vexpress/Kconfig | 2 +-
+ arch/arm/plat-samsung/Kconfig | 4 ++--
+ arch/arm64/Kconfig | 2 +-
+ arch/cris/Kconfig | 2 +-
+ arch/hexagon/Kconfig | 2 +-
+ arch/m32r/Kconfig | 2 +-
+ arch/m68k/Kconfig | 2 +-
+ arch/metag/Kconfig | 2 +-
+ arch/mips/Kconfig | 4 ++--
+ arch/openrisc/Kconfig | 2 +-
+ arch/s390/Kconfig | 2 +-
+ arch/sh/Kconfig | 4 ++--
+ arch/sh/boards/Kconfig | 8 ++++----
+ arch/sh/include/asm/io.h | 4 ++--
+ arch/sh/include/asm/io_trapped.h | 2 +-
+ arch/sh/include/asm/machvec.h | 2 +-
+ arch/sh/kernel/Makefile | 2 +-
+ arch/sh/kernel/io_trapped.c | 4 ++--
+ arch/tile/Kconfig | 2 +-
+ arch/unicore32/Kconfig | 2 +-
+ arch/xtensa/Kconfig | 4 ++--
+ arch/xtensa/configs/iss_defconfig | 2 +-
+ arch/xtensa/configs/s6105_defconfig | 2 +-
+ drivers/char/tpm/Kconfig | 2 +-
+ drivers/i2c/busses/Kconfig | 2 +-
+ drivers/net/can/sja1000/Kconfig | 2 +-
+ drivers/net/ethernet/3com/Kconfig | 2 +-
+ include/asm-generic/io.h | 4 ++--
+ include/asm-generic/iomap.h | 2 +-
+ include/linux/io.h | 2 +-
+ lib/Kconfig | 4 ++--
+ lib/devres.c | 4 ++--
+ lib/iomap.c | 4 ++--
+ sound/isa/Kconfig | 2 +-
+ sound/pci/Kconfig | 2 +-
+ 41 files changed, 59 insertions(+), 59 deletions(-)
+
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
+index 9be30c8cb0c2..0434a89e05f8 100644
+--- a/arch/arc/Kconfig
++++ b/arch/arc/Kconfig
+@@ -57,7 +57,7 @@ config ARCH_FLATMEM_ENABLE
+ config MMU
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config GENERIC_CALIBRATE_DELAY
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index a5a497f43719..bb7270772b24 100644
+--- a/arch/arm/Kconfig
++++ b/arch/arm/Kconfig
+@@ -130,7 +130,7 @@ config HAVE_TCM
+ config HAVE_PROC_CPU
+ bool
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ bool
+
+ config EISA
+@@ -412,7 +412,7 @@ config ARCH_EBSA110
+ select ISA
+ select NEED_MACH_IO_H
+ select NEED_MACH_MEMORY_H
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ help
+ This is an evaluation board for the StrongARM processor available
+ from Digital. It has limited hardware on-board, including an
+@@ -432,7 +432,7 @@ config ARCH_EFM32
+ select CPU_V7M
+ select GENERIC_CLOCKEVENTS
+ select NO_DMA
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select SPARSE_IRQ
+ select USE_OF
+ help
+@@ -683,7 +683,7 @@ config ARCH_SHMOBILE_LEGACY
+ select HAVE_SMP
+ select MIGHT_HAVE_CACHE_L2X0
+ select MULTI_IRQ_HANDLER
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PINCTRL
+ select PM_GENERIC_DOMAINS if PM
+ select SPARSE_IRQ
+@@ -704,7 +704,7 @@ config ARCH_RPC
+ select ISA_DMA_API
+ select NEED_MACH_IO_H
+ select NEED_MACH_MEMORY_H
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select VIRT_TO_BUS
+ help
+ On the Acorn Risc-PC, Linux can support the internal IDE disk and
+@@ -763,7 +763,7 @@ config ARCH_S3C64XX
+ select HAVE_S3C2410_I2C if I2C
+ select HAVE_S3C2410_WATCHDOG if WATCHDOG
+ select HAVE_TCM
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PLAT_SAMSUNG
+ select PM_GENERIC_DOMAINS
+ select S3C_DEV_NAND
+diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig
+index c88ff74d86fe..fd81b5cfcd57 100644
+--- a/arch/arm/mach-picoxcell/Kconfig
++++ b/arch/arm/mach-picoxcell/Kconfig
+@@ -5,4 +5,4 @@ config ARCH_PICOXCELL
+ select CPU_V6K
+ select DW_APB_TIMER_OF
+ select HAVE_TCM
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
+index 2c726b4f9356..82482cd1fc03 100644
+--- a/arch/arm/mach-prima2/Kconfig
++++ b/arch/arm/mach-prima2/Kconfig
+@@ -2,7 +2,7 @@ config ARCH_SIRF
+ bool "CSR SiRF" if ARCH_MULTI_V7
+ select ARCH_REQUIRE_GPIOLIB
+ select GENERIC_IRQ_CHIP
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PINCTRL
+ select PINCTRL_SIRF
+ help
+diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
+index d876431d64c0..de2529d892d2 100644
+--- a/arch/arm/mach-s3c24xx/Kconfig
++++ b/arch/arm/mach-s3c24xx/Kconfig
+@@ -12,7 +12,7 @@ if ARCH_S3C24XX
+ config PLAT_S3C24XX
+ def_bool y
+ select ARCH_REQUIRE_GPIOLIB
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select S3C_DEV_NAND
+ select IRQ_DOMAIN
+ help
+diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
+index e265630dfff1..c655ec642d6c 100644
+--- a/arch/arm/mach-shmobile/Kconfig
++++ b/arch/arm/mach-shmobile/Kconfig
+@@ -10,7 +10,7 @@ config ARCH_SHMOBILE_MULTI
+ select ARM_GIC
+ select MIGHT_HAVE_PCI
+ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PINCTRL
+ select ARCH_REQUIRE_GPIOLIB
+
+diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig
+index 80b4be36f10a..657d52d0391f 100644
+--- a/arch/arm/mach-vexpress/Kconfig
++++ b/arch/arm/mach-vexpress/Kconfig
+@@ -10,7 +10,7 @@ config ARCH_VEXPRESS
+ select HAVE_ARM_TWD if SMP
+ select HAVE_PATA_PLATFORM
+ select ICST
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PLAT_VERSATILE
+ select PLAT_VERSATILE_CLCD
+ select POWER_RESET
+diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
+index 58645a58d0d8..ac0366858e94 100644
+--- a/arch/arm/plat-samsung/Kconfig
++++ b/arch/arm/plat-samsung/Kconfig
+@@ -9,7 +9,7 @@ config PLAT_SAMSUNG
+ depends on PLAT_S3C24XX || ARCH_S3C64XX || PLAT_S5P || ARCH_EXYNOS
+ default y
+ select GENERIC_IRQ_CHIP
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ help
+ Base platform code for all Samsung SoC based systems
+
+@@ -19,7 +19,7 @@ config PLAT_S5P
+ default y
+ select ARCH_REQUIRE_GPIOLIB
+ select ARM_VIC
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select PLAT_SAMSUNG
+ select S3C_GPIO_TRACK
+ select S5P_GPIO_DRVSTR
+diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
+index 65b788410bd9..2190e6cfd15a 100644
+--- a/arch/arm64/Kconfig
++++ b/arch/arm64/Kconfig
+@@ -62,7 +62,7 @@ config ARCH_PHYS_ADDR_T_64BIT
+ config MMU
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config STACKTRACE_SUPPORT
+diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
+index ed0fcdf7e990..4a60aa362990 100644
+--- a/arch/cris/Kconfig
++++ b/arch/cris/Kconfig
+@@ -29,7 +29,7 @@ config GENERIC_CALIBRATE_DELAY
+ bool
+ default y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config FORCE_MAX_ZONEORDER
+diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
+index 09df2608f40a..9bb54b95eb89 100644
+--- a/arch/hexagon/Kconfig
++++ b/arch/hexagon/Kconfig
+@@ -19,7 +19,7 @@ config HEXAGON
+ select GENERIC_IRQ_SHOW
+ select HAVE_ARCH_KGDB
+ select HAVE_ARCH_TRACEHOOK
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select GENERIC_IOMAP
+ select GENERIC_SMP_IDLE_THREAD
+ select STACKTRACE_SUPPORT
+diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
+index ca4504424dae..9e44bbd8051e 100644
+--- a/arch/m32r/Kconfig
++++ b/arch/m32r/Kconfig
+@@ -28,7 +28,7 @@ config ZONE_DMA
+ bool
+ default y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config NO_DMA
+diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
+index b2e322939256..87b7c7581b1d 100644
+--- a/arch/m68k/Kconfig
++++ b/arch/m68k/Kconfig
+@@ -52,7 +52,7 @@ config TIME_LOW_RES
+ bool
+ default y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config NO_DMA
+diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig
+index e56abd2c1b4f..4e53a6de1a4e 100644
+--- a/arch/metag/Kconfig
++++ b/arch/metag/Kconfig
+@@ -52,7 +52,7 @@ config GENERIC_HWEIGHT
+ config GENERIC_CALIBRATE_DELAY
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ source "init/Kconfig"
+diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
+index cb1da372346c..d50da167d23a 100644
+--- a/arch/mips/Kconfig
++++ b/arch/mips/Kconfig
+@@ -173,7 +173,7 @@ config MACH_DECSTATION
+ select CPU_R4000_WORKAROUNDS if 64BIT
+ select CPU_R4400_WORKAROUNDS if 64BIT
+ select DMA_NONCOHERENT
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select IRQ_CPU
+ select SYS_HAS_CPU_R3000
+ select SYS_HAS_CPU_R4X00
+@@ -942,7 +942,7 @@ config SYNC_R4K
+ config MIPS_MACHINE
+ def_bool n
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool n
+
+ config GENERIC_ISA_DMA
+diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
+index 9488209a5253..e71d712afb79 100644
+--- a/arch/openrisc/Kconfig
++++ b/arch/openrisc/Kconfig
+@@ -41,7 +41,7 @@ config RWSEM_XCHGADD_ALGORITHM
+ config GENERIC_HWEIGHT
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config TRACE_IRQFLAGS_SUPPORT
+diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
+index bb74b21f007a..2c16c6883903 100644
+--- a/arch/s390/Kconfig
++++ b/arch/s390/Kconfig
+@@ -52,7 +52,7 @@ config KEXEC
+ config AUDIT_ARCH
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool y
+
+ config PCI_QUIRKS
+diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
+index 64455daa63a1..b2cdb203e843 100644
+--- a/arch/sh/Kconfig
++++ b/arch/sh/Kconfig
+@@ -3,7 +3,7 @@ config SUPERH
+ select ARCH_MIGHT_HAVE_PC_PARPORT
+ select EXPERT
+ select CLKDEV_LOOKUP
+- select HAVE_IDE if HAS_IOPORT
++ select HAVE_IDE if HAS_IOPORT_MAP
+ select HAVE_MEMBLOCK
+ select HAVE_MEMBLOCK_NODE_MAP
+ select ARCH_DISCARD_MEMBLOCK
+@@ -147,7 +147,7 @@ config ARCH_HAS_ILOG2_U32
+ config ARCH_HAS_ILOG2_U64
+ def_bool n
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool !PCI
+ depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \
+ !SH_HP6XX && !SH_SOLUTION_ENGINE
+diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
+index eb1cf84231a2..e331e5373b8e 100644
+--- a/arch/sh/boards/Kconfig
++++ b/arch/sh/boards/Kconfig
+@@ -158,7 +158,7 @@ config SH_SDK7786
+ bool "SDK7786"
+ depends on CPU_SUBTYPE_SH7786
+ select SYS_SUPPORTS_PCI
+- select NO_IOPORT if !PCI
++ select NO_IOPORT_MAP if !PCI
+ select ARCH_WANT_OPTIONAL_GPIOLIB
+ select HAVE_SRAM_POOL
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
+@@ -204,7 +204,7 @@ config SH_URQUELL
+ depends on CPU_SUBTYPE_SH7786
+ select ARCH_REQUIRE_GPIOLIB
+ select SYS_SUPPORTS_PCI
+- select NO_IOPORT if !PCI
++ select NO_IOPORT_MAP if !PCI
+
+ config SH_MIGOR
+ bool "Migo-R"
+@@ -306,7 +306,7 @@ config SH_LBOX_RE2
+ config SH_X3PROTO
+ bool "SH-X3 Prototype board"
+ depends on CPU_SUBTYPE_SHX3
+- select NO_IOPORT if !PCI
++ select NO_IOPORT_MAP if !PCI
+ select IRQ_DOMAIN
+
+ config SH_MAGIC_PANEL_R2
+@@ -333,7 +333,7 @@ config SH_POLARIS
+
+ config SH_SH2007
+ bool "SH-2007 board"
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+ select REGULATOR_FIXED_VOLTAGE if REGULATOR
+ depends on CPU_SUBTYPE_SH7780
+ help
+diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
+index 629db2ad7916..728c4c571f40 100644
+--- a/arch/sh/include/asm/io.h
++++ b/arch/sh/include/asm/io.h
+@@ -122,7 +122,7 @@ __BUILD_MEMORY_STRING(__raw_, l, u32)
+
+ __BUILD_MEMORY_STRING(__raw_, q, u64)
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+
+ /*
+ * Slowdown I/O port space accesses for antique hardware.
+@@ -218,7 +218,7 @@ __BUILD_IOPORT_STRING(w, u16)
+ __BUILD_IOPORT_STRING(l, u32)
+ __BUILD_IOPORT_STRING(q, u64)
+
+-#else /* !CONFIG_HAS_IOPORT */
++#else /* !CONFIG_HAS_IOPORT_MAP */
+
+ #include <asm/io_noioport.h>
+
+diff --git a/arch/sh/include/asm/io_trapped.h b/arch/sh/include/asm/io_trapped.h
+index f1251d4f0ba9..4ab94ef51071 100644
+--- a/arch/sh/include/asm/io_trapped.h
++++ b/arch/sh/include/asm/io_trapped.h
+@@ -36,7 +36,7 @@ __ioremap_trapped(unsigned long offset, unsigned long size)
+ #define __ioremap_trapped(offset, size) NULL
+ #endif
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ extern struct list_head trapped_io;
+
+ static inline void __iomem *
+diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
+index eb9c20d971dd..d3324e4f372e 100644
+--- a/arch/sh/include/asm/machvec.h
++++ b/arch/sh/include/asm/machvec.h
+@@ -21,7 +21,7 @@ struct sh_machine_vector {
+ int (*mv_irq_demux)(int irq);
+ void (*mv_init_irq)(void);
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
+ void (*mv_ioport_unmap)(void __iomem *);
+ #endif
+diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
+index 261c8bfd75ce..2ccf36c824c6 100644
+--- a/arch/sh/kernel/Makefile
++++ b/arch/sh/kernel/Makefile
+@@ -22,7 +22,7 @@ obj-y := debugtraps.o dma-nommu.o dumpstack.o \
+
+ ifndef CONFIG_GENERIC_IOMAP
+ obj-y += iomap.o
+-obj-$(CONFIG_HAS_IOPORT) += ioport.o
++obj-$(CONFIG_HAS_IOPORT_MAP) += ioport.o
+ endif
+
+ obj-$(CONFIG_SUPERH32) += sys_sh32.o
+diff --git a/arch/sh/kernel/io_trapped.c b/arch/sh/kernel/io_trapped.c
+index c0a9761f2f8a..f8ce36286cea 100644
+--- a/arch/sh/kernel/io_trapped.c
++++ b/arch/sh/kernel/io_trapped.c
+@@ -22,7 +22,7 @@
+
+ #define TRAPPED_PAGES_MAX 16
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ LIST_HEAD(trapped_io);
+ EXPORT_SYMBOL_GPL(trapped_io);
+ #endif
+@@ -90,7 +90,7 @@ int register_trapped_io(struct trapped_io *tiop)
+ tiop->magic = IO_TRAPPED_MAGIC;
+ INIT_LIST_HEAD(&tiop->list);
+ spin_lock_irq(&trapped_lock);
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ if (flags & IORESOURCE_IO)
+ list_add(&tiop->list, &trapped_io);
+ #endif
+diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
+index b3692ce78f90..0b0290eeb629 100644
+--- a/arch/tile/Kconfig
++++ b/arch/tile/Kconfig
+@@ -405,7 +405,7 @@ config PCI_DOMAINS
+ config NO_IOMEM
+ def_bool !PCI
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool !PCI
+
+ config TILE_PCI_IO
+diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
+index 25c0dba508cc..aafad6fa1667 100644
+--- a/arch/unicore32/Kconfig
++++ b/arch/unicore32/Kconfig
+@@ -27,7 +27,7 @@ config UNICORE32
+ config GENERIC_CSUM
+ def_bool y
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ bool
+
+ config STACKTRACE_SUPPORT
+diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
+index c87ae7c6e5f9..02d6d29a63c1 100644
+--- a/arch/xtensa/Kconfig
++++ b/arch/xtensa/Kconfig
+@@ -41,7 +41,7 @@ config ARCH_HAS_ILOG2_U32
+ config ARCH_HAS_ILOG2_U64
+ def_bool n
+
+-config NO_IOPORT
++config NO_IOPORT_MAP
+ def_bool n
+
+ config HZ
+@@ -239,7 +239,7 @@ config XTENSA_PLATFORM_XT2000
+ config XTENSA_PLATFORM_S6105
+ bool "S6105"
+ select SERIAL_CONSOLE
+- select NO_IOPORT
++ select NO_IOPORT_MAP
+
+ config XTENSA_PLATFORM_XTFPGA
+ bool "XTFPGA"
+diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
+index 4f233204faf9..d57d917ff240 100644
+--- a/arch/xtensa/configs/iss_defconfig
++++ b/arch/xtensa/configs/iss_defconfig
+@@ -11,7 +11,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
+ CONFIG_GENERIC_HWEIGHT=y
+ # CONFIG_ARCH_HAS_ILOG2_U32 is not set
+ # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+-CONFIG_NO_IOPORT=y
++CONFIG_NO_IOPORT_MAP=y
+ CONFIG_HZ=100
+ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+ CONFIG_CONSTRUCTORS=y
+diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig
+index d929f77a0360..583c2b0974ca 100644
+--- a/arch/xtensa/configs/s6105_defconfig
++++ b/arch/xtensa/configs/s6105_defconfig
+@@ -11,7 +11,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y
+ CONFIG_GENERIC_HWEIGHT=y
+ # CONFIG_ARCH_HAS_ILOG2_U32 is not set
+ # CONFIG_ARCH_HAS_ILOG2_U64 is not set
+-CONFIG_NO_IOPORT=y
++CONFIG_NO_IOPORT_MAP=y
+ CONFIG_HZ=100
+ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
+index 1a65838888cd..c54cac3f8bc8 100644
+--- a/drivers/char/tpm/Kconfig
++++ b/drivers/char/tpm/Kconfig
+@@ -74,7 +74,7 @@ config TCG_NSC
+
+ config TCG_ATMEL
+ tristate "Atmel TPM Interface"
+- depends on PPC64 || HAS_IOPORT
++ depends on PPC64 || HAS_IOPORT_MAP
+ ---help---
+ If you have a TPM security chip from Atmel say Yes and it
+ will be accessible from within Linux. To compile this driver
+diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
+index c5eec0290b37..a612ec150da5 100644
+--- a/drivers/i2c/busses/Kconfig
++++ b/drivers/i2c/busses/Kconfig
+@@ -937,7 +937,7 @@ config I2C_ACORN
+
+ config I2C_ELEKTOR
+ tristate "Elektor ISA card"
+- depends on ISA && HAS_IOPORT && BROKEN_ON_SMP
++ depends on ISA && HAS_IOPORT_MAP && BROKEN_ON_SMP
+ select I2C_ALGOPCF
+ help
+ This supports the PCF8584 ISA bus I2C adapter. Say Y if you own
+diff --git a/drivers/net/can/sja1000/Kconfig b/drivers/net/can/sja1000/Kconfig
+index ff2ba86cd4a4..833ee8c9168e 100644
+--- a/drivers/net/can/sja1000/Kconfig
++++ b/drivers/net/can/sja1000/Kconfig
+@@ -46,7 +46,7 @@ config CAN_EMS_PCI
+ config CAN_PEAK_PCMCIA
+ tristate "PEAK PCAN-PC Card"
+ depends on PCMCIA
+- depends on HAS_IOPORT
++ depends on HAS_IOPORT_MAP
+ ---help---
+ This driver is for the PCAN-PC Card PCMCIA adapter (1 or 2 channels)
+ from PEAK-System (http://www.peak-system.com). To compile this
+diff --git a/drivers/net/ethernet/3com/Kconfig b/drivers/net/ethernet/3com/Kconfig
+index 65b735d4a6ad..afaab4b2333f 100644
+--- a/drivers/net/ethernet/3com/Kconfig
++++ b/drivers/net/ethernet/3com/Kconfig
+@@ -66,7 +66,7 @@ config PCMCIA_3C589
+
+ config VORTEX
+ tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support"
+- depends on (PCI || EISA) && HAS_IOPORT
++ depends on (PCI || EISA) && HAS_IOPORT_MAP
+ select MII
+ ---help---
+ This option enables driver support for a large number of 10Mbps and
+diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
+index d5afe96adba6..975e1cc75edb 100644
+--- a/include/asm-generic/io.h
++++ b/include/asm-generic/io.h
+@@ -327,7 +327,7 @@ static inline void iounmap(void __iomem *addr)
+ }
+ #endif /* CONFIG_MMU */
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ #ifndef CONFIG_GENERIC_IOMAP
+ static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
+ {
+@@ -341,7 +341,7 @@ static inline void ioport_unmap(void __iomem *p)
+ extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
+ extern void ioport_unmap(void __iomem *p);
+ #endif /* CONFIG_GENERIC_IOMAP */
+-#endif /* CONFIG_HAS_IOPORT */
++#endif /* CONFIG_HAS_IOPORT_MAP */
+
+ #ifndef xlate_dev_kmem_ptr
+ #define xlate_dev_kmem_ptr(p) p
+diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
+index 6afd7d6a9899..1b41011643a5 100644
+--- a/include/asm-generic/iomap.h
++++ b/include/asm-generic/iomap.h
+@@ -56,7 +56,7 @@ extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long coun
+ extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
+ extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ /* Create a virtual mapping cookie for an IO port range */
+ extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
+ extern void ioport_unmap(void __iomem *);
+diff --git a/include/linux/io.h b/include/linux/io.h
+index f4f42faec686..3e35c183dca4 100644
+--- a/include/linux/io.h
++++ b/include/linux/io.h
+@@ -41,7 +41,7 @@ static inline int ioremap_page_range(unsigned long addr, unsigned long end,
+ /*
+ * Managed iomap interface
+ */
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ void __iomem * devm_ioport_map(struct device *dev, unsigned long port,
+ unsigned int nr);
+ void devm_ioport_unmap(struct device *dev, void __iomem *addr);
+diff --git a/lib/Kconfig b/lib/Kconfig
+index 991c98bc4a3f..5d4984c505f8 100644
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -342,9 +342,9 @@ config HAS_IOMEM
+ select GENERIC_IO
+ default y
+
+-config HAS_IOPORT
++config HAS_IOPORT_MAP
+ boolean
+- depends on HAS_IOMEM && !NO_IOPORT
++ depends on HAS_IOMEM && !NO_IOPORT_MAP
+ default y
+
+ config HAS_DMA
+diff --git a/lib/devres.c b/lib/devres.c
+index 823533138fa0..10231287fbcc 100644
+--- a/lib/devres.c
++++ b/lib/devres.c
+@@ -168,7 +168,7 @@ void __iomem *devm_request_and_ioremap(struct device *device,
+ }
+ EXPORT_SYMBOL(devm_request_and_ioremap);
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ /*
+ * Generic iomap devres
+ */
+@@ -227,7 +227,7 @@ void devm_ioport_unmap(struct device *dev, void __iomem *addr)
+ devm_ioport_map_match, (void *)addr));
+ }
+ EXPORT_SYMBOL(devm_ioport_unmap);
+-#endif /* CONFIG_HAS_IOPORT */
++#endif /* CONFIG_HAS_IOPORT_MAP */
+
+ #ifdef CONFIG_PCI
+ /*
+diff --git a/lib/iomap.c b/lib/iomap.c
+index 2c08f36862eb..fc3dcb4b238e 100644
+--- a/lib/iomap.c
++++ b/lib/iomap.c
+@@ -224,7 +224,7 @@ EXPORT_SYMBOL(iowrite8_rep);
+ EXPORT_SYMBOL(iowrite16_rep);
+ EXPORT_SYMBOL(iowrite32_rep);
+
+-#ifdef CONFIG_HAS_IOPORT
++#ifdef CONFIG_HAS_IOPORT_MAP
+ /* Create a virtual mapping cookie for an IO port range */
+ void __iomem *ioport_map(unsigned long port, unsigned int nr)
+ {
+@@ -239,7 +239,7 @@ void ioport_unmap(void __iomem *addr)
+ }
+ EXPORT_SYMBOL(ioport_map);
+ EXPORT_SYMBOL(ioport_unmap);
+-#endif /* CONFIG_HAS_IOPORT */
++#endif /* CONFIG_HAS_IOPORT_MAP */
+
+ #ifdef CONFIG_PCI
+ /* Hide the details if this is a MMIO or PIO address space and just do what
+diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
+index affa13480659..0216475fc759 100644
+--- a/sound/isa/Kconfig
++++ b/sound/isa/Kconfig
+@@ -191,7 +191,7 @@ config SND_ES18XX
+
+ config SND_SC6000
+ tristate "Gallant SC-6000/6600/7000 and Audio Excel DSP 16"
+- depends on HAS_IOPORT
++ depends on HAS_IOPORT_MAP
+ select SND_WSS_LIB
+ select SND_OPL3_LIB
+ select SND_MPU401_UART
+diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
+index 8756c8e32922..81135d7a50cf 100644
+--- a/sound/pci/Kconfig
++++ b/sound/pci/Kconfig
+@@ -689,7 +689,7 @@ config SND_LOLA
+
+ config SND_LX6464ES
+ tristate "Digigram LX6464ES"
+- depends on HAS_IOPORT
++ depends on HAS_IOPORT_MAP
+ select SND_PCM
+ help
+ Say Y here to include support for Digigram LX6464ES boards.
+--
+2.1.2
+
diff --git a/patches.renesas/0356-ARM-shmobile-lager-correct-renesas-gpios-to-renesas-.patch b/patches.renesas/0356-ARM-shmobile-lager-correct-renesas-gpios-to-renesas-.patch
new file mode 100644
index 00000000000000..c40b0d203e7f52
--- /dev/null
+++ b/patches.renesas/0356-ARM-shmobile-lager-correct-renesas-gpios-to-renesas-.patch
@@ -0,0 +1,43 @@
+From 358c261df6cdb0271c46500b5f3c7431df9c83a7 Mon Sep 17 00:00:00 2001
+From: Rob Taylor <rob.taylor@codethink.co.uk>
+Date: Mon, 7 Apr 2014 20:16:52 +0100
+Subject: ARM: shmobile: lager: correct renesas,gpios to renesas,groups in
+ sd[02] pfc
+
+Fix probable typo of renesas,groups in the lager dt. The kernel has no
+renesas,gpios but this should match renesas,groups.
+
+Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
+[ben.dooks@codethink.co.uk: fixup description]
+Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
+Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+
+(cherry picked from commit b08eed0c4d7d70eae2f4f1ff518cc33643722a07)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7790-lager.dts | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
+index 6e99eb2df076..d01048ab3e77 100644
+--- a/arch/arm/boot/dts/r8a7790-lager.dts
++++ b/arch/arm/boot/dts/r8a7790-lager.dts
+@@ -141,12 +141,12 @@
+ };
+
+ sdhi0_pins: sd0 {
+- renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
++ renesas,groups = "sdhi0_data4", "sdhi0_ctrl";
+ renesas,function = "sdhi0";
+ };
+
+ sdhi2_pins: sd2 {
+- renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
++ renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
+ renesas,function = "sdhi2";
+ };
+
+--
+2.1.2
+
diff --git a/patches.renesas/0357-ARM-shmobile-lager-fixup-SND_SOC_DAIFMT_CBx_CFx-flag.patch b/patches.renesas/0357-ARM-shmobile-lager-fixup-SND_SOC_DAIFMT_CBx_CFx-flag.patch
new file mode 100644
index 00000000000000..38e64ce846615b
--- /dev/null
+++ b/patches.renesas/0357-ARM-shmobile-lager-fixup-SND_SOC_DAIFMT_CBx_CFx-flag.patch
@@ -0,0 +1,42 @@
+From a412c9fae4b333ec19eb6ca77c5fe93d37ad9d38 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 13 Apr 2014 17:59:34 -0700
+Subject: ARM: shmobile: lager: fixup SND_SOC_DAIFMT_CBx_CFx flags
+
+e1508289404ab6ca28e0dc931612600f0441c417
+(ASoC: rcar: fixup SND_SOC_DAIFMT_CBx_CFx flags)
+corrected SND_SOC_DAIFMT_CBx_CFx definition.
+But then, Lager board was maintenanced other branch.
+This patch correct SND_SOC_DAIFMT_CBx_CFx flag for lager
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 9f85ff849c21b429c1e2137f2646f9cc667d8ded)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-lager.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
+index f0104bfe544e..18c7e0311aa6 100644
+--- a/arch/arm/mach-shmobile/board-lager.c
++++ b/arch/arm/mach-shmobile/board-lager.c
+@@ -588,14 +588,12 @@ static struct asoc_simple_card_info rsnd_card_info = {
+ .card = "SSI01-AK4643",
+ .codec = "ak4642-codec.2-0012",
+ .platform = "rcar_sound",
+- .daifmt = SND_SOC_DAIFMT_LEFT_J,
++ .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
+ .name = "rcar_sound",
+- .fmt = SND_SOC_DAIFMT_CBS_CFS,
+ },
+ .codec_dai = {
+ .name = "ak4642-hifi",
+- .fmt = SND_SOC_DAIFMT_CBM_CFM,
+ .sysclk = 11289600,
+ },
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0358-ARM-shmobile-armadillo800eva-fixup-SND_SOC_DAIFMT_CB.patch b/patches.renesas/0358-ARM-shmobile-armadillo800eva-fixup-SND_SOC_DAIFMT_CB.patch
new file mode 100644
index 00000000000000..ac46cbc1f7f612
--- /dev/null
+++ b/patches.renesas/0358-ARM-shmobile-armadillo800eva-fixup-SND_SOC_DAIFMT_CB.patch
@@ -0,0 +1,33 @@
+From 6c8428efc7c5c9dd442765893c341807a9272b09 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 13 Apr 2014 17:59:47 -0700
+Subject: ARM: shmobile: armadillo800eva: fixup SND_SOC_DAIFMT_CBx_CFx flags
+
+c7a507eea1db1430476289f525f9c853d5d485e8
+(ASoC: fsi: fixup SND_SOC_DAIFMT_CBx_CFx flags)
+exchanged sound flags, but armadillo800eva flags needs IB_NF.
+The recorded sound will be noise without this patch.
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 7b707277e734c553a8043e9b4d530eb47f4d60c8)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/board-armadillo800eva.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
+index 2858f380beae..486063db2a2f 100644
+--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
++++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
+@@ -992,6 +992,7 @@ static struct asoc_simple_card_info fsi_wm8978_info = {
+ .platform = "sh_fsi2",
+ .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM,
+ .cpu_dai = {
++ .fmt = SND_SOC_DAIFMT_IB_NF,
+ .name = "fsia-dai",
+ },
+ .codec_dai = {
+--
+2.1.2
+
diff --git a/patches.renesas/0359-ARM-shmobile-r8a7778-Use-clks-as-MSTP007-parent.patch b/patches.renesas/0359-ARM-shmobile-r8a7778-Use-clks-as-MSTP007-parent.patch
new file mode 100644
index 00000000000000..a4622c721e86ed
--- /dev/null
+++ b/patches.renesas/0359-ARM-shmobile-r8a7778-Use-clks-as-MSTP007-parent.patch
@@ -0,0 +1,33 @@
+From 41e11529465deb0ceaf0510be0e7e63df690392e Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Mon, 14 Apr 2014 10:41:36 +0900
+Subject: ARM: shmobile: r8a7778: Use clks as MSTP007 parent
+
+According to the documentation the parent clock of
+MSTP007 should be clks not clkp.
+
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 3dedc5f5b11c567dbe2f31adb5119d1dfb8f51c9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/mach-shmobile/clock-r8a7778.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
+index 2009a9bc6356..9989b1b06ffd 100644
+--- a/arch/arm/mach-shmobile/clock-r8a7778.c
++++ b/arch/arm/mach-shmobile/clock-r8a7778.c
+@@ -170,7 +170,7 @@ static struct clk mstp_clks[MSTP_NR] = {
+ [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */
+ [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */
+ [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */
+- [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */
++ [MSTP007] = SH_CLK_MSTP32(&s_clk, MSTPCR0, 7, 0), /* HSPI */
+ };
+
+ static struct clk_lookup lookups[] = {
+--
+2.1.2
+
diff --git a/patches.renesas/0360-ARM-shmobile-sh73a0-drop-address-cells-from-GIC-node.patch b/patches.renesas/0360-ARM-shmobile-sh73a0-drop-address-cells-from-GIC-node.patch
new file mode 100644
index 00000000000000..ae6df91912ac3e
--- /dev/null
+++ b/patches.renesas/0360-ARM-shmobile-sh73a0-drop-address-cells-from-GIC-node.patch
@@ -0,0 +1,36 @@
+From 5fca00d18c7e85f482e423bb006a131b1649f747 Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Mon, 14 Apr 2014 16:18:18 +0200
+Subject: ARM: shmobile: sh73a0: drop address cells from GIC node
+
+This is likely a copy-and-paste error from the
+ARM GIC documentation, that has already been fixed.
+
+address-cells should have been set to 0, as with the size
+cells. As having those properties set to 0 is the
+same thing as not specifying them, drop them completely.
+
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Acked-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit de66b584042b8f2cfe4c34ef4faa804dcd8d5843)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/sh73a0.dtsi | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi
+index b7bd3b9a6753..5ecf552e1c00 100644
+--- a/arch/arm/boot/dts/sh73a0.dtsi
++++ b/arch/arm/boot/dts/sh73a0.dtsi
+@@ -34,7 +34,6 @@
+ gic: interrupt-controller@f0001000 {
+ compatible = "arm,cortex-a9-gic";
+ #interrupt-cells = <3>;
+- #address-cells = <1>;
+ interrupt-controller;
+ reg = <0xf0001000 0x1000>,
+ <0xf0000100 0x100>;
+--
+2.1.2
+
diff --git a/patches.renesas/0361-ARM-shmobile-r8a7740-drop-address-cells-from-GIC-nod.patch b/patches.renesas/0361-ARM-shmobile-r8a7740-drop-address-cells-from-GIC-nod.patch
new file mode 100644
index 00000000000000..b36006389aeec5
--- /dev/null
+++ b/patches.renesas/0361-ARM-shmobile-r8a7740-drop-address-cells-from-GIC-nod.patch
@@ -0,0 +1,36 @@
+From 7b2a0e41bec2c76f15ed3d9266f669e4a1104df9 Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Mon, 14 Apr 2014 16:18:17 +0200
+Subject: ARM: shmobile: r8a7740: drop address cells from GIC node
+
+This is likely a copy-and-paste error from the
+ARM GIC documentation, that has already been fixed.
+
+address-cells should have been set to 0, as with the size
+cells. As having those properties set to 0 is the
+same thing as not specifying them, drop them completely.
+
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Acked-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit 64c04a79c377e23449c59060727fcd34cc798eb6)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7740.dtsi | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi
+index 8280884bfa59..2551e9438d35 100644
+--- a/arch/arm/boot/dts/r8a7740.dtsi
++++ b/arch/arm/boot/dts/r8a7740.dtsi
+@@ -28,7 +28,6 @@
+ gic: interrupt-controller@c2800000 {
+ compatible = "arm,cortex-a9-gic";
+ #interrupt-cells = <3>;
+- #address-cells = <1>;
+ interrupt-controller;
+ reg = <0xc2800000 0x1000>,
+ <0xc2000000 0x1000>;
+--
+2.1.2
+
diff --git a/patches.renesas/0362-ARM-shmobile-koelsch-correct-renesas-gpios-to-renesa.patch b/patches.renesas/0362-ARM-shmobile-koelsch-correct-renesas-gpios-to-renesa.patch
new file mode 100644
index 00000000000000..de3727efcc10e9
--- /dev/null
+++ b/patches.renesas/0362-ARM-shmobile-koelsch-correct-renesas-gpios-to-renesa.patch
@@ -0,0 +1,47 @@
+From e07fcdd38fbbc9de36d226c0b1f6048e4e780e7c Mon Sep 17 00:00:00 2001
+From: Magnus Damm <damm@opensource.se>
+Date: Mon, 14 Apr 2014 19:13:21 +0900
+Subject: ARM: shmobile: koelsch: correct renesas,gpios to renesas,groups in
+ sd[012] pfc
+
+Fix typo of renesas,groups in the koeslch dt. The kernel has no
+renesas,gpios but this should match renesas,groups.
+
+Noticed thanks to similar fix for Lager by Rob Taylor and Ben Dooks.
+
+Signed-off-by: Magnus Damm <damm@opensource.se>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit d5dda0381f826326071b027f288372f682c24d55)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ arch/arm/boot/dts/r8a7791-koelsch.dts | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
+index bdd73e6657b2..de1b6977c69a 100644
+--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
++++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
+@@ -230,17 +230,17 @@
+ };
+
+ sdhi0_pins: sd0 {
+- renesas,gpios = "sdhi0_data4", "sdhi0_ctrl";
++ renesas,groups = "sdhi0_data4", "sdhi0_ctrl";
+ renesas,function = "sdhi0";
+ };
+
+ sdhi1_pins: sd1 {
+- renesas,gpios = "sdhi1_data4", "sdhi1_ctrl";
++ renesas,groups = "sdhi1_data4", "sdhi1_ctrl";
+ renesas,function = "sdhi1";
+ };
+
+ sdhi2_pins: sd2 {
+- renesas,gpios = "sdhi2_data4", "sdhi2_ctrl";
++ renesas,groups = "sdhi2_data4", "sdhi2_ctrl";
+ renesas,function = "sdhi2";
+ };
+
+--
+2.1.2
+
diff --git a/patches.renesas/0363-xhci-platform-Change-compatible-string-from-xhci-pla.patch b/patches.renesas/0363-xhci-platform-Change-compatible-string-from-xhci-pla.patch
new file mode 100644
index 00000000000000..5733b1e2cf26a7
--- /dev/null
+++ b/patches.renesas/0363-xhci-platform-Change-compatible-string-from-xhci-pla.patch
@@ -0,0 +1,59 @@
+From dc5d74e09e8b6dbc4ce631565e4dc6d75da8d117 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Tue, 11 Feb 2014 17:54:46 +0100
+Subject: xhci-platform: Change compatible string from xhci-platform to
+ generic-xhci
+
+This brings the xhci-platform bindings in sync with what we've done for
+the ohci- and ehci-platform drivers. As discussed there using platform as a
+postfix is a bit weird as the platform bus is a Linux specific thing and
+the bindings are supposed to be OS agnostic.
+
+Note that the old xhci-platform compatible string is kept around for, well,
+compatibility reasons.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+(cherry picked from commit 0f94388b27c599015b74eedf1a32126a3f5fc0f9)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/usb/usb-xhci.txt | 4 ++--
+ drivers/usb/host/xhci-plat.c | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/usb/usb-xhci.txt b/Documentation/devicetree/bindings/usb/usb-xhci.txt
+index 5752df0e17a2..90f8f607d125 100644
+--- a/Documentation/devicetree/bindings/usb/usb-xhci.txt
++++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt
+@@ -1,14 +1,14 @@
+ USB xHCI controllers
+
+ Required properties:
+- - compatible: should be "xhci-platform".
++ - compatible: should be "generic-xhci" (deprecated: "xhci-platform").
+ - reg: should contain address and length of the standard XHCI
+ register set for the device.
+ - interrupts: one XHCI interrupt should be described here.
+
+ Example:
+ usb@f0931000 {
+- compatible = "xhci-platform";
++ compatible = "generic-xhci";
+ reg = <0xf0931000 0x8c8>;
+ interrupts = <0x0 0x4e 0x0>;
+ };
+diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
+index 8abda5c73ca1..8affef910782 100644
+--- a/drivers/usb/host/xhci-plat.c
++++ b/drivers/usb/host/xhci-plat.c
+@@ -226,6 +226,7 @@ static const struct dev_pm_ops xhci_plat_pm_ops = {
+
+ #ifdef CONFIG_OF
+ static const struct of_device_id usb_xhci_of_match[] = {
++ { .compatible = "generic-xhci" },
+ { .compatible = "xhci-platform" },
+ { },
+ };
+--
+2.1.2
+
diff --git a/patches.renesas/0364-ASoC-rcar-subnode-tidyup-for-renesas-rsnd.txt.patch b/patches.renesas/0364-ASoC-rcar-subnode-tidyup-for-renesas-rsnd.txt.patch
new file mode 100644
index 00000000000000..c11b4a2390621d
--- /dev/null
+++ b/patches.renesas/0364-ASoC-rcar-subnode-tidyup-for-renesas-rsnd.txt.patch
@@ -0,0 +1,50 @@
+From 1d2a3ffda89d2625e40416b2737d941934859057 Mon Sep 17 00:00:00 2001
+From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Date: Sun, 23 Mar 2014 20:29:15 -0700
+Subject: ASoC: rcar: subnode tidyup for renesas,rsnd.txt
+
+rcar_sound,ssi/src/dai subnode documentation
+become more cleaner
+
+Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+(cherry picked from commit 8bab0dd58037623b723b768ee2eb1f7dd1ad0416)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ Documentation/devicetree/bindings/sound/renesas,rsnd.txt | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+index 7c6d33f29796..a44e9179faf5 100644
+--- a/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
++++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.txt
+@@ -7,14 +7,23 @@ Required properties:
+ required register is
+ SRU/ADG/SSI if generation1
+ SRU/ADG/SSIU/SSI if generation2
+-- rcar_sound,ssi : SSI subnode
+-- rcar_sound,scu : SCU subnode
+-- rcar_sound,dai : DAI subnode
++- rcar_sound,ssi : Should contain SSI feature.
++ The number of SSI subnode should be same as HW.
++ see below for detail.
++- rcar_sound,src : Should contain SRC feature.
++ The number of SRC subnode should be same as HW.
++ see below for detail.
++- rcar_sound,dai : DAI contents.
++ The number of DAI subnode should be same as HW.
++ see below for detail.
+
+ SSI subnode properties:
+ - interrupts : Should contain SSI interrupt for PIO transfer
+ - shared-pin : if shared clock pin
+
++SRC subnode properties:
++no properties at this point
++
+ DAI subnode properties:
+ - playback : list of playback modules
+ - capture : list of capture modules
+--
+2.1.2
+
diff --git a/patches.renesas/0365-ARM-shmobile-r8a7790-Correct-SYS-DMAC-clock-defines.patch b/patches.renesas/0365-ARM-shmobile-r8a7790-Correct-SYS-DMAC-clock-defines.patch
new file mode 100644
index 00000000000000..a470bce7934119
--- /dev/null
+++ b/patches.renesas/0365-ARM-shmobile-r8a7790-Correct-SYS-DMAC-clock-defines.patch
@@ -0,0 +1,38 @@
+From 3211371595549e1911790fac9bcc10fd94ba860f Mon Sep 17 00:00:00 2001
+From: Simon Horman <horms+renesas@verge.net.au>
+Date: Thu, 6 Feb 2014 09:25:01 +0900
+Subject: ARM: shmobile: r8a7790: Correct SYS DMAC clock defines
+
+This brings the implementation into line with the documentation.
+
+This problem was introduced when SYS DMAC clock defines were added by
+ac991dce6498b5fc ("ARM: shmobile: r8a7790: Add clock index macros for DT
+sources") in v3.13-rc2. I do not believe this results in any problems as
+these defines do not appear to be used anywhere yet.
+
+Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+(cherry picked from commit b998da0541e64da5bd857c09347c0fa954c03432)
+Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
+---
+ include/dt-bindings/clock/r8a7790-clock.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/dt-bindings/clock/r8a7790-clock.h b/include/dt-bindings/clock/r8a7790-clock.h
+index 859e9be511d9..6548a5fbcf4a 100644
+--- a/include/dt-bindings/clock/r8a7790-clock.h
++++ b/include/dt-bindings/clock/r8a7790-clock.h
+@@ -46,8 +46,8 @@
+ #define R8A7790_CLK_MSIOF1 8
+ #define R8A7790_CLK_MSIOF3 15
+ #define R8A7790_CLK_SCIFB2 16
+-#define R8A7790_CLK_SYS_DMAC0 18
+-#define R8A7790_CLK_SYS_DMAC1 19
++#define R8A7790_CLK_SYS_DMAC1 18
++#define R8A7790_CLK_SYS_DMAC0 19
+
+ /* MSTP3 */
+ #define R8A7790_CLK_TPU0 4
+--
+2.1.2
+
diff --git a/series b/series
index f316f2893e2f38..bde228b26f4f27 100644
--- a/series
+++ b/series
@@ -30,5 +30,375 @@ patches.lttng/lttng-2.3.4.patch
#############################################################################
+# Renesas patches
+#
+patches.renesas/0001-media-v4l-vsp1-Update-copyright-notice.patch
+patches.renesas/0002-ARM-shmobile-wait-for-MSTP-clock-status-to-toggle-wh.patch
+patches.renesas/0003-clk-shmobile-div6-use-proper-description-in-kernel-d.patch
+patches.renesas/0004-clk-shmobile-add-CPG-driver-for-rz-platforms.patch
+patches.renesas/0005-clk-shmobile-rcar-gen2-fix-lb-sd0-sd1-sdh-clock-pare.patch
+patches.renesas/0006-clk-shmobile-fix-setting-paretn-clock-rate.patch
+patches.renesas/0007-clk-shmobile-clk-mstp-change-to-using-clock-indices.patch
+patches.renesas/0008-gpio-rcar-Add-helper-variable-dev-pdev-dev.patch
+patches.renesas/0009-mtd-m25p80-Add-dual-read-support.patch
+patches.renesas/0010-mtd-m25p80-Enable-Dual-SPI-read-transfers-for-s25fl2.patch
+patches.renesas/0011-mtd-delete-non-required-instances-of-include-linux-i.patch
+patches.renesas/0012-mtd-m25p80-Use-positive-logic-to-check-JEDEC-ID.patch
+patches.renesas/0013-mtd-m25p80-add-support-for-the-Spansion-s25fl008k-ch.patch
+patches.renesas/0014-mtd-m25p80-add-Macronix-mx66l1g55g-1Gbit-SPI-flash.patch
+patches.renesas/0015-pinctrl-Quiet-logging-about-missing-DT-nodes-when-no.patch
+patches.renesas/0016-drm-rcar-du-Handle-encoder-initialization-failures.patch
+patches.renesas/0017-ASoC-rsnd-tidyup-register-naming-of-BUSIF_MODE.patch
+patches.renesas/0018-ASoC-rsnd-cleanup-debug-information-method.patch
+patches.renesas/0019-ASoC-rsnd-remove-meaningless-rsnd_ssi_non.patch
+patches.renesas/0020-ASoC-rsnd-control-SCU-ops-in-probe-timing.patch
+patches.renesas/0021-ASoC-rsnd-add-rsnd_scu_init-and-separate-init-start.patch
+patches.renesas/0022-ASoC-rsnd-remove-meaningless-function-parameter.patch
+patches.renesas/0023-ASoC-rsnd-merge-rsnd_scu_start-stop-and-rsnd_scu_tra.patch
+patches.renesas/0024-ASoC-rsnd-rsnd_dai_is_clk_master-can-be-shared.patch
+patches.renesas/0025-ASoC-rsnd-remove-pin-sync-option.patch
+patches.renesas/0026-ASoC-rsnd-SSI_MODE0-1-settings-goes-to-scu.c.patch
+patches.renesas/0027-ASoC-rsnd-remove-ssiu-from-ssi.c.patch
+patches.renesas/0028-ASoC-rsnd-rename-rsnd_scu_convert_rate_ctrl.patch
+patches.renesas/0029-ASoC-rsnd-explain-SRC-bypass-mode-settings-in-commen.patch
+patches.renesas/0030-ASoC-rsnd-remove-duplicate-priv-from-rsnd_dma.patch
+patches.renesas/0031-ASoC-rsnd-non-0-is-error-on-probe.patch
+patches.renesas/0032-ASoC-rsnd-fixup-Gen2-module-naming.patch
+patches.renesas/0033-ASoC-rsnd-don-t-use-schedule_work-when-rsnd_dma_star.patch
+patches.renesas/0034-ASoC-rsnd-SCU-should-be-called-before-SSI.patch
+patches.renesas/0035-ASoC-rsnd-clarify-scu.c-area.patch
+patches.renesas/0036-ASoC-rsnd-Merge-macros-in-scu.c.patch
+patches.renesas/0037-ASoC-rsnd-rsnd_scu_hpbif_is_enable-become-macro.patch
+patches.renesas/0038-ASoC-rsnd-merge-SRC-clock-timing-setting.patch
+patches.renesas/0039-ASoC-rsnd-add-rsnd_ssi_is_play.patch
+patches.renesas/0040-ASoC-rsnd-extracts-Gen1-Gen2-common-parts.patch
+patches.renesas/0041-ASoC-rsnd-remove-SSI-dependent-DMAEngine-callback.patch
+patches.renesas/0042-ASoC-rsnd-rsnd_ssi_probe-goes-forwarder-than-rsnd_sc.patch
+patches.renesas/0043-ASoC-rsnd-add-Gen2-SRC-and-DMAEngine-support.patch
+patches.renesas/0044-ASoC-rsnd-use-device-dependency-clock.patch
+patches.renesas/0045-ASoC-rsnd-tidyup-original-for_each_rsnd_xxx-macro.patch
+patches.renesas/0046-ASoC-rsnd-set-DIV_EN-register-on-rsnd_adg_set_conver.patch
+patches.renesas/0047-ASoC-rsnd-print-error-if-there-is-SRC-settings-misma.patch
+patches.renesas/0048-ASoC-rsnd-move-priv-member-settings-to-upper-side.patch
+patches.renesas/0049-ASoC-rsnd-move-rsnd_mod_call-macro.patch
+patches.renesas/0050-ASoC-rsnd-remove-verbose-function-parameter.patch
+patches.renesas/0051-ASoC-rsnd-remove-verbose-debug-message-from-scu-ssi.patch
+patches.renesas/0052-ASoC-rsnd-unify-rdai-naming.patch
+patches.renesas/0053-ASoC-rsnd-tidyup-RSND_SSI_xxx-flags.patch
+patches.renesas/0054-ASoC-rsnd-run-rsnd_path_init-when-probe-timing.patch
+patches.renesas/0055-ASoC-rsnd-use-mod-array-instead-of-list-on-rdai.patch
+patches.renesas/0056-ASoC-rsnd-get-ssi-scu-from-rsnd_dai_stream.patch
+patches.renesas/0057-ASoC-rsnd-use-devm_clk_get-instead-of-clk_get.patch
+patches.renesas/0058-ASoC-rsnd-use-function-pointer-for-each-probe.patch
+patches.renesas/0059-ASoC-rsnd-remove-unused-SSI_CONTROL.patch
+patches.renesas/0060-ASoC-rsnd-modify-rsnd_adg_ssi_ws_timing_gen2-paramet.patch
+patches.renesas/0061-ASoC-rsnd-share-reg_field-and-reduce-memory.patch
+patches.renesas/0062-ASoC-rsnd-add-struct-rsnd_dai_platform_info.patch
+patches.renesas/0063-ASoC-rsnd-Get-correct-SCU-ID.patch
+patches.renesas/0064-ASoC-rsnd-add-rsnd_scu_enable_ssi_irq.patch
+patches.renesas/0065-ASoC-rsnd-call-rsnd_scu_ssi_mode_init-from-SSI.patch
+patches.renesas/0066-ASoC-rsnd-add-probe-remove-callback-on-rsnd_mod_ops.patch
+patches.renesas/0067-ASoC-rsnd-use-mod-probe-method-on-SCU.patch
+patches.renesas/0068-ASoC-rsnd-use-mod-probe-method-on-SSI.patch
+patches.renesas/0069-ASoC-rsnd-nothing-to-do-on-rsnd_dai_remove.patch
+patches.renesas/0070-ASoC-rsnd-remove-all-rsnd_xxx_remove.patch
+patches.renesas/0071-ASoC-rsnd-rename-scu-to-src.patch
+patches.renesas/0072-ASoC-rcar-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
+patches.renesas/0073-ASoC-rsnd-add-DeviceTree-support.patch
+patches.renesas/0074-ASoC-rcar-bugfix-it-cares-about-the-non-src-case.patch
+patches.renesas/0075-ASoC-rsnd-fix-clock-prepare-unprepare.patch
+patches.renesas/0076-ASoC-rsnd-call-rsnd_dai_pointer_update-from-outside-.patch
+patches.renesas/0077-thermal-rcar-thermal-fix-same-mask-applied-twice.patch
+patches.renesas/0078-thermal-rcar-thermal-update-thermal-zone-only-when-t.patch
+patches.renesas/0079-spi-rspi-Remove-unused-mesg-parameter-from-send-rece.patch
+patches.renesas/0080-spi-rspi-Use-core-message-handling.patch
+patches.renesas/0081-spi-rspi-Abstract-8-16-bit-Data-Register-access.patch
+patches.renesas/0082-spi-rspi-Add-rspi_data_-out-in-out_in-helpers.patch
+patches.renesas/0083-spi-rspi-Abstract-transfer_one-for-RSPI-and-QSPI.patch
+patches.renesas/0084-spi-rspi-Merge-rspi_send_pio-and-rspi_receive_pio.patch
+patches.renesas/0085-spi-rspi-Merge-qspi_send_pio-and-qspi_receive_pio.patch
+patches.renesas/0086-spi-rspi-Add-support-for-more-than-one-interrupt.patch
+patches.renesas/0087-spi-rspi-Add-support-for-RSPI-on-RZ-A1H.patch
+patches.renesas/0088-spi-rspi-Add-support-for-loopback-mode.patch
+patches.renesas/0089-spi-rspi-Convert-to-clk_prepare_enable-disable_unpre.patch
+patches.renesas/0090-spi-rspi-Use-NULL-as-the-clock-ID.patch
+patches.renesas/0091-spi-rspi-Add-DT-support.patch
+patches.renesas/0092-spi-rspi-Add-support-for-Quad-and-Dual-SPI-Transfers.patch
+patches.renesas/0093-spi-rspi-fix-build-error-when-CONFIG_OF-is-not-set.patch
+patches.renesas/0094-spi-rspi-Only-enable-interrupts-when-there-s-a-need-.patch
+patches.renesas/0095-spi-rspi-Remove-empty-rspi_cleanup.patch
+patches.renesas/0096-spi-rspi-Fix-loopback-mode-for-Dual-Quad-SPI-Transfe.patch
+patches.renesas/0097-spi-rspi-Add-runtime-PM-support-using-spi-core-auto_.patch
+patches.renesas/0098-sh-intc-Enable-driver-compilation-with-COMPILE_TEST.patch
+patches.renesas/0099-drivers-sh-compile-drivers-sh-pm_runtime.c-if-ARCH_S.patch
+patches.renesas/0100-sh_eth-use-ETH_ZLEN-instead-of-home-grown-define.patch
+patches.renesas/0101-sh_eth-add-device-tree-support.patch
+patches.renesas/0102-sh_eth-update-OF-PHY-registeration.patch
+patches.renesas/0103-sh_eth-exit-probe-with-unknown-register-layout.patch
+patches.renesas/0104-sh_eth-convert-pr_-to-netdev_-calls.patch
+patches.renesas/0105-sh_eth-convert-dev_-to-netdev_-calls.patch
+patches.renesas/0106-sh_eth-fold-netif_msg_-and-netdev_-calls-into-netif_.patch
+patches.renesas/0107-sh_eth-Use-the-platform-device-for-memory-allocation.patch
+patches.renesas/0108-sh_eth-Use-the-platform-device-as-the-MDIO-bus-paren.patch
+patches.renesas/0109-sh_eth-Simplify-MDIO-bus-initialization-and-release.patch
+patches.renesas/0110-sh_eth-Register-MDIO-bus-before-registering-the-netw.patch
+patches.renesas/0111-sh_eth-Remove-goto-statements-that-jump-straight-to-.patch
+patches.renesas/0112-sh_eth-ensure-pm_runtime-cannot-suspend-the-device-d.patch
+patches.renesas/0113-mmc-sh_mobile_sdhi-Use-modern-PM-macros-to-define-pm.patch
+patches.renesas/0114-mmc-tmio_mmc-Convert-from-legacy-to-modern-PM-ops.patch
+patches.renesas/0115-mmc-tmio-Adapt-to-proper-PM-configs-for-exported-fun.patch
+patches.renesas/0116-mmc-sdhi-tidyup-sh_mobile_sdhi_of_match-position.patch
+patches.renesas/0117-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7778.patch
+patches.renesas/0118-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7779.patch
+patches.renesas/0119-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7790.patch
+patches.renesas/0120-mmc-sdhi-update-sh_mobile_sdhi_of_data-for-r8a7791.patch
+patches.renesas/0121-pinctrl-sh-pfc-r8a7791-Add-QSPI-pin-groups.patch
+patches.renesas/0122-pinctrl-sh-pfc-r8a7790-Break-out-USB0-OVC-VBUS.patch
+patches.renesas/0123-pinctrl-sh-pfc-r8a7790-Add-QSPI-pin-groups.patch
+patches.renesas/0124-pinctrl-pfc-r8a7791-add-mux-data-for-IIC-B-cores.patch
+patches.renesas/0125-pinctrl-sh-pfc-r8a7790-Add-alternative-MSIOF-pin-gro.patch
+patches.renesas/0126-pinctrl-sh-pfc-r8a7791-Add-alternative-MSIOF-pin-gro.patch
+patches.renesas/0127-sh-pfc-r8a7790-Fix-definition-of-IPSR5.patch
+patches.renesas/0128-sh-pfc-r8a7791-Fix-definition-of-MOD_SEL3.patch
+patches.renesas/0129-serial-sh-sci-Fix-cast-warning.patch
+patches.renesas/0130-serial-sh-sci-Fix-compatible-string-in-DT-bindings-e.patch
+patches.renesas/0131-serial-sh-sci-Add-missing-call-to-uart_remove_one_po.patch
+patches.renesas/0132-serial-sh-sci-Replace-printk-by-pr_.patch
+patches.renesas/0133-serial-sh-sci-Remove-useless-casts.patch
+patches.renesas/0134-serial-sh-sci-Add-more-register-documentation.patch
+patches.renesas/0135-serial-sh-sci-Replace-hardcoded-3-by-UART_PM_STATE_O.patch
+patches.renesas/0136-serial-sh-sci-Neaten-dev_-level-uses.patch
+patches.renesas/0137-cpufreq-remove-unused-notifier-CPUFREQ_-SUSPENDCHANG.patch
+patches.renesas/0138-media-media-soc_camera-rcar_vin-Add-support-for-10-b.patch
+patches.renesas/0139-i2c-add-deprecation-warning-for-class-based-instanti.patch
+patches.renesas/0140-i2c-rcar-add-compatible-entry-for-r8a7791.patch
+patches.renesas/0141-i2c-i2c-rcar-deprecate-class-based-instantiation.patch
+patches.renesas/0142-regulator-da9210-Remove-redundant-error-message.patch
+patches.renesas/0143-spi-Provide-core-support-for-DMA-mapping-transfers.patch
+patches.renesas/0144-spi-Provide-core-support-for-full-duplex-devices.patch
+patches.renesas/0145-spi-core-Ignore-unsupported-spi-tr-x-bus-width-prope.patch
+patches.renesas/0146-spi-Make-core-DMA-mapping-functions-generate-scatter.patch
+patches.renesas/0147-regulator-core-Allow-regulator_set_voltage-for-fixed.patch
+patches.renesas/0148-DMA-shdma-Fix-warnings-due-to-improper-casts-and-pri.patch
+patches.renesas/0149-shdma-add-R-Car-Audio-DMAC-peri-peri-driver.patch
+patches.renesas/0150-of-add-functions-to-count-number-of-elements-in-a-pr.patch
+patches.renesas/0151-ASoC-add-snd_soc_of_parse_audio_simple_widgets-for-D.patch
+patches.renesas/0152-ASoC-core-add-TDM-slot-parsing-from-DT-supports.patch
+patches.renesas/0153-clocksource-Add-Kconfig-entries-for-CMT-MTU2-TMU-and.patch
+patches.renesas/0154-clocksource-CMT-MTU2-TMU-and-STI-should-depend-on-GE.patch
+patches.renesas/0155-regulator-gpio-regulator-Remove-unneeded-OOM-error-m.patch
+patches.renesas/0156-regulator-gpio-add-gpios-status-for-DT.patch
+patches.renesas/0157-regulator-gpio-Document-regulator-type-property.patch
+patches.renesas/0158-regulator-gpio-print-warning-if-gpios-gpios-states-m.patch
+patches.renesas/0159-regulator-gpio-explain-detail-of-gpios-states.patch
+patches.renesas/0160-regulator-gpio-regulator-do-not-open-code-counting-a.patch
+patches.renesas/0161-regulator-gpio-regulator-fix-forgotten-gpios-states-.patch
+patches.renesas/0162-ASoC-simple-card-simplify-code.patch
+patches.renesas/0163-ASoC-simple-card-simplify-code.patch
+patches.renesas/0164-ASoC-simple-card-simplify-code.patch
+patches.renesas/0165-ASoC-simple-card-simplify-code.patch
+patches.renesas/0166-ASoC-simple-card-simplify-code.patch
+patches.renesas/0167-ASoC-simple-card-simplify-code.patch
+patches.renesas/0168-ASoC-simple-card-simplify-code.patch
+patches.renesas/0169-ASoC-simple-card-simplify-code.patch
+patches.renesas/0170-ASoC-simple-card-fix-__asoc_simple_card_dai_init.patch
+patches.renesas/0171-ASoC-simple-card-simplify-the-daifmt-code.patch
+patches.renesas/0172-ASoC-simple-card-Add-snd_card-s-name-parsing-from-DT.patch
+patches.renesas/0173-ASoC-simple-card-add-off-codec-widgets-supports.patch
+patches.renesas/0174-ASoC-simple-card-for-new-properties-documenting-and-.patch
+patches.renesas/0175-ASoC-simple-card-add-slot-information-parsing-suppor.patch
+patches.renesas/0176-ASoC-simple-card-cpu_dai_name-creates-confusion-when.patch
+patches.renesas/0177-ASoC-simple-card-tidyup-cpu-codec-dai_fmt-settings-f.patch
+patches.renesas/0178-ASoC-simple-card-card-name-can-be-option.patch
+patches.renesas/0179-ASoC-simple-card-Fix-the-reference-count-of-device-n.patch
+patches.renesas/0180-ASoC-simple-card-Simplify-code.patch
+patches.renesas/0181-ASoC-simple-card-overwrite-cpu_dai-fmt-with-codec_da.patch
+patches.renesas/0182-ASoC-simple-card-dynamically-allocate-the-DAI-link-a.patch
+patches.renesas/0183-ASoC-simple-card-Add-DT-documentation-for-multi-DAI-.patch
+patches.renesas/0184-ASoC-simple-card-Handle-many-DAI-links.patch
+patches.renesas/0185-spi-delete-non-required-instances-of-include-linux-i.patch
+patches.renesas/0186-spi-sh-msiof-Fix-SPI-bus-population-from-DT.patch
+patches.renesas/0187-spi-sh-msiof-Typo-in-comment-s-tx-rx.patch
+patches.renesas/0188-spi-sh-msiof-Change-hz-from-unsigned-long-to-u32.patch
+patches.renesas/0189-spi-sh-msiof-Add-more-register-documentation.patch
+patches.renesas/0190-spi-sh-msiof-Use-the-core-cs_gpio-field-and-make-it-.patch
+patches.renesas/0191-spi-sh-msiof-Improve-bindings.patch
+patches.renesas/0192-spi-sh-msiof-Move-default-FIFO-sizes-to-device-ID-da.patch
+patches.renesas/0193-spi-sh-msiof-Add-support-for-R-Car-H2-and-M2.patch
+patches.renesas/0194-spi-sh-msiof-Move-clock-management-to-un-prepare_mes.patch
+patches.renesas/0195-spi-sh-msiof-Convert-to-let-spi-core-validate-xfer-b.patch
+patches.renesas/0196-spi-sh-msiof-Use-core-message-handling-instead-of-sp.patch
+patches.renesas/0197-spi-sh-msiof-Kill-sh_msiof_spi_bits-and-sh_msiof_spi.patch
+patches.renesas/0198-spi-sh-msiof-Remove-renesas-msiof-sh7724-from-bindin.patch
+patches.renesas/0199-spi-sh-msiof-Convert-to-spi-core-auto_runtime_pm-fra.patch
+patches.renesas/0200-ARM-shmobile-dts-Remove-r8a7791-koelsch-reference.dt.patch
+patches.renesas/0201-ARM-shmobile-Add-GPIO-keys-to-Koelsch-DTS.patch
+patches.renesas/0202-ARM-shmobile-koelsch-1-1-GiB-memory-in-DT.patch
+patches.renesas/0203-ARM-shmobile-r8a7791-Add-thermal-clock-in-device-tre.patch
+patches.renesas/0204-ARM-shmobile-r8a7790-Add-thermal-clock-in-device-tre.patch
+patches.renesas/0205-ARM-shmobile-r8a7791-Add-serial-ports-to-the-device-.patch
+patches.renesas/0206-ARM-shmobile-r8a7790-Add-serial-ports-to-the-device-.patch
+patches.renesas/0207-ARM-shmobile-r8a7790-Add-VIN-clocks-to-device-tree.patch
+patches.renesas/0208-ARM-shmobile-r8a7791-Add-VIN-clocks-to-device-tree.patch
+patches.renesas/0209-ARM-shmobile-r8a7790-Add-SATA-clocks-to-device-tree.patch
+patches.renesas/0210-ARM-shmobile-r8a7791-Add-SATA-clocks-to-device-tree.patch
+patches.renesas/0211-ARM-shmobile-r8a7791-Add-SATA-nodes-to-r8a7791.dtsi.patch
+patches.renesas/0212-ARM-shmobile-koelsch-Enable-SATA0-in-r8a7791-koelsch.patch
+patches.renesas/0213-ARM-shmobile-r8a7790-Add-SATA-nodes-to-r8a7790.dtsi.patch
+patches.renesas/0214-ARM-shmobile-lager-Enable-SATA1-in-r8a7790-lager.dts.patch
+patches.renesas/0215-ARM-shmobile-r8a7790-Fix-serial-ports-DT-compatible-.patch
+patches.renesas/0216-ARM-shmobile-r8a7790-Replace-IRQ-type-numerical-valu.patch
+patches.renesas/0217-ARM-shmobile-Lager-conditionally-select-CONFIG_MICRE.patch
+patches.renesas/0218-ARM-shmobile-bockw-use-SSI-DMAEngine-for-sound.patch
+patches.renesas/0219-ARM-shmobile-bockw-use-HPBIF-DMAEngine-for-sound.patch
+patches.renesas/0220-ARM-shmobile-bockw-add-USB-Func-DMAEngine-support.patch
+patches.renesas/0221-ARM-shmobile-koelsch-Conditionally-select-MICREL_PHY.patch
+patches.renesas/0222-ARM-mach-shmobile-kzm9g-add-zboot-support.patch
+patches.renesas/0223-ARM-shmobile-lager-Add-VIN1-SoC-camera-support.patch
+patches.renesas/0224-ARM-shmobile-kzm9d-Use-common-clock-framework.patch
+patches.renesas/0225-ARM-shmobile-lager-Make-spi_flash_data-const.patch
+patches.renesas/0226-ARM-shmobile-lager-Add-SATA-support.patch
+patches.renesas/0227-ARM-shmobile-koelsch-Add-SATA0-support.patch
+patches.renesas/0228-ARM-shmobile-ape6evm-Conditionally-select-SMSC_PHY.patch
+patches.renesas/0229-ARM-shmobile-armadillo800eva-Conditionally-select-SM.patch
+patches.renesas/0230-ARM-shmobile-bockw-Sort-Kconfig-node-s-selections.patch
+patches.renesas/0231-ARM-shmobile-r8a7779-Wait-for-status-on-selected-MST.patch
+patches.renesas/0232-ARM-shmobile-r8a7790-Wait-for-status-on-all-MSTP-clo.patch
+patches.renesas/0233-ARM-shmobile-r8a7791-Add-I2C-clocks.patch
+patches.renesas/0234-ARM-shmobile-r8a7791-Add-VIN-clocks.patch
+patches.renesas/0235-ARM-shmobile-Remove-duplicate-shmobile_invalidate_st.patch
+patches.renesas/0236-ARM-shmobile-r8a7779-Remove-unused-clock-constants.patch
+patches.renesas/0237-ARM-shmobile-emev2-Use-__initconst-for-const-init-de.patch
+patches.renesas/0238-ARM-shmobile-r8a7791-Wait-for-status-on-all-MSTP-clo.patch
+patches.renesas/0239-ARM-shmobile-r8a7790-add-Audio-DMAC-clock.patch
+patches.renesas/0240-ARM-shmobile-r8a7790-add-Audio-DMAC-support.patch
+patches.renesas/0241-ARM-shmobile-r8a7790-Add-VIN-clock-support.patch
+patches.renesas/0242-ARM-shmobile-r8a7790-Add-SATA-clocks.patch
+patches.renesas/0243-ARM-shmobile-r8a7791-Add-ZS-clock.patch
+patches.renesas/0244-ARM-shmobile-r8a7791-Add-SATA-clocks.patch
+patches.renesas/0245-ARM-shmobile-r7s72100-really-add-i2c-clocks.patch
+patches.renesas/0246-ARM-shmobile-r8a7790-Add-PCI-USB-host-clock-support.patch
+patches.renesas/0247-ARM-shmobile-lager-Enable-VIN-along-with-ADV7180-dec.patch
+patches.renesas/0248-ARM-shmobile-koelsch-Enable-SATA-in-defconfig.patch
+patches.renesas/0249-ARM-shmobile-koelsch-Enable-DEVTMPFS_MOUNT-in-defcon.patch
+patches.renesas/0250-ARM-shmobile-lager-Enable-SATA-in-defconfig.patch
+patches.renesas/0251-ARM-shmobile-marzen-enable-CONFIG_DEVTMPFS-in-defcon.patch
+patches.renesas/0252-ARM-shmobile-mackerel-enable-CONFIG_DEVTMPFS-in-defc.patch
+patches.renesas/0253-ARM-shmobile-lager-enable-CONFIG_DEVTMPFS-in-defconf.patch
+patches.renesas/0254-ARM-shmobile-kzm9g-enable-CONFIG_DEVTMPFS-in-defconf.patch
+patches.renesas/0255-ARM-shmobile-kzm9d-enable-CONFIG_DEVTMPFS-in-defconf.patch
+patches.renesas/0256-ARM-shmobile-genmai-enable-CONFIG_DEVTMPFS-in-defcon.patch
+patches.renesas/0257-ARM-shmobile-bockw-enable-CONFIG_DEVTMPFS-in-defconf.patch
+patches.renesas/0258-ARM-shmobile-armadillo-enable-CONFIG_DEVTMPFS-in-def.patch
+patches.renesas/0259-ARM-shmobile-ape6evm-enable-CONFIG_DEVTMPFS-in-defco.patch
+patches.renesas/0260-ARM-shmobile-kzm9d-Conditionally-select-SMSC_PHY.patch
+patches.renesas/0261-ARM-shmobile-mackerel-Conditionally-select-SMSC_PHY.patch
+patches.renesas/0262-ARM-shmobile-marzen-Conditionally-select-SMSC_PHY.patch
+patches.renesas/0263-ARM-shmobile-lager-fix-error-return-code-check-from-.patch
+patches.renesas/0264-ARM-shmobile-koelsch-fix-error-return-code-check-fro.patch
+patches.renesas/0265-ARM-shmobile-lager-Add-USBHS-support.patch
+patches.renesas/0266-ARM-shmobile-Remove-Lager-USBHS-UDC-ifdefs.patch
+patches.renesas/0267-ARM-shmobile-Lager-pass-Ether-PHY-IRQ.patch
+patches.renesas/0268-ARM-shmobile-Koelsch-pass-Ether-PHY-IRQ.patch
+patches.renesas/0269-ARM-shmobile-koelsch-Add-I2C-support.patch
+patches.renesas/0270-ARM-shmobile-koelsch-Enable-I2C-in-defconfig.patch
+patches.renesas/0271-ARM-shmobile-bockw-use-wp-gpios-instead-of-WP-pin.patch
+patches.renesas/0272-ARM-shmobile-Lager-USB0-cable-detection-workaround.patch
+patches.renesas/0273-ARM-shmobile-lager-add-sound-support.patch
+patches.renesas/0274-ARM-shmobile-lager-add-sound-support-on-defconfig.patch
+patches.renesas/0275-Revert-ARM-shmobile-marzen-Conditionally-select-SMSC.patch
+patches.renesas/0276-ARM-shmobile-genmai-legacy-Add-RSPI-support.patch
+patches.renesas/0277-ARM-shmobile-r7s72100-dtsi-Add-RSPI-nodes.patch
+patches.renesas/0278-ARM-shmobile-koelsch-legacy-Add-QSPI-support.patch
+patches.renesas/0279-ARM-shmobile-r8a7791-dtsi-Add-QSPI-node.patch
+patches.renesas/0280-ARM-shmobile-koelsch-dts-Add-QSPI-nodes.patch
+patches.renesas/0281-ARM-shmobile-lager-legacy-Switch-QSPI-to-named-IRQs.patch
+patches.renesas/0282-ARM-shmobile-koelsch-defconfig-Enable-RSPI-and-MTD_M.patch
+patches.renesas/0283-ARM-shmobile-genmai-defconfig-Enable-RSPI.patch
+patches.renesas/0284-ARM-shmobile-genmai-Enable-r7s72100-ether.patch
+patches.renesas/0285-ARM-shmobile-Add-SDHI-devices-for-legacy-Koelsch.patch
+patches.renesas/0286-ARM-shmobile-lager-add-SDHI0-2-support.patch
+patches.renesas/0287-ARM-shmobile-lager-legacy-Add-QSPI-pinmux.patch
+patches.renesas/0288-ARM-shmobile-r8a7790-dtsi-Add-QSPI-node.patch
+patches.renesas/0289-ARM-shmobile-lager-dts-Add-QSPI-nodes.patch
+patches.renesas/0290-ARM-shmobile-lager-defconfig-Enable-RSPI-and-MTD_M25.patch
+patches.renesas/0291-ARM-shmobile-lager-add-SDHI0-2-support-on-DTS.patch
+patches.renesas/0292-ARM-shmobile-r8a7778-dtsi-Remove-duplicate-i2c-nodes.patch
+patches.renesas/0293-ARM-shmobile-Add-defconfig-for-shmobile-multiplatfor.patch
+patches.renesas/0294-ARM-shmobile-lager-Add-internal-USB-PCI-support.patch
+patches.renesas/0295-ARM-shmobile-lager-reference-Refactor-clock-lookup-h.patch
+patches.renesas/0296-ARM-shmobile-lager-Add-DU-device-to-DTS.patch
+patches.renesas/0297-ARM-shmobile-lager-reference-Add-DU-device.patch
+patches.renesas/0298-ARM-shmobile-koelsch-reference-Refactor-clock-lookup.patch
+patches.renesas/0299-ARM-shmobile-koelsch-reference-Add-DU-device.patch
+patches.renesas/0300-ARM-shmobile-koelsch-reference-Add-DU-device-to-DTS.patch
+patches.renesas/0301-ARM-shmobile-r8a7791-remove-superfluous-interrupt-pa.patch
+patches.renesas/0302-ARM-shmobile-r8a7790-remove-superfluous-interrupt-pa.patch
+patches.renesas/0303-ARM-shmobile-r8a7790-add-i2c-aliases-to-dtsi.patch
+patches.renesas/0304-ARM-shmobile-Armadillo-800-EVA-set-proper-DMA-masks-.patch
+patches.renesas/0305-ARM-shmobile-BOCK-W-set-proper-DMA-masks-for-Ether-d.patch
+patches.renesas/0306-ARM-shmobile-Lager-set-proper-DMA-masks-for-Ether-de.patch
+patches.renesas/0307-ARM-shmobile-Koelsch-set-proper-DMA-masks-for-Ether-.patch
+patches.renesas/0308-ARM-shmobile-Genmai-set-proper-DMA-masks-for-Ether-d.patch
+patches.renesas/0309-ARM-shmobile-Get-rid-of-legacy-KZM9D-defconfig.patch
+patches.renesas/0310-ARM-shmobile-koelsch-Enable-SDHI-GPIO-and-regulators.patch
+patches.renesas/0311-ARM-shmobile-Remove-KZM9D-board-code.patch
+patches.renesas/0312-ARM-shmobile-Remove-Koelsch-DT-reference-legacy-cloc.patch
+patches.renesas/0313-ARM-shmobile-Remove-Lager-DT-reference-legacy-clock-.patch
+patches.renesas/0314-ARM-shmobile-r8a7791-add-i2c-master-nodes-to-dtsi.patch
+patches.renesas/0315-ARM-shmobile-r8a7791-add-i2c2-bus-to-koelsch-dt.patch
+patches.renesas/0316-ARM-shmobile-r7s72100-add-nodes-for-i2c-controllers-.patch
+patches.renesas/0317-ARM-shmobile-genmai-adapt-dts-to-use-native-i2c-driv.patch
+patches.renesas/0318-ARM-shmobile-r7s72100-update-defconfig-for-I2C-usage.patch
+patches.renesas/0319-usb-host-remove-selects-of-USB_ARCH_HAS_-HCI.patch
+patches.renesas/0320-ARM-centralize-common-multi-platform-kconfig-options.patch
+patches.renesas/0321-ARM-select-HAVE_SMP-for-V7-multi-platform.patch
+patches.renesas/0322-ARM-select-MIGHT_HAVE_CACHE_L2X0-for-V6-and-V7-multi.patch
+patches.renesas/0323-ARM-shmobile-r8a7778-add-audio-clock-in-new-style.patch
+patches.renesas/0324-ARM-shmobile-r8a7790-add-audio-clock.patch
+patches.renesas/0325-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks.patch
+patches.renesas/0326-ARM-shmobile-r7s72100-clock-Add-RSPI-clocks-for-DT.patch
+patches.renesas/0327-ARM-shmobile-r8a7791-clock-add-QSPI-clocks.patch
+patches.renesas/0328-ARM-shmobile-r7s72100-Add-clock-for-r7s72100-ether.patch
+patches.renesas/0329-ARM-shmobile-Add-r8a7791-legacy-SDHI-clocks.patch
+patches.renesas/0330-ARM-shmobile-Remove-legacy-r8a7790-DT-clocks.patch
+patches.renesas/0331-ARM-shmobile-Use-64-bit-dma_addr_t-on-r8a7790-r8a779.patch
+patches.renesas/0332-ARM-shmobile-Break-out-R-Car-SYSC-PM-code.patch
+patches.renesas/0333-ARM-shmobile-r8a7790-SYSC-setup-code.patch
+patches.renesas/0334-ARM-shmobile-r8a7790-CA7-SCU-enablement.patch
+patches.renesas/0335-ARM-shmobile-r8a7790-CA15-SCU-enablement.patch
+patches.renesas/0336-ARM-shmobile-Remove-__init-from-rcar_gen2_read_mode_.patch
+patches.renesas/0337-ARM-shmobile-r8a7791-Remove-legacy-clock-aliases-for.patch
+patches.renesas/0338-ARM-shmobile-r8a7790-add-sound-SCU-clock-support.patch
+patches.renesas/0339-ARM-shmobile-r8a7790-add-Ether-DT-support.patch
+patches.renesas/0340-ARM-shmobile-lager-add-Ether-DT-support.patch
+patches.renesas/0341-ARM-shmobile-r8a7791-add-Ether-DT-support.patch
+patches.renesas/0342-ARM-shmobile-koelsch-add-Ether-DT-support.patch
+patches.renesas/0343-ARM-shmobile-r8a7791-fix-clock-index-for-i2c5.patch
+patches.renesas/0344-ARM-shmobile-r8a7791-dtsi-Fix-typo-in-msiof2-clock-o.patch
+patches.renesas/0345-ARM-shmobile-Move-SYSC-base-variable-to-inside-ifdef.patch
+patches.renesas/0346-ARM-shmobile-Add-SDHI-devices-to-r8a7791-DTSI.patch
+patches.renesas/0347-ARM-shmobile-Add-SDHI-devices-for-Koelsch-DTS.patch
+patches.renesas/0348-ARM-shmobile-APMU-Fix-warnings-due-to-improper-print.patch
+patches.renesas/0349-ARM-shmobile-r7s72100-fix-bus-clock-calculation.patch
+patches.renesas/0350-ARM-shmobile-Remove-CMT-TMU-and-STI-Kconfig-entries.patch
+patches.renesas/0351-ARM-shmobile-r8a7791-Fix-SCIFA3-5-clocks.patch
+patches.renesas/0352-ASoC-fsi-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
+patches.renesas/0353-ASoC-fsi-fixup-compile-error-for-simple-card.patch
+patches.renesas/0354-ARM-bockw-fixup-SND_SOC_DAIFMT_CBx_CFx-flags.patch
+patches.renesas/0355-Kconfig-rename-HAS_IOPORT-to-HAS_IOPORT_MAP.patch
+patches.renesas/0356-ARM-shmobile-lager-correct-renesas-gpios-to-renesas-.patch
+patches.renesas/0357-ARM-shmobile-lager-fixup-SND_SOC_DAIFMT_CBx_CFx-flag.patch
+patches.renesas/0358-ARM-shmobile-armadillo800eva-fixup-SND_SOC_DAIFMT_CB.patch
+patches.renesas/0359-ARM-shmobile-r8a7778-Use-clks-as-MSTP007-parent.patch
+patches.renesas/0360-ARM-shmobile-sh73a0-drop-address-cells-from-GIC-node.patch
+patches.renesas/0361-ARM-shmobile-r8a7740-drop-address-cells-from-GIC-nod.patch
+patches.renesas/0362-ARM-shmobile-koelsch-correct-renesas-gpios-to-renesa.patch
+patches.renesas/0363-xhci-platform-Change-compatible-string-from-xhci-pla.patch
+patches.renesas/0364-ASoC-rcar-subnode-tidyup-for-renesas-rsnd.txt.patch
+patches.renesas/0365-ARM-shmobile-r8a7790-Correct-SYS-DMAC-clock-defines.patch
+
+
+#############################################################################
# fixes that go after all of the above
#