brcm63xx: remove linux 4.4 support
authorFelix Fietkau <nbd@nbd.name>
Mon, 9 Apr 2018 07:55:48 +0000 (09:55 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 27 Apr 2018 13:19:19 +0000 (15:19 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
233 files changed:
target/linux/brcm63xx/config-4.4 [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-02-mtd-ofpart-grab-device-tree-node-directly-from-maste.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-04-mtd-nand-convert-to-nand_set_flash_node.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-05-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-06-mtd-nand-drop-unnecessary-partition-parser-data.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-07-mtd-spi-nor-drop-unnecessary-partition-parser-data.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-08-mtd-spi-nor-drop-flash_node-field.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-09-mtd-drop-unnecessary-partition-parser-data.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-10-mtd-ofpart-drop-of_node-partition-parser-data.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-11-mtd-physmap_of-assign-parent-for-the-concatenated-MT.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-20-spi-expose-master-transfer-size-limitation.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-30-gpio-add-a-data-pointer-to-gpio_chip.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.5-31-gpio-generic-factor-into-gpio_chip-struct.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.6-01-gpio-Add-devm_-apis-for-gpiochip_add_data-and-gpioch.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.7-01-pinctrl-Add-devm_-apis-for-pinctrl_-register-unregis.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.7-02-pinctrl-Rename-pinctrl_utils_dt_free_map-to-pinctrl_.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-01-mtd-spi-nor-change-return-value-of-read-write.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-03-mtd-fsl-quadspi-return-amount-of-data-read-written-o.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-05-mtd-nxp-spifi-return-amount-of-data-transferred-or-e.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-06-mtd-spi-nor-check-return-value-from-write.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-07-mtd-spi-nor-stop-passing-around-retlen.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-08-mtd-spi-nor-simplify-write-loop.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-09-mtd-spi-nor-add-read-loop.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-10-mtd-m25p80-read-in-spi_max_transfer_size-chunks.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch [deleted file]
target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.11-02-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch [deleted file]
target/linux/brcm63xx/patches-4.4/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch [deleted file]
target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch [deleted file]
target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch [deleted file]
target/linux/brcm63xx/patches-4.4/102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch [deleted file]
target/linux/brcm63xx/patches-4.4/103-MIPS-BCM63XX-add-OHCI-EHCI-configuration-bits-to-com.patch [deleted file]
target/linux/brcm63xx/patches-4.4/104-MIPS-BCM63XX-introduce-BCM63XX_OHCI-configuration-sy.patch [deleted file]
target/linux/brcm63xx/patches-4.4/105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch [deleted file]
target/linux/brcm63xx/patches-4.4/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch [deleted file]
target/linux/brcm63xx/patches-4.4/107-MIPS-BCM63XX-introduce-BCM63XX_EHCI-configuration-sy.patch [deleted file]
target/linux/brcm63xx/patches-4.4/108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch [deleted file]
target/linux/brcm63xx/patches-4.4/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch [deleted file]
target/linux/brcm63xx/patches-4.4/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch [deleted file]
target/linux/brcm63xx/patches-4.4/120-mtdpart_fixup_generic_partprobe.patch [deleted file]
target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch [deleted file]
target/linux/brcm63xx/patches-4.4/131-Documentation-add-BCM6328-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/132-pinctrl-add-a-pincontrol-driver-for-BCM6328.patch [deleted file]
target/linux/brcm63xx/patches-4.4/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch [deleted file]
target/linux/brcm63xx/patches-4.4/135-Documentation-add-BCM6358-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/136-pinctrl-add-a-pincontrol-driver-for-BCM6358.patch [deleted file]
target/linux/brcm63xx/patches-4.4/137-Documentation-add-BCM6362-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/138-pinctrl-add-a-pincontrol-driver-for-BCM6362.patch [deleted file]
target/linux/brcm63xx/patches-4.4/139-Documentation-add-BCM6368-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch [deleted file]
target/linux/brcm63xx/patches-4.4/141-Documentation-add-BCM63268-pincontroller-binding-doc.patch [deleted file]
target/linux/brcm63xx/patches-4.4/142-pinctrl-add-a-pincontrol-driver-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.4/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch [deleted file]
target/linux/brcm63xx/patches-4.4/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch [deleted file]
target/linux/brcm63xx/patches-4.4/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch [deleted file]
target/linux/brcm63xx/patches-4.4/309-cfe_version_mod.patch [deleted file]
target/linux/brcm63xx/patches-4.4/310-cfe_simplify_detection.patch [deleted file]
target/linux/brcm63xx/patches-4.4/311-bcm63xxpart_use_cfedetection.patch [deleted file]
target/linux/brcm63xx/patches-4.4/320-irqchip-add-support-for-bcm6345-style-periphery-irq-.patch [deleted file]
target/linux/brcm63xx/patches-4.4/321-irqchip-add-support-for-bcm6345-style-external-inter.patch [deleted file]
target/linux/brcm63xx/patches-4.4/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch [deleted file]
target/linux/brcm63xx/patches-4.4/323-MIPS-BCM63XX-wire-up-BCM6358-s-external-interrupts-4.patch [deleted file]
target/linux/brcm63xx/patches-4.4/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch [deleted file]
target/linux/brcm63xx/patches-4.4/331-MIPS-BCM63XX-define-variant-id-field.patch [deleted file]
target/linux/brcm63xx/patches-4.4/332-MIPS-BCM63XX-detect-BCM6328-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.4/333-MIPS-BCM63XX-detect-BCM6362-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.4/334-MIPS-BCM63XX-detect-BCM6368-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.4/335-MIPS-BCM63XX-fix-PCIe-memory-window-size.patch [deleted file]
target/linux/brcm63xx/patches-4.4/336-MIPS-BCM63XX-dynamically-set-the-pcie-memory-windows.patch [deleted file]
target/linux/brcm63xx/patches-4.4/337-MIPS-BCM63XX-widen-cpuid-field.patch [deleted file]
target/linux/brcm63xx/patches-4.4/338-MIPS-BCM63XX-increase-number-of-IRQs.patch [deleted file]
target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.4/340-MIPS-BCM63XX-add-pcie-support-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.4/342-MIPS-BCM63XX-split-PCIe-reset-signals.patch [deleted file]
target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.4/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch [deleted file]
target/linux/brcm63xx/patches-4.4/345-MIPS-BCM63XX-fixup-mapped-SPI-flash-access-on-boot.patch [deleted file]
target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch [deleted file]
target/linux/brcm63xx/patches-4.4/347-MIPS-BCM6318-USB-support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch [deleted file]
target/linux/brcm63xx/patches-4.4/349-MIPS-BCM63XX-add-BCM63268-USB-support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/350-MIPS-BCM63XX-support-settings-num-usbh-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.4/351-set-board-usbh-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.4/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch [deleted file]
target/linux/brcm63xx/patches-4.4/355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch [deleted file]
target/linux/brcm63xx/patches-4.4/356-MIPS-BCM63XX-move-fallback-sprom-support-into-its-ow.patch [deleted file]
target/linux/brcm63xx/patches-4.4/357-MIPS-BCM63XX-use-platform-data-for-the-sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.4/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch [deleted file]
target/linux/brcm63xx/patches-4.4/359-MIPS-BCM63XX-allow-different-types-of-sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.4/360-MIPS-BCM63XX-add-support-for-raw-sproms.patch [deleted file]
target/linux/brcm63xx/patches-4.4/361-MIPS-BCM63XX-add-raw-fallback-sproms-for-most-common.patch [deleted file]
target/linux/brcm63xx/patches-4.4/362-MIPS-BCM63XX-also-register-a-fallback-sprom-for-bcma.patch [deleted file]
target/linux/brcm63xx/patches-4.4/363-MIPS-BCM63XX-add-BCMA-based-sprom-templates.patch [deleted file]
target/linux/brcm63xx/patches-4.4/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/365-MIPS-BCM63XX-allow-setting-a-pci-bus-device-for-fall.patch [deleted file]
target/linux/brcm63xx/patches-4.4/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch [deleted file]
target/linux/brcm63xx/patches-4.4/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch [deleted file]
target/linux/brcm63xx/patches-4.4/369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch [deleted file]
target/linux/brcm63xx/patches-4.4/371_add_of_node_available_by_alias.patch [deleted file]
target/linux/brcm63xx/patches-4.4/372_dont_register_pflash_when_available_in_dtb.patch [deleted file]
target/linux/brcm63xx/patches-4.4/373-MIPS-BCM63XX-register-interrupt-controllers-through-.patch [deleted file]
target/linux/brcm63xx/patches-4.4/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch [deleted file]
target/linux/brcm63xx/patches-4.4/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch [deleted file]
target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch [deleted file]
target/linux/brcm63xx/patches-4.4/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch [deleted file]
target/linux/brcm63xx/patches-4.4/379-MIPS-BCM63XX-provide-a-gpio-lookup-for-the-pcmcia-re.patch [deleted file]
target/linux/brcm63xx/patches-4.4/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch [deleted file]
target/linux/brcm63xx/patches-4.4/381-Documentation-add-BCM6318-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/382-pinctrl-add-a-pincontrol-driver-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.4/383-bcm63xx_select_pinctrl.patch [deleted file]
target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch [deleted file]
target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch [deleted file]
target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch [deleted file]
target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch [deleted file]
target/linux/brcm63xx/patches-4.4/400-bcm963xx_flashmap.patch [deleted file]
target/linux/brcm63xx/patches-4.4/401-bcm963xx_real_rootfs_length.patch [deleted file]
target/linux/brcm63xx/patches-4.4/402_bcm63xx_enet_vlan_incoming_fixed.patch [deleted file]
target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch [deleted file]
target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch [deleted file]
target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch [deleted file]
target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch [deleted file]
target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch [deleted file]
target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch [deleted file]
target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch [deleted file]
target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch [deleted file]
target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch [deleted file]
target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch [deleted file]
target/linux/brcm63xx/patches-4.4/425-bcm63xxpart_parse_paritions_from_dt.patch [deleted file]
target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch [deleted file]
target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch [deleted file]
target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch [deleted file]
target/linux/brcm63xx/patches-4.4/501-board-NB4.patch [deleted file]
target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch [deleted file]
target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch [deleted file]
target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch [deleted file]
target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch [deleted file]
target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch [deleted file]
target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch [deleted file]
target/linux/brcm63xx/patches-4.4/508-board_hw553.patch [deleted file]
target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch [deleted file]
target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch [deleted file]
target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch [deleted file]
target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch [deleted file]
target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch [deleted file]
target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch [deleted file]
target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch [deleted file]
target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch [deleted file]
target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch [deleted file]
target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch [deleted file]
target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch [deleted file]
target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch [deleted file]
target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch [deleted file]
target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch [deleted file]
target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch [deleted file]
target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch [deleted file]
target/linux/brcm63xx/patches-4.4/528-board_nb6.patch [deleted file]
target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch [deleted file]
target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch [deleted file]
target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch [deleted file]
target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch [deleted file]
target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch [deleted file]
target/linux/brcm63xx/patches-4.4/534-board_hw556.patch [deleted file]
target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch [deleted file]
target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch [deleted file]
target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch [deleted file]
target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch [deleted file]
target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch [deleted file]
target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch [deleted file]
target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch [deleted file]
target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch [deleted file]
target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch [deleted file]
target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch [deleted file]
target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch [deleted file]
target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch [deleted file]
target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch [deleted file]
target/linux/brcm63xx/patches-4.4/565-board_hw520.patch [deleted file]
target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch [deleted file]
target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch [deleted file]
target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch [deleted file]
target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch [deleted file]
target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch [deleted file]
target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch [deleted file]
target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch [deleted file]
target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch [deleted file]
target/linux/brcm63xx/patches-4.4/574-board_HG622.patch [deleted file]
target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch [deleted file]
target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch [deleted file]
target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch [deleted file]
target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch [deleted file]
target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch [deleted file]
target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch [deleted file]
target/linux/brcm63xx/patches-4.4/800-wl_exports.patch [deleted file]
target/linux/brcm63xx/patches-4.4/801-ssb_export_fallback_sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.4/802-rtl8367r_fix_RGMII_support.patch [deleted file]
target/linux/brcm63xx/patches-4.4/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch [deleted file]
target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch [deleted file]

diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4
deleted file mode 100644 (file)
index 755590f..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-CONFIG_ARCH_BINFMT_ELF_STATE=y
-CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_BCM6345_EXT_IRQ=y
-CONFIG_BCM6345_PERIPH_IRQ=y
-CONFIG_BCM63XX=y
-CONFIG_BCM63XX_CPU_3368=y
-CONFIG_BCM63XX_CPU_6318=y
-CONFIG_BCM63XX_CPU_63268=y
-CONFIG_BCM63XX_CPU_6328=y
-CONFIG_BCM63XX_CPU_6338=y
-CONFIG_BCM63XX_CPU_6345=y
-CONFIG_BCM63XX_CPU_6348=y
-CONFIG_BCM63XX_CPU_6358=y
-CONFIG_BCM63XX_CPU_6362=y
-CONFIG_BCM63XX_CPU_6368=y
-CONFIG_BCM63XX_EHCI=y
-CONFIG_BCM63XX_ENET=y
-CONFIG_BCM63XX_OHCI=y
-CONFIG_BCM63XX_PHY=y
-CONFIG_BCM63XX_WDT=y
-CONFIG_BCMA=y
-CONFIG_BCMA_BLOCKIO=y
-# CONFIG_BCMA_DEBUG is not set
-# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
-# CONFIG_BCMA_DRIVER_MIPS is not set
-CONFIG_BCMA_DRIVER_PCI=y
-# CONFIG_BCMA_DRIVER_PCI_HOSTMODE is not set
-CONFIG_BCMA_HOST_PCI=y
-CONFIG_BCMA_HOST_PCI_POSSIBLE=y
-# CONFIG_BCMA_HOST_SOC is not set
-CONFIG_BCM_NET_PHYLIB=y
-CONFIG_BOARD_BCM63XX_DT=y
-CONFIG_BOARD_BCM963XX=y
-CONFIG_BOARD_LIVEBOX=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_CEVT_R4K=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CPU_BIG_ENDIAN=y
-CONFIG_CPU_BMIPS=y
-CONFIG_CPU_BMIPS32_3300=y
-CONFIG_CPU_BMIPS4350=y
-CONFIG_CPU_GENERIC_DUMP_TLB=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
-CONFIG_CPU_R4K_CACHE_TLB=y
-CONFIG_CPU_R4K_FPU=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_CSRC_R4K=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DTC=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_BCM63XX=y
-CONFIG_GPIO_DEVRES=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-# CONFIG_HAVE_ARCH_BITREVERSE is not set
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_BCM63XX=y
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_HZ_PERIODIC=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IP_PIMSM_V1=y
-CONFIG_IP_PIMSM_V2=y
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_MIPS_CPU=y
-CONFIG_IRQ_WORK=y
-CONFIG_KEXEC=y
-CONFIG_KEXEC_CORE=y
-CONFIG_LEDS_BCM6328=y
-CONFIG_LEDS_BCM6358=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LIBFDT=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MFD_SYSCON=y
-CONFIG_MIPS=y
-CONFIG_MIPS_CLOCK_VSYSCALL=y
-# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
-# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set
-CONFIG_MIPS_CMDLINE_FROM_DTB=y
-# CONFIG_MIPS_ELF_APPENDED_DTB is not set
-# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=4
-CONFIG_MIPS_L1_CACHE_SHIFT_4=y
-# CONFIG_MIPS_MACHINE is not set
-# CONFIG_MIPS_NO_APPENDED_DTB is not set
-CONFIG_MIPS_RAW_APPENDED_DTB=y
-CONFIG_MODULES_USE_ELF_REL=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MTD_BCM63XX_PARTS=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_BE_BYTE_SWAP=y
-# CONFIG_MTD_CFI_GEOMETRY is not set
-# CONFIG_MTD_CFI_NOSWAP is not set
-CONFIG_MTD_CFI_STAA=y
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_REDBOOT_PARTS=y
-CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
-# CONFIG_NO_IOPORT_MAP is not set
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_MTD=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_PCI=y
-# CONFIG_PCIEAER is not set
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PGTABLE_LEVELS=2
-CONFIG_PHYLIB=y
-CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6348=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
-CONFIG_PINCTRL_BCM63XX=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-# CONFIG_RCU_STALL_COMMON is not set
-CONFIG_REGMAP=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_RELAY=y
-CONFIG_RTL8366_SMI=y
-CONFIG_RTL8367_PHY=y
-# CONFIG_SCHED_INFO is not set
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SERIAL_8250 is not set
-CONFIG_SERIAL_BCM63XX=y
-CONFIG_SERIAL_BCM63XX_CONSOLE=y
-CONFIG_SPI=y
-CONFIG_SPI_BCM63XX=y
-CONFIG_SPI_BCM63XX_HSSPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SQUASHFS_EMBEDDED=y
-CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SWCONFIG=y
-CONFIG_SWCONFIG_B53=y
-CONFIG_SWCONFIG_B53_MMAP_DRIVER=y
-CONFIG_SWCONFIG_B53_PHY_DRIVER=y
-CONFIG_SWCONFIG_B53_PHY_FIXUP=y
-CONFIG_SWCONFIG_B53_SPI_DRIVER=y
-# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
-CONFIG_SYNC_R4K=y
-CONFIG_SYSCTL_EXCEPTION_TRACE=y
-CONFIG_SYS_HAS_CPU_BMIPS=y
-CONFIG_SYS_HAS_CPU_BMIPS32_3300=y
-CONFIG_SYS_HAS_CPU_BMIPS4350=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y
-CONFIG_SYS_SUPPORTS_SMP=y
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_USB_SUPPORT=y
-CONFIG_USE_OF=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-CONFIG_WEAK_ORDERING=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-01-mtd-add-get-set-of_node-flash_node-helpers.patch
deleted file mode 100644 (file)
index d4ac4fc..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From 28b8b26b308e656edfa9467867d5f79212da2ec3 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:20 -0700
-Subject: [PATCH 01/11] mtd: add get/set of_node/flash_node helpers
-
-We are going to begin using the mtd->dev.of_node field for MTD device
-nodes, so let's add helpers for it. Also, we'll be making some
-conversions on spi_nor (and nand_chip eventually) too, so get that ready
-with their own helpers.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- include/linux/mtd/mtd.h     | 11 +++++++++++
- include/linux/mtd/nand.h    | 11 +++++++++++
- include/linux/mtd/spi-nor.h | 11 +++++++++++
- 3 files changed, 33 insertions(+)
-
---- a/include/linux/mtd/mtd.h
-+++ b/include/linux/mtd/mtd.h
-@@ -258,6 +258,17 @@ struct mtd_info {
-       int usecount;
- };
-+static inline void mtd_set_of_node(struct mtd_info *mtd,
-+                                 struct device_node *np)
-+{
-+      mtd->dev.of_node = np;
-+}
-+
-+static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)
-+{
-+      return mtd->dev.of_node;
-+}
-+
- int mtd_erase(struct mtd_info *mtd, struct erase_info *instr);
- int mtd_point(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen,
-             void **virt, resource_size_t *phys);
---- a/include/linux/mtd/nand.h
-+++ b/include/linux/mtd/nand.h
-@@ -719,6 +719,17 @@ struct nand_chip {
-       void *priv;
- };
-+static inline void nand_set_flash_node(struct nand_chip *chip,
-+                                     struct device_node *np)
-+{
-+      chip->flash_node = np;
-+}
-+
-+static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
-+{
-+      return chip->flash_node;
-+}
-+
- /*
-  * NAND Flash Manufacturer ID Codes
-  */
---- a/include/linux/mtd/spi-nor.h
-+++ b/include/linux/mtd/spi-nor.h
-@@ -184,6 +184,17 @@ struct spi_nor {
-       void *priv;
- };
-+static inline void spi_nor_set_flash_node(struct spi_nor *nor,
-+                                        struct device_node *np)
-+{
-+      nor->flash_node = np;
-+}
-+
-+static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
-+{
-+      return nor->flash_node;
-+}
-+
- /**
-  * spi_nor_scan() - scan the SPI NOR
-  * @nor:      the spi_nor structure
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-02-mtd-ofpart-grab-device-tree-node-directly-from-maste.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-02-mtd-ofpart-grab-device-tree-node-directly-from-maste.patch
deleted file mode 100644 (file)
index 14ad2d4..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-From 3b6521eab0386a4854d47b1a01947d7dc46ec98d Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:21 -0700
-Subject: [PATCH] mtd: ofpart: grab device tree node directly from master
- device node
-
-It seems more logical to use a device node directly associated with the
-MTD master device (i.e., mtd->dev.of_node field) rather than requiring
-auxiliary partition parser information to be passed in by the driver in
-a separate struct.
-
-This patch supports the mtd->dev.of_node field and deprecates the parser
-data 'of_node' field
-
-Driver conversions may now follow.
-
-Additional side benefit to assigning mtd->dev.of_node rather than using
-parser data: the driver core will automatically create a device -> node
-symlink for us.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/ofpart.c           | 18 ++++++++++--------
- include/linux/mtd/partitions.h |  4 +++-
- 2 files changed, 13 insertions(+), 9 deletions(-)
-
---- a/drivers/mtd/ofpart.c
-+++ b/drivers/mtd/ofpart.c
-@@ -37,10 +37,11 @@ static int parse_ofpart_partitions(struc
-       bool dedicated = true;
--      if (!data)
--              return 0;
--
--      mtd_node = data->of_node;
-+      /*
-+       * of_node can be provided through auxiliary parser data or (preferred)
-+       * by assigning the master device node
-+       */
-+      mtd_node = data && data->of_node ? data->of_node : mtd_get_of_node(master);
-       if (!mtd_node)
-               return 0;
-@@ -157,10 +158,11 @@ static int parse_ofoldpart_partitions(st
-       } *part;
-       const char *names;
--      if (!data)
--              return 0;
--
--      dp = data->of_node;
-+      /*
-+       * of_node can be provided through auxiliary parser data or (preferred)
-+       * by assigning the master device node
-+       */
-+      dp = data && data->of_node ? data->of_node : mtd_get_of_node(master);
-       if (!dp)
-               return 0;
---- a/include/linux/mtd/partitions.h
-+++ b/include/linux/mtd/partitions.h
-@@ -56,7 +56,9 @@ struct device_node;
- /**
-  * struct mtd_part_parser_data - used to pass data to MTD partition parsers.
-  * @origin: for RedBoot, start address of MTD device
-- * @of_node: for OF parsers, device node containing partitioning information
-+ * @of_node: for OF parsers, device node containing partitioning information.
-+ *           This field is deprecated, as the device node should simply be
-+ *           assigned to the master struct device.
-  */
- struct mtd_part_parser_data {
-       unsigned long origin;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch
deleted file mode 100644 (file)
index e29aecd..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From 3e63b26bdd4069c3df2cd7ce7217a21d06801b41 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:22 -0700
-Subject: [PATCH 03/11] mtd: {nand,spi-nor}: assign MTD of_node
-
-We should pass along our flash DT node to the MTD layer, so it can set
-up ofpart for us.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/nand/nand_base.c  | 3 +++
- drivers/mtd/spi-nor/spi-nor.c | 1 +
- 2 files changed, 4 insertions(+)
-
---- a/drivers/mtd/nand/nand_base.c
-+++ b/drivers/mtd/nand/nand_base.c
-@@ -3995,6 +3995,9 @@ int nand_scan_ident(struct mtd_info *mtd
-       int ret;
-       if (chip->flash_node) {
-+              /* MTD can automatically handle DT partitions, etc. */
-+              mtd_set_of_node(mtd, chip->flash_node);
-+
-               ret = nand_dt_init(mtd, chip, chip->flash_node);
-               if (ret)
-                       return ret;
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1228,6 +1228,7 @@ int spi_nor_scan(struct spi_nor *nor, co
-               mtd->flags |= MTD_NO_ERASE;
-       mtd->dev.parent = dev;
-+      mtd_set_of_node(mtd, np);
-       nor->page_size = info->page_size;
-       mtd->writebufsize = nor->page_size;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-04-mtd-nand-convert-to-nand_set_flash_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-04-mtd-nand-convert-to-nand_set_flash_node.patch
deleted file mode 100644 (file)
index 15a1ec3..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From 6375219951a66047805ed977b674615d152001ee Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:23 -0700
-Subject: [PATCH 04/11] mtd: nand: convert to nand_set_flash_node()
-
-Used semantic patch with 'make coccicheck MODE=patch COCCI=script.cocci':
-
----8<----
-virtual patch
-
-@@
-struct nand_chip *c;
-struct device_node *d;
-@@
--(c)->flash_node = (d)
-+nand_set_flash_node(c, d)
----8<----
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Marek Vasut <marex@denx.de>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/nand/brcmnand/brcmnand.c | 2 +-
- drivers/mtd/nand/fsmc_nand.c         | 2 +-
- drivers/mtd/nand/sunxi_nand.c        | 2 +-
- drivers/mtd/nand/vf610_nfc.c         | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/mtd/nand/brcmnand/brcmnand.c
-+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
-@@ -1950,7 +1950,7 @@ static int brcmnand_init_cs(struct brcmn
-       mtd = &host->mtd;
-       chip = &host->chip;
--      chip->flash_node = dn;
-+      nand_set_flash_node(chip, dn);
-       chip->priv = host;
-       mtd->priv = chip;
-       mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "brcmnand.%d",
---- a/drivers/mtd/nand/fsmc_nand.c
-+++ b/drivers/mtd/nand/fsmc_nand.c
-@@ -1033,7 +1033,7 @@ static int __init fsmc_nand_probe(struct
-       nand->options = pdata->options;
-       nand->select_chip = fsmc_select_chip;
-       nand->badblockbits = 7;
--      nand->flash_node = np;
-+      nand_set_flash_node(nand, np);
-       if (pdata->width == FSMC_NAND_BW16)
-               nand->options |= NAND_BUSWIDTH_16;
---- a/drivers/mtd/nand/sunxi_nand.c
-+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1336,7 +1336,7 @@ static int sunxi_nand_chip_init(struct d
-        * in the DT.
-        */
-       nand->ecc.mode = NAND_ECC_HW;
--      nand->flash_node = np;
-+      nand_set_flash_node(nand, np);
-       nand->select_chip = sunxi_nfc_select_chip;
-       nand->cmd_ctrl = sunxi_nfc_cmd_ctrl;
-       nand->read_buf = sunxi_nfc_read_buf;
---- a/drivers/mtd/nand/vf610_nfc.c
-+++ b/drivers/mtd/nand/vf610_nfc.c
-@@ -714,7 +714,7 @@ static int vf610_nfc_probe(struct platfo
-                               goto error;
-                       }
--                      chip->flash_node = child;
-+                      nand_set_flash_node(chip, child);
-               }
-       }
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-05-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-05-spi-nor-convert-to-spi_nor_-get-set-_flash_node.patch
deleted file mode 100644 (file)
index 4056baf..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-From 9c7d787508be6d68a6ec66de3c3466b24e820c71 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:24 -0700
-Subject: [PATCH] mtd: spi-nor: convert to spi_nor_{get, set}_flash_node()
-
-Used semantic patch with 'make coccicheck MODE=patch COCCI=script.cocci':
-
----8<----
-virtual patch
-
-@@
-struct spi_nor b;
-struct spi_nor *c;
-expression d;
-@@
-(
--(b).flash_node = (d)
-+spi_nor_set_flash_node(&b, d)
-|
--(c)->flash_node = (d)
-+spi_nor_set_flash_node(c, d)
-)
----8<----
-
-And a manual conversion for the one use of spi_nor_get_flash_node().
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/devices/m25p80.c      | 2 +-
- drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
- drivers/mtd/spi-nor/nxp-spifi.c   | 2 +-
- drivers/mtd/spi-nor/spi-nor.c     | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -221,7 +221,7 @@ static int m25p_probe(struct spi_device
-       nor->read_reg = m25p80_read_reg;
-       nor->dev = &spi->dev;
--      nor->flash_node = spi->dev.of_node;
-+      spi_nor_set_flash_node(nor, spi->dev.of_node);
-       nor->priv = flash;
-       spi_set_drvdata(spi, flash);
---- a/drivers/mtd/spi-nor/fsl-quadspi.c
-+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
-@@ -1013,7 +1013,7 @@ static int fsl_qspi_probe(struct platfor
-               mtd = &nor->mtd;
-               nor->dev = dev;
--              nor->flash_node = np;
-+              spi_nor_set_flash_node(nor, np);
-               nor->priv = q;
-               /* fill the hooks */
---- a/drivers/mtd/spi-nor/nxp-spifi.c
-+++ b/drivers/mtd/spi-nor/nxp-spifi.c
-@@ -330,7 +330,7 @@ static int nxp_spifi_setup_flash(struct
-       writel(ctrl, spifi->io_base + SPIFI_CTRL);
-       spifi->nor.dev   = spifi->dev;
--      spifi->nor.flash_node = np;
-+      spi_nor_set_flash_node(&spifi->nor, np);
-       spifi->nor.priv  = spifi;
-       spifi->nor.read  = nxp_spifi_read;
-       spifi->nor.write = nxp_spifi_write;
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1120,7 +1120,7 @@ int spi_nor_scan(struct spi_nor *nor, co
-       const struct flash_info *info = NULL;
-       struct device *dev = nor->dev;
-       struct mtd_info *mtd = &nor->mtd;
--      struct device_node *np = nor->flash_node;
-+      struct device_node *np = spi_nor_get_flash_node(nor);
-       int ret;
-       int i;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-06-mtd-nand-drop-unnecessary-partition-parser-data.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-06-mtd-nand-drop-unnecessary-partition-parser-data.patch
deleted file mode 100644 (file)
index 3dc68f0..0000000
+++ /dev/null
@@ -1,725 +0,0 @@
-From a61ae81a1907af1987ad4c77300508327bc48b23 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:25 -0700
-Subject: [PATCH 06/11] mtd: nand: drop unnecessary partition parser data
-
-All of these drivers set up a parser data struct just to communicate DT
-partition data. This field has been deprecated and is instead supported
-by telling nand_scan_ident() about the 'flash_node'.
-
-This patch:
- * sets chip->flash_node for those drivers that didn't already (but used
-   OF partitioning)
- * drops the parser data
- * switches to the simpler mtd_device_register() where possible, now
-   that we've eliminated one of the auxiliary parameters
-
-Now that we've assigned chip->flash_node for these drivers, we can
-probably rely on nand_dt_init() to do more of the DT parsing for us, but
-for now, I don't want to fiddle with each of these drivers. The parsing
-is done in duplicate for now on some drivers. I don't think this should
-break things. (Famous last words.)
-
-(Rolled in some changes by Boris Brezillon)
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/nand/atmel_nand.c                 |  7 +++----
- drivers/mtd/nand/brcmnand/brcmnand.c          |  3 +--
- drivers/mtd/nand/davinci_nand.c               | 10 +++-------
- drivers/mtd/nand/fsl_elbc_nand.c              |  5 ++---
- drivers/mtd/nand/fsl_ifc_nand.c               |  5 ++---
- drivers/mtd/nand/fsl_upm.c                    |  5 ++---
- drivers/mtd/nand/fsmc_nand.c                  |  7 +++----
- drivers/mtd/nand/gpio.c                       |  8 +++-----
- drivers/mtd/nand/gpmi-nand/gpmi-nand.c        |  5 ++---
- drivers/mtd/nand/hisi504_nand.c               |  5 ++---
- drivers/mtd/nand/lpc32xx_mlc.c                |  7 +++----
- drivers/mtd/nand/lpc32xx_slc.c                |  7 +++----
- drivers/mtd/nand/mpc5121_nfc.c                |  5 ++---
- drivers/mtd/nand/mxc_nand.c                   |  5 ++---
- drivers/mtd/nand/ndfc.c                       |  5 ++---
- drivers/mtd/nand/omap2.c                      |  6 ++----
- drivers/mtd/nand/orion_nand.c                 |  6 ++----
- drivers/mtd/nand/plat_nand.c                  |  5 ++---
- drivers/mtd/nand/pxa3xx_nand.c                | 10 +++++-----
- drivers/mtd/nand/sh_flctl.c                   |  6 ++----
- drivers/mtd/nand/socrates_nand.c              |  5 ++---
- drivers/mtd/nand/sunxi_nand.c                 |  4 +---
- drivers/mtd/nand/vf610_nfc.c                  |  6 +-----
- drivers/staging/mt29f_spinand/mt29f_spinand.c |  5 ++---
- 24 files changed, 54 insertions(+), 88 deletions(-)
-
---- a/drivers/mtd/nand/atmel_nand.c
-+++ b/drivers/mtd/nand/atmel_nand.c
-@@ -2093,7 +2093,6 @@ static int atmel_nand_probe(struct platf
-       struct mtd_info *mtd;
-       struct nand_chip *nand_chip;
-       struct resource *mem;
--      struct mtd_part_parser_data ppdata = {};
-       int res, irq;
-       /* Allocate memory for the device structure (and zero it) */
-@@ -2117,6 +2116,7 @@ static int atmel_nand_probe(struct platf
-       nand_chip = &host->nand_chip;
-       host->dev = &pdev->dev;
-       if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
-+              nand_set_flash_node(nand_chip, pdev->dev.of_node);
-               /* Only when CONFIG_OF is enabled of_node can be parsed */
-               res = atmel_of_init_port(host, pdev->dev.of_node);
-               if (res)
-@@ -2259,9 +2259,8 @@ static int atmel_nand_probe(struct platf
-       }
-       mtd->name = "atmel_nand";
--      ppdata.of_node = pdev->dev.of_node;
--      res = mtd_device_parse_register(mtd, NULL, &ppdata,
--                      host->board.parts, host->board.num_parts);
-+      res = mtd_device_register(mtd, host->board.parts,
-+                                host->board.num_parts);
-       if (!res)
-               return res;
---- a/drivers/mtd/nand/brcmnand/brcmnand.c
-+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
-@@ -1939,7 +1939,6 @@ static int brcmnand_init_cs(struct brcmn
-       struct nand_chip *chip;
-       int ret;
-       u16 cfg_offs;
--      struct mtd_part_parser_data ppdata = { .of_node = dn };
-       ret = of_property_read_u32(dn, "reg", &host->cs);
-       if (ret) {
-@@ -2018,7 +2017,7 @@ static int brcmnand_init_cs(struct brcmn
-       if (nand_scan_tail(mtd))
-               return -ENXIO;
--      return mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      return mtd_device_register(mtd, NULL, 0);
- }
- static void brcmnand_save_restore_cs_config(struct brcmnand_host *host,
---- a/drivers/mtd/nand/davinci_nand.c
-+++ b/drivers/mtd/nand/davinci_nand.c
-@@ -687,6 +687,7 @@ static int nand_davinci_probe(struct pla
-       info->mtd.priv          = &info->chip;
-       info->mtd.dev.parent    = &pdev->dev;
-+      nand_set_flash_node(&info->chip, pdev->dev.of_node);
-       info->chip.IO_ADDR_R    = vaddr;
-       info->chip.IO_ADDR_W    = vaddr;
-@@ -842,13 +843,8 @@ syndrome_done:
-       if (pdata->parts)
-               ret = mtd_device_parse_register(&info->mtd, NULL, NULL,
-                                       pdata->parts, pdata->nr_parts);
--      else {
--              struct mtd_part_parser_data     ppdata;
--
--              ppdata.of_node = pdev->dev.of_node;
--              ret = mtd_device_parse_register(&info->mtd, NULL, &ppdata,
--                                              NULL, 0);
--      }
-+      else
-+              ret = mtd_device_register(&info->mtd, NULL, 0);
-       if (ret < 0)
-               goto err;
---- a/drivers/mtd/nand/fsl_elbc_nand.c
-+++ b/drivers/mtd/nand/fsl_elbc_nand.c
-@@ -748,6 +748,7 @@ static int fsl_elbc_chip_init(struct fsl
-       /* Fill in fsl_elbc_mtd structure */
-       priv->mtd.priv = chip;
-       priv->mtd.dev.parent = priv->dev;
-+      nand_set_flash_node(chip, priv->dev->of_node);
-       /* set timeout to maximum */
-       priv->fmr = 15 << FMR_CWTO_SHIFT;
-@@ -823,9 +824,7 @@ static int fsl_elbc_nand_probe(struct pl
-       int bank;
-       struct device *dev;
-       struct device_node *node = pdev->dev.of_node;
--      struct mtd_part_parser_data ppdata;
--      ppdata.of_node = pdev->dev.of_node;
-       if (!fsl_lbc_ctrl_dev || !fsl_lbc_ctrl_dev->regs)
-               return -ENODEV;
-       lbc = fsl_lbc_ctrl_dev->regs;
-@@ -911,7 +910,7 @@ static int fsl_elbc_nand_probe(struct pl
-       /* First look for RedBoot table or partitions on the command
-        * line, these take precedence over device tree information */
--      mtd_device_parse_register(&priv->mtd, part_probe_types, &ppdata,
-+      mtd_device_parse_register(&priv->mtd, part_probe_types, NULL,
-                                 NULL, 0);
-       printk(KERN_INFO "eLBC NAND device at 0x%llx, bank %d\n",
---- a/drivers/mtd/nand/fsl_ifc_nand.c
-+++ b/drivers/mtd/nand/fsl_ifc_nand.c
-@@ -883,6 +883,7 @@ static int fsl_ifc_chip_init(struct fsl_
-       /* Fill in fsl_ifc_mtd structure */
-       priv->mtd.priv = chip;
-       priv->mtd.dev.parent = priv->dev;
-+      nand_set_flash_node(chip, priv->dev->of_node);
-       /* fill in nand_chip structure */
-       /* set up function call table */
-@@ -1030,9 +1031,7 @@ static int fsl_ifc_nand_probe(struct pla
-       int ret;
-       int bank;
-       struct device_node *node = dev->dev.of_node;
--      struct mtd_part_parser_data ppdata;
--      ppdata.of_node = dev->dev.of_node;
-       if (!fsl_ifc_ctrl_dev || !fsl_ifc_ctrl_dev->regs)
-               return -ENODEV;
-       ifc = fsl_ifc_ctrl_dev->regs;
-@@ -1128,7 +1127,7 @@ static int fsl_ifc_nand_probe(struct pla
-       /* First look for RedBoot table or partitions on the command
-        * line, these take precedence over device tree information */
--      mtd_device_parse_register(&priv->mtd, part_probe_types, &ppdata,
-+      mtd_device_parse_register(&priv->mtd, part_probe_types, NULL,
-                                               NULL, 0);
-       dev_info(priv->dev, "IFC NAND device at 0x%llx, bank %d\n",
---- a/drivers/mtd/nand/fsl_upm.c
-+++ b/drivers/mtd/nand/fsl_upm.c
-@@ -159,7 +159,6 @@ static int fun_chip_init(struct fsl_upm_
- {
-       int ret;
-       struct device_node *flash_np;
--      struct mtd_part_parser_data ppdata;
-       fun->chip.IO_ADDR_R = fun->io_base;
-       fun->chip.IO_ADDR_W = fun->io_base;
-@@ -182,6 +181,7 @@ static int fun_chip_init(struct fsl_upm_
-       if (!flash_np)
-               return -ENODEV;
-+      nand_set_flash_node(&fun->chip, flash_np);
-       fun->mtd.name = kasprintf(GFP_KERNEL, "0x%llx.%s", (u64)io_res->start,
-                                 flash_np->name);
-       if (!fun->mtd.name) {
-@@ -193,8 +193,7 @@ static int fun_chip_init(struct fsl_upm_
-       if (ret)
-               goto err;
--      ppdata.of_node = flash_np;
--      ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(&fun->mtd, NULL, 0);
- err:
-       of_node_put(flash_np);
-       if (ret)
---- a/drivers/mtd/nand/fsmc_nand.c
-+++ b/drivers/mtd/nand/fsmc_nand.c
-@@ -926,7 +926,6 @@ static int __init fsmc_nand_probe(struct
- {
-       struct fsmc_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
-       struct device_node __maybe_unused *np = pdev->dev.of_node;
--      struct mtd_part_parser_data ppdata = {};
-       struct fsmc_nand_data *host;
-       struct mtd_info *mtd;
-       struct nand_chip *nand;
-@@ -1016,6 +1015,7 @@ static int __init fsmc_nand_probe(struct
-       nand = &host->nand;
-       mtd->priv = nand;
-       nand->priv = host;
-+      nand_set_flash_node(nand, np);
-       host->mtd.dev.parent = &pdev->dev;
-       nand->IO_ADDR_R = host->data_va;
-@@ -1175,9 +1175,8 @@ static int __init fsmc_nand_probe(struct
-        * Check for partition info passed
-        */
-       host->mtd.name = "nand";
--      ppdata.of_node = np;
--      ret = mtd_device_parse_register(&host->mtd, NULL, &ppdata,
--                                      host->partitions, host->nr_partitions);
-+      ret = mtd_device_register(&host->mtd, host->partitions,
-+                                host->nr_partitions);
-       if (ret)
-               goto err_probe;
---- a/drivers/mtd/nand/gpio.c
-+++ b/drivers/mtd/nand/gpio.c
-@@ -209,7 +209,6 @@ static int gpio_nand_probe(struct platfo
-       struct gpiomtd *gpiomtd;
-       struct nand_chip *chip;
-       struct resource *res;
--      struct mtd_part_parser_data ppdata = {};
-       int ret = 0;
-       if (!pdev->dev.of_node && !dev_get_platdata(&pdev->dev))
-@@ -268,6 +267,7 @@ static int gpio_nand_probe(struct platfo
-               chip->dev_ready = gpio_nand_devready;
-       }
-+      nand_set_flash_node(chip, pdev->dev.of_node);
-       chip->IO_ADDR_W         = chip->IO_ADDR_R;
-       chip->ecc.mode          = NAND_ECC_SOFT;
-       chip->options           = gpiomtd->plat.options;
-@@ -291,10 +291,8 @@ static int gpio_nand_probe(struct platfo
-               gpiomtd->plat.adjust_parts(&gpiomtd->plat,
-                                          gpiomtd->mtd_info.size);
--      ppdata.of_node = pdev->dev.of_node;
--      ret = mtd_device_parse_register(&gpiomtd->mtd_info, NULL, &ppdata,
--                                      gpiomtd->plat.parts,
--                                      gpiomtd->plat.num_parts);
-+      ret = mtd_device_register(&gpiomtd->mtd_info, gpiomtd->plat.parts,
-+                                gpiomtd->plat.num_parts);
-       if (!ret)
-               return 0;
---- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
-+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
-@@ -1888,7 +1888,6 @@ static int gpmi_nand_init(struct gpmi_na
- {
-       struct mtd_info  *mtd = &this->mtd;
-       struct nand_chip *chip = &this->nand;
--      struct mtd_part_parser_data ppdata = {};
-       int ret;
-       /* init current chip */
-@@ -1901,6 +1900,7 @@ static int gpmi_nand_init(struct gpmi_na
-       /* init the nand_chip{}, we don't support a 16-bit NAND Flash bus. */
-       chip->priv              = this;
-+      nand_set_flash_node(chip, this->pdev->dev.of_node);
-       chip->select_chip       = gpmi_select_chip;
-       chip->cmd_ctrl          = gpmi_cmd_ctrl;
-       chip->dev_ready         = gpmi_dev_ready;
-@@ -1954,8 +1954,7 @@ static int gpmi_nand_init(struct gpmi_na
-       if (ret)
-               goto err_out;
--      ppdata.of_node = this->pdev->dev.of_node;
--      ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(mtd, NULL, 0);
-       if (ret)
-               goto err_out;
-       return 0;
---- a/drivers/mtd/nand/hisi504_nand.c
-+++ b/drivers/mtd/nand/hisi504_nand.c
-@@ -704,7 +704,6 @@ static int hisi_nfc_probe(struct platfor
-       struct mtd_info   *mtd;
-       struct resource   *res;
-       struct device_node *np = dev->of_node;
--      struct mtd_part_parser_data ppdata;
-       host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
-       if (!host)
-@@ -742,6 +741,7 @@ static int hisi_nfc_probe(struct platfor
-       mtd->dev.parent         = &pdev->dev;
-       chip->priv              = host;
-+      nand_set_flash_node(chip, np);
-       chip->cmdfunc           = hisi_nfc_cmdfunc;
-       chip->select_chip       = hisi_nfc_select_chip;
-       chip->read_byte         = hisi_nfc_read_byte;
-@@ -805,8 +805,7 @@ static int hisi_nfc_probe(struct platfor
-               goto err_res;
-       }
--      ppdata.of_node = np;
--      ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(mtd, NULL, 0);
-       if (ret) {
-               dev_err(dev, "Err MTD partition=%d\n", ret);
-               goto err_mtd;
---- a/drivers/mtd/nand/lpc32xx_mlc.c
-+++ b/drivers/mtd/nand/lpc32xx_mlc.c
-@@ -647,7 +647,6 @@ static int lpc32xx_nand_probe(struct pla
-       struct nand_chip *nand_chip;
-       struct resource *rc;
-       int res;
--      struct mtd_part_parser_data ppdata = {};
-       /* Allocate memory for the device structure (and zero it) */
-       host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
-@@ -682,6 +681,7 @@ static int lpc32xx_nand_probe(struct pla
-       host->pdata = dev_get_platdata(&pdev->dev);
-       nand_chip->priv = host;         /* link the private data structures */
-+      nand_set_flash_node(nand_chip, pdev->dev.of_node);
-       mtd->priv = nand_chip;
-       mtd->dev.parent = &pdev->dev;
-@@ -786,9 +786,8 @@ static int lpc32xx_nand_probe(struct pla
-       mtd->name = DRV_NAME;
--      ppdata.of_node = pdev->dev.of_node;
--      res = mtd_device_parse_register(mtd, NULL, &ppdata, host->ncfg->parts,
--                                      host->ncfg->num_parts);
-+      res = mtd_device_register(mtd, host->ncfg->parts,
-+                                host->ncfg->num_parts);
-       if (!res)
-               return res;
---- a/drivers/mtd/nand/lpc32xx_slc.c
-+++ b/drivers/mtd/nand/lpc32xx_slc.c
-@@ -763,7 +763,6 @@ static int lpc32xx_nand_probe(struct pla
-       struct mtd_info *mtd;
-       struct nand_chip *chip;
-       struct resource *rc;
--      struct mtd_part_parser_data ppdata = {};
-       int res;
-       rc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-@@ -803,6 +802,7 @@ static int lpc32xx_nand_probe(struct pla
-       mtd = &host->mtd;
-       chip = &host->nand_chip;
-       chip->priv = host;
-+      nand_set_flash_node(chip, pdev->dev.of_node);
-       mtd->priv = chip;
-       mtd->owner = THIS_MODULE;
-       mtd->dev.parent = &pdev->dev;
-@@ -908,9 +908,8 @@ static int lpc32xx_nand_probe(struct pla
-       }
-       mtd->name = "nxp_lpc3220_slc";
--      ppdata.of_node = pdev->dev.of_node;
--      res = mtd_device_parse_register(mtd, NULL, &ppdata, host->ncfg->parts,
--                                      host->ncfg->num_parts);
-+      res = mtd_device_register(mtd, host->ncfg->parts,
-+                                host->ncfg->num_parts);
-       if (!res)
-               return res;
---- a/drivers/mtd/nand/mpc5121_nfc.c
-+++ b/drivers/mtd/nand/mpc5121_nfc.c
-@@ -639,7 +639,6 @@ static int mpc5121_nfc_probe(struct plat
-       int resettime = 0;
-       int retval = 0;
-       int rev, len;
--      struct mtd_part_parser_data ppdata;
-       /*
-        * Check SoC revision. This driver supports only NFC
-@@ -661,6 +660,7 @@ static int mpc5121_nfc_probe(struct plat
-       mtd->priv = chip;
-       mtd->dev.parent = dev;
-       chip->priv = prv;
-+      nand_set_flash_node(chip, dn);
-       prv->dev = dev;
-       /* Read NFC configuration from Reset Config Word */
-@@ -703,7 +703,6 @@ static int mpc5121_nfc_probe(struct plat
-       }
-       mtd->name = "MPC5121 NAND";
--      ppdata.of_node = dn;
-       chip->dev_ready = mpc5121_nfc_dev_ready;
-       chip->cmdfunc = mpc5121_nfc_command;
-       chip->read_byte = mpc5121_nfc_read_byte;
-@@ -815,7 +814,7 @@ static int mpc5121_nfc_probe(struct plat
-       dev_set_drvdata(dev, mtd);
-       /* Register device in MTD */
--      retval = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      retval = mtd_device_register(mtd, NULL, 0);
-       if (retval) {
-               dev_err(dev, "Error adding MTD device!\n");
-               goto error;
---- a/drivers/mtd/nand/mxc_nand.c
-+++ b/drivers/mtd/nand/mxc_nand.c
-@@ -1524,6 +1524,7 @@ static int mxcnd_probe(struct platform_d
-       this->chip_delay = 5;
-       this->priv = host;
-+      nand_set_flash_node(this, pdev->dev.of_node),
-       this->dev_ready = mxc_nand_dev_ready;
-       this->cmdfunc = mxc_nand_command;
-       this->read_byte = mxc_nand_read_byte;
-@@ -1683,9 +1684,7 @@ static int mxcnd_probe(struct platform_d
-       /* Register the partitions */
-       mtd_device_parse_register(mtd, part_probes,
--                      &(struct mtd_part_parser_data){
--                              .of_node = pdev->dev.of_node,
--                      },
-+                      NULL,
-                       host->pdata.parts,
-                       host->pdata.nr_parts);
---- a/drivers/mtd/nand/ndfc.c
-+++ b/drivers/mtd/nand/ndfc.c
-@@ -147,7 +147,6 @@ static int ndfc_chip_init(struct ndfc_co
- {
-       struct device_node *flash_np;
-       struct nand_chip *chip = &ndfc->chip;
--      struct mtd_part_parser_data ppdata;
-       int ret;
-       chip->IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA;
-@@ -174,8 +173,8 @@ static int ndfc_chip_init(struct ndfc_co
-       flash_np = of_get_next_child(node, NULL);
-       if (!flash_np)
-               return -ENODEV;
-+      nand_set_flash_node(chip, flash_np);
--      ppdata.of_node = flash_np;
-       ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s",
-                       dev_name(&ndfc->ofdev->dev), flash_np->name);
-       if (!ndfc->mtd.name) {
-@@ -187,7 +186,7 @@ static int ndfc_chip_init(struct ndfc_co
-       if (ret)
-               goto err;
--      ret = mtd_device_parse_register(&ndfc->mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(&ndfc->mtd, NULL, 0);
- err:
-       of_node_put(flash_np);
---- a/drivers/mtd/nand/omap2.c
-+++ b/drivers/mtd/nand/omap2.c
-@@ -1663,7 +1663,6 @@ static int omap_nand_probe(struct platfo
-       unsigned                        sig;
-       unsigned                        oob_index;
-       struct resource                 *res;
--      struct mtd_part_parser_data     ppdata = {};
-       pdata = dev_get_platdata(&pdev->dev);
-       if (pdata == NULL) {
-@@ -1688,6 +1687,7 @@ static int omap_nand_probe(struct platfo
-       mtd->dev.parent         = &pdev->dev;
-       nand_chip               = &info->nand;
-       nand_chip->ecc.priv     = NULL;
-+      nand_set_flash_node(nand_chip, pdata->of_node);
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       nand_chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res);
-@@ -2037,9 +2037,7 @@ scan_tail:
-               goto return_error;
-       }
--      ppdata.of_node = pdata->of_node;
--      mtd_device_parse_register(mtd, NULL, &ppdata, pdata->parts,
--                                pdata->nr_parts);
-+      mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
-       platform_set_drvdata(pdev, mtd);
---- a/drivers/mtd/nand/orion_nand.c
-+++ b/drivers/mtd/nand/orion_nand.c
-@@ -76,7 +76,6 @@ static void orion_nand_read_buf(struct m
- static int __init orion_nand_probe(struct platform_device *pdev)
- {
-       struct mtd_info *mtd;
--      struct mtd_part_parser_data ppdata = {};
-       struct nand_chip *nc;
-       struct orion_nand_data *board;
-       struct resource *res;
-@@ -127,6 +126,7 @@ static int __init orion_nand_probe(struc
-       mtd->dev.parent = &pdev->dev;
-       nc->priv = board;
-+      nand_set_flash_node(nc, pdev->dev.of_node);
-       nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
-       nc->cmd_ctrl = orion_nand_cmd_ctrl;
-       nc->read_buf = orion_nand_read_buf;
-@@ -161,9 +161,7 @@ static int __init orion_nand_probe(struc
-       }
-       mtd->name = "orion_nand";
--      ppdata.of_node = pdev->dev.of_node;
--      ret = mtd_device_parse_register(mtd, NULL, &ppdata,
--                      board->parts, board->nr_parts);
-+      ret = mtd_device_register(mtd, board->parts, board->nr_parts);
-       if (ret) {
-               nand_release(mtd);
-               goto no_dev;
---- a/drivers/mtd/nand/plat_nand.c
-+++ b/drivers/mtd/nand/plat_nand.c
-@@ -30,7 +30,6 @@ struct plat_nand_data {
- static int plat_nand_probe(struct platform_device *pdev)
- {
-       struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);
--      struct mtd_part_parser_data ppdata;
-       struct plat_nand_data *data;
-       struct resource *res;
-       const char **part_types;
-@@ -58,6 +57,7 @@ static int plat_nand_probe(struct platfo
-               return PTR_ERR(data->io_base);
-       data->chip.priv = &data;
-+      nand_set_flash_node(&data->chip, pdev->dev.of_node);
-       data->mtd.priv = &data->chip;
-       data->mtd.dev.parent = &pdev->dev;
-@@ -105,8 +105,7 @@ static int plat_nand_probe(struct platfo
-       part_types = pdata->chip.part_probe_types;
--      ppdata.of_node = pdev->dev.of_node;
--      err = mtd_device_parse_register(&data->mtd, part_types, &ppdata,
-+      err = mtd_device_parse_register(&data->mtd, part_types, NULL,
-                                       pdata->chip.partitions,
-                                       pdata->chip.nr_partitions);
---- a/drivers/mtd/nand/pxa3xx_nand.c
-+++ b/drivers/mtd/nand/pxa3xx_nand.c
-@@ -1697,6 +1697,7 @@ KEEP_CONFIG:
- static int alloc_nand_resource(struct platform_device *pdev)
- {
-+      struct device_node *np = pdev->dev.of_node;
-       struct pxa3xx_nand_platform_data *pdata;
-       struct pxa3xx_nand_info *info;
-       struct pxa3xx_nand_host *host;
-@@ -1725,6 +1726,8 @@ static int alloc_nand_resource(struct pl
-               host->info_data = info;
-               mtd->priv = host;
-               mtd->dev.parent = &pdev->dev;
-+              /* FIXME: all chips use the same device tree partitions */
-+              nand_set_flash_node(chip, np);
-               chip->ecc.read_page     = pxa3xx_nand_read_page_hwecc;
-               chip->ecc.write_page    = pxa3xx_nand_write_page_hwecc;
-@@ -1886,7 +1889,6 @@ static int pxa3xx_nand_probe_dt(struct p
- static int pxa3xx_nand_probe(struct platform_device *pdev)
- {
-       struct pxa3xx_nand_platform_data *pdata;
--      struct mtd_part_parser_data ppdata = {};
-       struct pxa3xx_nand_info *info;
-       int ret, cs, probe_success, dma_available;
-@@ -1933,10 +1935,8 @@ static int pxa3xx_nand_probe(struct plat
-                       continue;
-               }
--              ppdata.of_node = pdev->dev.of_node;
--              ret = mtd_device_parse_register(mtd, NULL,
--                                              &ppdata, pdata->parts[cs],
--                                              pdata->nr_parts[cs]);
-+              ret = mtd_device_register(mtd, pdata->parts[cs],
-+                                        pdata->nr_parts[cs]);
-               if (!ret)
-                       probe_success = 1;
-       }
---- a/drivers/mtd/nand/sh_flctl.c
-+++ b/drivers/mtd/nand/sh_flctl.c
-@@ -1086,7 +1086,6 @@ static int flctl_probe(struct platform_d
-       struct sh_flctl_platform_data *pdata;
-       int ret;
-       int irq;
--      struct mtd_part_parser_data ppdata = {};
-       flctl = devm_kzalloc(&pdev->dev, sizeof(struct sh_flctl), GFP_KERNEL);
-       if (!flctl)
-@@ -1124,6 +1123,7 @@ static int flctl_probe(struct platform_d
-       platform_set_drvdata(pdev, flctl);
-       flctl_mtd = &flctl->mtd;
-       nand = &flctl->chip;
-+      nand_set_flash_node(nand, pdev->dev.of_node);
-       flctl_mtd->priv = nand;
-       flctl_mtd->dev.parent = &pdev->dev;
-       flctl->pdev = pdev;
-@@ -1164,9 +1164,7 @@ static int flctl_probe(struct platform_d
-       if (ret)
-               goto err_chip;
--      ppdata.of_node = pdev->dev.of_node;
--      ret = mtd_device_parse_register(flctl_mtd, NULL, &ppdata, pdata->parts,
--                      pdata->nr_parts);
-+      ret = mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts);
-       return 0;
---- a/drivers/mtd/nand/socrates_nand.c
-+++ b/drivers/mtd/nand/socrates_nand.c
-@@ -147,7 +147,6 @@ static int socrates_nand_probe(struct pl
-       struct mtd_info *mtd;
-       struct nand_chip *nand_chip;
-       int res;
--      struct mtd_part_parser_data ppdata;
-       /* Allocate memory for the device structure (and zero it) */
-       host = devm_kzalloc(&ofdev->dev, sizeof(*host), GFP_KERNEL);
-@@ -165,10 +164,10 @@ static int socrates_nand_probe(struct pl
-       host->dev = &ofdev->dev;
-       nand_chip->priv = host;         /* link the private data structures */
-+      nand_set_flash_node(nand_chip, ofdev->dev.of_node);
-       mtd->priv = nand_chip;
-       mtd->name = "socrates_nand";
-       mtd->dev.parent = &ofdev->dev;
--      ppdata.of_node = ofdev->dev.of_node;
-       /*should never be accessed directly */
-       nand_chip->IO_ADDR_R = (void *)0xdeadbeef;
-@@ -200,7 +199,7 @@ static int socrates_nand_probe(struct pl
-               goto out;
-       }
--      res = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      res = mtd_device_register(mtd, NULL, 0);
-       if (!res)
-               return res;
---- a/drivers/mtd/nand/sunxi_nand.c
-+++ b/drivers/mtd/nand/sunxi_nand.c
-@@ -1238,7 +1238,6 @@ static int sunxi_nand_chip_init(struct d
- {
-       const struct nand_sdr_timings *timings;
-       struct sunxi_nand_chip *chip;
--      struct mtd_part_parser_data ppdata;
-       struct mtd_info *mtd;
-       struct nand_chip *nand;
-       int nsels;
-@@ -1372,8 +1371,7 @@ static int sunxi_nand_chip_init(struct d
-               return ret;
-       }
--      ppdata.of_node = np;
--      ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(mtd, NULL, 0);
-       if (ret) {
-               dev_err(dev, "failed to register mtd device: %d\n", ret);
-               nand_release(mtd);
---- a/drivers/mtd/nand/vf610_nfc.c
-+++ b/drivers/mtd/nand/vf610_nfc.c
-@@ -811,11 +811,7 @@ static int vf610_nfc_probe(struct platfo
-       platform_set_drvdata(pdev, mtd);
-       /* Register device in MTD */
--      return mtd_device_parse_register(mtd, NULL,
--              &(struct mtd_part_parser_data){
--                      .of_node = chip->flash_node,
--              },
--              NULL, 0);
-+      return mtd_device_register(mtd, NULL, 0);
- error:
-       of_node_put(chip->flash_node);
---- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
-+++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
-@@ -850,7 +850,6 @@ static int spinand_probe(struct spi_devi
-       struct nand_chip *chip;
-       struct spinand_info *info;
-       struct spinand_state *state;
--      struct mtd_part_parser_data ppdata;
-       info  = devm_kzalloc(&spi_nand->dev, sizeof(struct spinand_info),
-                            GFP_KERNEL);
-@@ -894,6 +893,7 @@ static int spinand_probe(struct spi_devi
-               pr_info("%s: disable ecc failed!\n", __func__);
- #endif
-+      nand_set_flash_node(chip, spi_nand->dev.of_node);
-       chip->priv      = info;
-       chip->read_buf  = spinand_read_buf;
-       chip->write_buf = spinand_write_buf;
-@@ -916,8 +916,7 @@ static int spinand_probe(struct spi_devi
-       if (nand_scan(mtd, 1))
-               return -ENXIO;
--      ppdata.of_node = spi_nand->dev.of_node;
--      return mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+      return mtd_device_register(mtd, NULL, 0);
- }
- /*
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-07-mtd-spi-nor-drop-unnecessary-partition-parser-data.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-07-mtd-spi-nor-drop-unnecessary-partition-parser-data.patch
deleted file mode 100644 (file)
index dafde16..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-From df02c885f8697546da41665f28dde5e30ce99674 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:26 -0700
-Subject: [PATCH] mtd: spi-nor: drop unnecessary partition parser data
-
-Now that the SPI-NOR/MTD framework pass the 'flash_node' through to the
-partition parsing code, we don't have to do it ourselves.
-
-Also convert to mtd_device_register(), since we don't need the 2nd and
-3rd parameters anymore.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/devices/m25p80.c      | 8 ++------
- drivers/mtd/spi-nor/fsl-quadspi.c | 4 +---
- drivers/mtd/spi-nor/nxp-spifi.c   | 4 +---
- 3 files changed, 4 insertions(+), 12 deletions(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -197,7 +197,6 @@ static int m25p80_erase(struct spi_nor *
-  */
- static int m25p_probe(struct spi_device *spi)
- {
--      struct mtd_part_parser_data     ppdata;
-       struct flash_platform_data      *data;
-       struct m25p *flash;
-       struct spi_nor *nor;
-@@ -249,11 +248,8 @@ static int m25p_probe(struct spi_device
-       if (ret)
-               return ret;
--      ppdata.of_node = spi->dev.of_node;
--
--      return mtd_device_parse_register(&nor->mtd, NULL, &ppdata,
--                      data ? data->parts : NULL,
--                      data ? data->nr_parts : 0);
-+      return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
-+                                 data ? data->nr_parts : 0);
- }
---- a/drivers/mtd/spi-nor/fsl-quadspi.c
-+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
-@@ -927,7 +927,6 @@ static void fsl_qspi_unprep(struct spi_n
- static int fsl_qspi_probe(struct platform_device *pdev)
- {
-       struct device_node *np = pdev->dev.of_node;
--      struct mtd_part_parser_data ppdata;
-       struct device *dev = &pdev->dev;
-       struct fsl_qspi *q;
-       struct resource *res;
-@@ -1038,8 +1037,7 @@ static int fsl_qspi_probe(struct platfor
-               if (ret)
-                       goto mutex_failed;
--              ppdata.of_node = np;
--              ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
-+              ret = mtd_device_register(mtd, NULL, 0);
-               if (ret)
-                       goto mutex_failed;
---- a/drivers/mtd/spi-nor/nxp-spifi.c
-+++ b/drivers/mtd/spi-nor/nxp-spifi.c
-@@ -271,7 +271,6 @@ static void nxp_spifi_dummy_id_read(stru
- static int nxp_spifi_setup_flash(struct nxp_spifi *spifi,
-                                struct device_node *np)
- {
--      struct mtd_part_parser_data ppdata;
-       enum read_mode flash_read;
-       u32 ctrl, property;
-       u16 mode = 0;
-@@ -361,8 +360,7 @@ static int nxp_spifi_setup_flash(struct
-               return ret;
-       }
--      ppdata.of_node = np;
--      ret = mtd_device_parse_register(&spifi->nor.mtd, NULL, &ppdata, NULL, 0);
-+      ret = mtd_device_register(&spifi->nor.mtd, NULL, 0);
-       if (ret) {
-               dev_err(spifi->dev, "mtd device parse failed\n");
-               return ret;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-08-mtd-spi-nor-drop-flash_node-field.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-08-mtd-spi-nor-drop-flash_node-field.patch
deleted file mode 100644 (file)
index 1dd3225..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-From 30069af7348b56eb8c5e1dda7788a531c5f24ca2 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:27 -0700
-Subject: [PATCH 08/11] mtd: spi-nor: drop flash_node field
-
-We can just alias to the MTD of_node.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 1 -
- include/linux/mtd/spi-nor.h   | 6 ++----
- 2 files changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1228,7 +1228,6 @@ int spi_nor_scan(struct spi_nor *nor, co
-               mtd->flags |= MTD_NO_ERASE;
-       mtd->dev.parent = dev;
--      mtd_set_of_node(mtd, np);
-       nor->page_size = info->page_size;
-       mtd->writebufsize = nor->page_size;
---- a/include/linux/mtd/spi-nor.h
-+++ b/include/linux/mtd/spi-nor.h
-@@ -123,7 +123,6 @@ enum spi_nor_option_flags {
-  * @mtd:              point to a mtd_info structure
-  * @lock:             the lock for the read/write/erase/lock/unlock operations
-  * @dev:              point to a spi device, or a spi nor controller device.
-- * @flash_node:               point to a device node describing this flash instance.
-  * @page_size:                the page size of the SPI NOR
-  * @addr_width:               number of address bytes
-  * @erase_opcode:     the opcode for erasing a sector
-@@ -154,7 +153,6 @@ struct spi_nor {
-       struct mtd_info         mtd;
-       struct mutex            lock;
-       struct device           *dev;
--      struct device_node      *flash_node;
-       u32                     page_size;
-       u8                      addr_width;
-       u8                      erase_opcode;
-@@ -187,12 +185,12 @@ struct spi_nor {
- static inline void spi_nor_set_flash_node(struct spi_nor *nor,
-                                         struct device_node *np)
- {
--      nor->flash_node = np;
-+      mtd_set_of_node(&nor->mtd, np);
- }
- static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
- {
--      return nor->flash_node;
-+      return mtd_get_of_node(&nor->mtd);
- }
- /**
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-09-mtd-drop-unnecessary-partition-parser-data.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-09-mtd-drop-unnecessary-partition-parser-data.patch
deleted file mode 100644 (file)
index 5bd6c8c..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-From 004b5e6031f4e9fd90d565fb213b74cd06d03718 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:28 -0700
-Subject: [PATCH] mtd: drop unnecessary partition parser data
-
-We should assign the MTD dev.of_node instead of the parser data field.
-This gets us the equivalent partition parser behavior with fewer special
-fields and parameter passing.
-
-Also convert several of these to mtd_device_register(), since we don't
-need the 2nd and 3rd parameters anymore.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Marek Vasut <marex@denx.de>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/devices/mtd_dataflash.c | 5 ++---
- drivers/mtd/devices/spear_smi.c     | 6 ++----
- drivers/mtd/devices/st_spi_fsm.c    | 5 ++---
- drivers/mtd/maps/lantiq-flash.c     | 5 ++---
- drivers/mtd/maps/physmap_of.c       | 5 ++---
- drivers/mtd/onenand/omap2.c         | 8 +++-----
- 6 files changed, 13 insertions(+), 21 deletions(-)
-
---- a/drivers/mtd/devices/mtd_dataflash.c
-+++ b/drivers/mtd/devices/mtd_dataflash.c
-@@ -624,7 +624,6 @@ static int add_dataflash_otp(struct spi_
- {
-       struct dataflash                *priv;
-       struct mtd_info                 *device;
--      struct mtd_part_parser_data     ppdata;
-       struct flash_platform_data      *pdata = dev_get_platdata(&spi->dev);
-       char                            *otp_tag = "";
-       int                             err = 0;
-@@ -656,6 +655,7 @@ static int add_dataflash_otp(struct spi_
-       device->priv = priv;
-       device->dev.parent = &spi->dev;
-+      mtd_set_of_node(device, spi->dev.of_node);
-       if (revision >= 'c')
-               otp_tag = otp_setup(device, revision);
-@@ -665,8 +665,7 @@ static int add_dataflash_otp(struct spi_
-                       pagesize, otp_tag);
-       spi_set_drvdata(spi, priv);
--      ppdata.of_node = spi->dev.of_node;
--      err = mtd_device_parse_register(device, NULL, &ppdata,
-+      err = mtd_device_register(device,
-                       pdata ? pdata->parts : NULL,
-                       pdata ? pdata->nr_parts : 0);
---- a/drivers/mtd/devices/spear_smi.c
-+++ b/drivers/mtd/devices/spear_smi.c
-@@ -810,7 +810,6 @@ static int spear_smi_setup_banks(struct
-                                u32 bank, struct device_node *np)
- {
-       struct spear_smi *dev = platform_get_drvdata(pdev);
--      struct mtd_part_parser_data ppdata = {};
-       struct spear_smi_flash_info *flash_info;
-       struct spear_smi_plat_data *pdata;
-       struct spear_snor_flash *flash;
-@@ -855,6 +854,7 @@ static int spear_smi_setup_banks(struct
-               flash->mtd.name = flash_devices[flash_index].name;
-       flash->mtd.dev.parent = &pdev->dev;
-+      mtd_set_of_node(&flash->mtd, np);
-       flash->mtd.type = MTD_NORFLASH;
-       flash->mtd.writesize = 1;
-       flash->mtd.flags = MTD_CAP_NORFLASH;
-@@ -881,10 +881,8 @@ static int spear_smi_setup_banks(struct
-               count = flash_info->nr_partitions;
-       }
- #endif
--      ppdata.of_node = np;
--      ret = mtd_device_parse_register(&flash->mtd, NULL, &ppdata, parts,
--                                      count);
-+      ret = mtd_device_register(&flash->mtd, parts, count);
-       if (ret) {
-               dev_err(&dev->pdev->dev, "Err MTD partition=%d\n", ret);
-               return ret;
---- a/drivers/mtd/devices/st_spi_fsm.c
-+++ b/drivers/mtd/devices/st_spi_fsm.c
-@@ -2025,7 +2025,6 @@ boot_device_fail:
- static int stfsm_probe(struct platform_device *pdev)
- {
-       struct device_node *np = pdev->dev.of_node;
--      struct mtd_part_parser_data ppdata;
-       struct flash_info *info;
-       struct resource *res;
-       struct stfsm *fsm;
-@@ -2035,7 +2034,6 @@ static int stfsm_probe(struct platform_d
-               dev_err(&pdev->dev, "No DT found\n");
-               return -EINVAL;
-       }
--      ppdata.of_node = np;
-       fsm = devm_kzalloc(&pdev->dev, sizeof(*fsm), GFP_KERNEL);
-       if (!fsm)
-@@ -2106,6 +2104,7 @@ static int stfsm_probe(struct platform_d
-       fsm->mtd.name           = info->name;
-       fsm->mtd.dev.parent     = &pdev->dev;
-+      mtd_set_of_node(&fsm->mtd, np);
-       fsm->mtd.type           = MTD_NORFLASH;
-       fsm->mtd.writesize      = 4;
-       fsm->mtd.writebufsize   = fsm->mtd.writesize;
-@@ -2124,7 +2123,7 @@ static int stfsm_probe(struct platform_d
-               (long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
-               fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
--      return mtd_device_parse_register(&fsm->mtd, NULL, &ppdata, NULL, 0);
-+      return mtd_device_register(&fsm->mtd, NULL, 0);
- }
- static int stfsm_remove(struct platform_device *pdev)
---- a/drivers/mtd/maps/lantiq-flash.c
-+++ b/drivers/mtd/maps/lantiq-flash.c
-@@ -110,7 +110,6 @@ ltq_copy_to(struct map_info *map, unsign
- static int
- ltq_mtd_probe(struct platform_device *pdev)
- {
--      struct mtd_part_parser_data ppdata;
-       struct ltq_mtd *ltq_mtd;
-       struct cfi_private *cfi;
-       int err;
-@@ -161,13 +160,13 @@ ltq_mtd_probe(struct platform_device *pd
-       }
-       ltq_mtd->mtd->dev.parent = &pdev->dev;
-+      mtd_set_of_node(ltq_mtd->mtd, pdev->dev.of_node);
-       cfi = ltq_mtd->map->fldrv_priv;
-       cfi->addr_unlock1 ^= 1;
-       cfi->addr_unlock2 ^= 1;
--      ppdata.of_node = pdev->dev.of_node;
--      err = mtd_device_parse_register(ltq_mtd->mtd, NULL, &ppdata, NULL, 0);
-+      err = mtd_device_register(ltq_mtd->mtd, NULL, 0);
-       if (err) {
-               dev_err(&pdev->dev, "failed to add partitions\n");
-               goto err_destroy;
---- a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -128,7 +128,6 @@ static int of_flash_probe(struct platfor
-       int reg_tuple_size;
-       struct mtd_info **mtd_list = NULL;
-       resource_size_t res_size;
--      struct mtd_part_parser_data ppdata;
-       bool map_indirect;
-       const char *mtd_name = NULL;
-@@ -272,8 +271,8 @@ static int of_flash_probe(struct platfor
-       if (err)
-               goto err_out;
--      ppdata.of_node = dp;
--      mtd_device_parse_register(info->cmtd, part_probe_types_def, &ppdata,
-+      mtd_set_of_node(info->cmtd, dp);
-+      mtd_device_parse_register(info->cmtd, part_probe_types_def, NULL,
-                       NULL, 0);
-       kfree(mtd_list);
---- a/drivers/mtd/onenand/omap2.c
-+++ b/drivers/mtd/onenand/omap2.c
-@@ -614,7 +614,6 @@ static int omap2_onenand_probe(struct pl
-       struct onenand_chip *this;
-       int r;
-       struct resource *res;
--      struct mtd_part_parser_data ppdata = {};
-       pdata = dev_get_platdata(&pdev->dev);
-       if (pdata == NULL) {
-@@ -713,6 +712,7 @@ static int omap2_onenand_probe(struct pl
-       c->mtd.priv = &c->onenand;
-       c->mtd.dev.parent = &pdev->dev;
-+      mtd_set_of_node(&c->mtd, pdata->of_node);
-       this = &c->onenand;
-       if (c->dma_channel >= 0) {
-@@ -743,10 +743,8 @@ static int omap2_onenand_probe(struct pl
-       if ((r = onenand_scan(&c->mtd, 1)) < 0)
-               goto err_release_regulator;
--      ppdata.of_node = pdata->of_node;
--      r = mtd_device_parse_register(&c->mtd, NULL, &ppdata,
--                                    pdata ? pdata->parts : NULL,
--                                    pdata ? pdata->nr_parts : 0);
-+      r = mtd_device_register(&c->mtd, pdata ? pdata->parts : NULL,
-+                              pdata ? pdata->nr_parts : 0);
-       if (r)
-               goto err_release_onenand;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-10-mtd-ofpart-drop-of_node-partition-parser-data.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-10-mtd-ofpart-drop-of_node-partition-parser-data.patch
deleted file mode 100644 (file)
index 4c9b11b..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-From e270bca531b40cd0a143176eb093d173b9c6f418 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:29 -0700
-Subject: [PATCH 10/11] mtd: ofpart: drop 'of_node' partition parser data
-
-This field is no longer used anywhere, as it is superseded by
-mtd->dev.of_node.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/ofpart.c           | 14 ++++----------
- include/linux/mtd/partitions.h |  4 ----
- 2 files changed, 4 insertions(+), 14 deletions(-)
-
---- a/drivers/mtd/ofpart.c
-+++ b/drivers/mtd/ofpart.c
-@@ -37,11 +37,8 @@ static int parse_ofpart_partitions(struc
-       bool dedicated = true;
--      /*
--       * of_node can be provided through auxiliary parser data or (preferred)
--       * by assigning the master device node
--       */
--      mtd_node = data && data->of_node ? data->of_node : mtd_get_of_node(master);
-+      /* Pull of_node from the master device node */
-+      mtd_node = mtd_get_of_node(master);
-       if (!mtd_node)
-               return 0;
-@@ -158,11 +155,8 @@ static int parse_ofoldpart_partitions(st
-       } *part;
-       const char *names;
--      /*
--       * of_node can be provided through auxiliary parser data or (preferred)
--       * by assigning the master device node
--       */
--      dp = data && data->of_node ? data->of_node : mtd_get_of_node(master);
-+      /* Pull of_node from the master device node */
-+      dp = mtd_get_of_node(master);
-       if (!dp)
-               return 0;
---- a/include/linux/mtd/partitions.h
-+++ b/include/linux/mtd/partitions.h
-@@ -56,13 +56,9 @@ struct device_node;
- /**
-  * struct mtd_part_parser_data - used to pass data to MTD partition parsers.
-  * @origin: for RedBoot, start address of MTD device
-- * @of_node: for OF parsers, device node containing partitioning information.
-- *           This field is deprecated, as the device node should simply be
-- *           assigned to the master struct device.
-  */
- struct mtd_part_parser_data {
-       unsigned long origin;
--      struct device_node *of_node;
- };
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-11-mtd-physmap_of-assign-parent-for-the-concatenated-MT.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-11-mtd-physmap_of-assign-parent-for-the-concatenated-MT.patch
deleted file mode 100644 (file)
index 90eb6da..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From 8361a9b8cb6a9c71b7cf884a87b2532d8367c185 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Fri, 30 Oct 2015 20:33:30 -0700
-Subject: [PATCH 11/11] mtd: physmap_of: assign parent for the concatenated MTD
-
-If there is more than one map region for this device, then the
-concatenated MTD will not have a parent device assigned to it -- only
-the sub-devices (which are not actually registered with the framework)
-will have their parents assigned. Let's assign the concatenated device
-correctly.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/maps/physmap_of.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -271,6 +271,7 @@ static int of_flash_probe(struct platfor
-       if (err)
-               goto err_out;
-+      info->cmtd->dev.parent = &dev->dev;
-       mtd_set_of_node(info->cmtd, dp);
-       mtd_device_parse_register(info->cmtd, part_probe_types_def, NULL,
-                       NULL, 0);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-20-spi-expose-master-transfer-size-limitation.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-20-spi-expose-master-transfer-size-limitation.patch
deleted file mode 100644 (file)
index 21e037c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 4acad4aae10d1fa79a075b38b5c73772c44f576c Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Wed, 2 Dec 2015 10:38:21 +0000
-Subject: [PATCH] spi: expose master transfer size limitation.
-
-On some SPI controllers it is not feasible to transfer arbitrary amount
-of data at once.
-
-When the limit on transfer size is a few kilobytes at least it makes
-sense to use the SPI hardware rather than reverting to gpio driver.
-
-The protocol drivers need a way to check that they do not sent overly
-long messages, though.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Mark Brown <broonie@kernel.org>
----
- include/linux/spi/spi.h | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
-
---- a/include/linux/spi/spi.h
-+++ b/include/linux/spi/spi.h
-@@ -428,6 +428,12 @@ struct spi_master {
- #define SPI_MASTER_MUST_RX      BIT(3)                /* requires rx */
- #define SPI_MASTER_MUST_TX      BIT(4)                /* requires tx */
-+      /*
-+       * on some hardware transfer size may be constrained
-+       * the limit may depend on device transfer settings
-+       */
-+      size_t (*max_transfer_size)(struct spi_device *spi);
-+
-       /* lock and mutex for SPI bus locking */
-       spinlock_t              bus_lock_spinlock;
-       struct mutex            bus_lock_mutex;
-@@ -837,6 +843,15 @@ extern int spi_async(struct spi_device *
- extern int spi_async_locked(struct spi_device *spi,
-                           struct spi_message *message);
-+static inline size_t
-+spi_max_transfer_size(struct spi_device *spi)
-+{
-+      struct spi_master *master = spi->master;
-+      if (!master->max_transfer_size)
-+              return SIZE_MAX;
-+      return master->max_transfer_size(spi);
-+}
-+
- /*---------------------------------------------------------------------------*/
- /* All these synchronous SPI transfer routines are utilities layered
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-30-gpio-add-a-data-pointer-to-gpio_chip.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-30-gpio-add-a-data-pointer-to-gpio_chip.patch
deleted file mode 100644 (file)
index 7a44a7c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-From b08ea35a3296ee25c4cb53a977b752266dafa2c2 Mon Sep 17 00:00:00 2001
-From: Linus Walleij <linus.walleij@linaro.org>
-Date: Thu, 3 Dec 2015 15:14:13 +0100
-Subject: [PATCH] gpio: add a data pointer to gpio_chip
-
-This adds a void * pointer to gpio_chip so that driver can
-assign and retrieve some states. This is done to get rid of
-container_of() calls for gpio_chips embedded inside state
-containers, so we can remove the need to have the gpio_chip
-or later (planned) struct gpio_device be dynamically allocated
-at registration time, so that its struct device can be properly
-reference counted and not bound to its parent device (e.g.
-a platform_device) but instead live on after unregistration
-if it is opened by e.g. a char device or sysfs.
-
-The data is added with the new function gpiochip_add_data()
-and for compatibility we add static inline wrapper function
-gpiochip_add() that will call gpiochip_add_data() with
-NULL as argument. The latter will be removed once we have
-exorcised gpiochip_add() from the kernel.
-
-gpiochip_get_data() is added as a static inline accessor
-for drivers to quickly get their data out.
-
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
----
- drivers/gpio/gpiolib.c      | 10 ++++++----
- include/linux/gpio/driver.h | 14 +++++++++++++-
- 2 files changed, 19 insertions(+), 5 deletions(-)
-
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -280,7 +280,7 @@ static int gpiochip_set_desc_names(struc
- }
- /**
-- * gpiochip_add() - register a gpio_chip
-+ * gpiochip_add_data() - register a gpio_chip
-  * @chip: the chip to register, with chip->base initialized
-  * Context: potentially before irqs will work
-  *
-@@ -288,7 +288,7 @@ static int gpiochip_set_desc_names(struc
-  * because the chip->base is invalid or already associated with a
-  * different chip.  Otherwise it returns zero as a success code.
-  *
-- * When gpiochip_add() is called very early during boot, so that GPIOs
-+ * When gpiochip_add_data() is called very early during boot, so that GPIOs
-  * can be freely used, the chip->dev device must be registered before
-  * the gpio framework's arch_initcall().  Otherwise sysfs initialization
-  * for GPIOs will fail rudely.
-@@ -296,7 +296,7 @@ static int gpiochip_set_desc_names(struc
-  * If chip->base is negative, this requests dynamic assignment of
-  * a range of valid GPIOs.
-  */
--int gpiochip_add(struct gpio_chip *chip)
-+int gpiochip_add_data(struct gpio_chip *chip, void *data)
- {
-       unsigned long   flags;
-       int             status = 0;
-@@ -308,6 +308,8 @@ int gpiochip_add(struct gpio_chip *chip)
-       if (!descs)
-               return -ENOMEM;
-+      chip->data = data;
-+
-       spin_lock_irqsave(&gpio_lock, flags);
-       if (base < 0) {
-@@ -389,7 +391,7 @@ err_free_descs:
-               chip->label ? : "generic");
-       return status;
- }
--EXPORT_SYMBOL_GPL(gpiochip_add);
-+EXPORT_SYMBOL_GPL(gpiochip_add_data);
- /**
-  * gpiochip_remove() - unregister a gpio_chip
---- a/include/linux/gpio/driver.h
-+++ b/include/linux/gpio/driver.h
-@@ -23,6 +23,7 @@ struct seq_file;
-  * @dev: optional device providing the GPIOs
-  * @cdev: class device used by sysfs interface (may be NULL)
-  * @owner: helps prevent removal of modules exporting active GPIOs
-+ * @data: per-instance data assigned by the driver
-  * @list: links gpio_chips together for traversal
-  * @request: optional hook for chip-specific activation, such as
-  *    enabling module power and clock; may sleep
-@@ -92,6 +93,7 @@ struct gpio_chip {
-       struct device           *dev;
-       struct device           *cdev;
-       struct module           *owner;
-+      void                    *data;
-       struct list_head        list;
-       int                     (*request)(struct gpio_chip *chip,
-@@ -166,7 +168,11 @@ extern const char *gpiochip_is_requested
-                       unsigned offset);
- /* add/remove chips */
--extern int gpiochip_add(struct gpio_chip *chip);
-+extern int gpiochip_add_data(struct gpio_chip *chip, void *data);
-+static inline int gpiochip_add(struct gpio_chip *chip)
-+{
-+      return gpiochip_add_data(chip, NULL);
-+}
- extern void gpiochip_remove(struct gpio_chip *chip);
- extern struct gpio_chip *gpiochip_find(void *data,
-                             int (*match)(struct gpio_chip *chip, void *data));
-@@ -175,6 +181,12 @@ extern struct gpio_chip *gpiochip_find(v
- int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
- void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
-+/* get driver data */
-+static inline void *gpiochip_get_data(struct gpio_chip *chip)
-+{
-+      return chip->data;
-+}
-+
- struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
- #ifdef CONFIG_GPIOLIB_IRQCHIP
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-31-gpio-generic-factor-into-gpio_chip-struct.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-31-gpio-generic-factor-into-gpio_chip-struct.patch
deleted file mode 100644 (file)
index b3c7168..0000000
+++ /dev/null
@@ -1,2586 +0,0 @@
-From 0f4630f3720e7e6e921bf525c8357fea7ef3dbab Mon Sep 17 00:00:00 2001
-From: Linus Walleij <linus.walleij@linaro.org>
-Date: Fri, 4 Dec 2015 14:02:58 +0100
-Subject: [PATCH] gpio: generic: factor into gpio_chip struct
-
-The separate struct bgpio_chip has been a pain to handle, both
-by being confusingly similar in name to struct gpio_chip and
-for being contained inside a struct so that struct gpio_chip
-is contained in a struct contained in a struct, making several
-steps of dereferencing necessary.
-
-Make things simpler: include the fields directly into
-<linux/gpio/driver.h>, #ifdef:ed for CONFIG_GENERIC_GPIO, and
-get rid of the <linux/basic_mmio_gpio.h> altogether. Prefix
-some of the member variables with bgpio_* and add proper
-kerneldoc while we're at it.
-
-Modify all users to handle the change and use a struct
-gpio_chip directly. And while we're at it: replace all
-container_of() dereferencing by gpiochip_get_data() and
-registering the gpio_chip with gpiochip_add_data().
-
-Cc: arm@kernel.org
-Cc: Alexander Shiyan <shc_work@mail.ru>
-Cc: Shawn Guo <shawnguo@kernel.org>
-Cc: Sascha Hauer <kernel@pengutronix.de>
-Cc: Kukjin Kim <kgene@kernel.org>
-Cc: Alexandre Courbot <gnurou@gmail.com>
-Cc: Brian Norris <computersforpeace@gmail.com>
-Cc: Florian Fainelli <f.fainelli@gmail.com>
-Cc: Sudeep Holla <sudeep.holla@arm.com>
-Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-Cc: Nicolas Pitre <nicolas.pitre@linaro.org>
-Cc: Olof Johansson <olof@lixom.net>
-Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
-Cc: Rabin Vincent <rabin@rab.in>
-Cc: linux-arm-kernel@lists.infradead.org
-Cc: linux-omap@vger.kernel.org
-Cc: linux-samsung-soc@vger.kernel.org
-Cc: bcm-kernel-feedback-list@broadcom.com
-Acked-by: Gregory Fong <gregory.0xf0@gmail.com>
-Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
-Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
-Acked-by: Tony Lindgren <tony@atomide.com>
-Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
-Acked-by: Lee Jones <lee.jones@linaro.org>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
----
- arch/arm/mach-clps711x/board-autcpu12.c |   2 +-
- arch/arm/mach-clps711x/board-p720t.c    |   2 +-
- arch/arm/mach-imx/mach-mx21ads.c        |   2 +-
- arch/arm/mach-omap1/board-ams-delta.c   |   2 +-
- arch/arm/mach-s3c64xx/mach-crag6410.c   |   2 +-
- drivers/gpio/gpio-74xx-mmio.c           |  37 ++--
- drivers/gpio/gpio-brcmstb.c             |  80 ++++-----
- drivers/gpio/gpio-clps711x.c            |  28 +--
- drivers/gpio/gpio-dwapb.c               |  92 +++++-----
- drivers/gpio/gpio-ep93xx.c              |  25 +--
- drivers/gpio/gpio-etraxfs.c             |  49 +++---
- drivers/gpio/gpio-ge.c                  |  24 +--
- drivers/gpio/gpio-generic.c             | 292 +++++++++++++++-----------------
- drivers/gpio/gpio-grgpio.c              |  73 ++++----
- drivers/gpio/gpio-moxart.c              |  29 ++--
- drivers/gpio/gpio-mxc.c                 |  27 ++-
- drivers/gpio/gpio-mxs.c                 |  33 ++--
- drivers/gpio/gpio-sodaville.c           |  13 +-
- drivers/gpio/gpio-xgene-sb.c            |  40 ++---
- drivers/mfd/vexpress-sysreg.c           |   8 +-
- include/linux/basic_mmio_gpio.h         |  80 ---------
- include/linux/gpio/driver.h             |  54 ++++++
- 22 files changed, 442 insertions(+), 552 deletions(-)
- delete mode 100644 include/linux/basic_mmio_gpio.h
-
---- a/arch/arm/mach-clps711x/board-autcpu12.c
-+++ b/arch/arm/mach-clps711x/board-autcpu12.c
-@@ -31,7 +31,7 @@
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/nand-gpio.h>
- #include <linux/platform_device.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <mach/hardware.h>
- #include <asm/sizes.h>
---- a/arch/arm/mach-clps711x/board-p720t.c
-+++ b/arch/arm/mach-clps711x/board-p720t.c
-@@ -28,7 +28,7 @@
- #include <linux/leds.h>
- #include <linux/sizes.h>
- #include <linux/backlight.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/platform_device.h>
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/nand-gpio.h>
---- a/arch/arm/mach-imx/mach-mx21ads.c
-+++ b/arch/arm/mach-imx/mach-mx21ads.c
-@@ -17,7 +17,7 @@
- #include <linux/platform_device.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/physmap.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/gpio.h>
- #include <linux/regulator/fixed.h>
- #include <linux/regulator/machine.h>
---- a/arch/arm/mach-omap1/board-ams-delta.c
-+++ b/arch/arm/mach-omap1/board-ams-delta.c
-@@ -11,7 +11,7 @@
-  * it under the terms of the GNU General Public License version 2 as
-  * published by the Free Software Foundation.
-  */
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/gpio.h>
- #include <linux/kernel.h>
- #include <linux/init.h>
---- a/arch/arm/mach-s3c64xx/mach-crag6410.c
-+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
-@@ -29,7 +29,7 @@
- #include <linux/pwm_backlight.h>
- #include <linux/dm9000.h>
- #include <linux/gpio_keys.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/spi/spi.h>
- #include <linux/platform_data/pca953x.h>
---- a/drivers/gpio/gpio-74xx-mmio.c
-+++ b/drivers/gpio/gpio-74xx-mmio.c
-@@ -10,10 +10,9 @@
-  */
- #include <linux/err.h>
--#include <linux/gpio.h>
- #include <linux/module.h>
- #include <linux/of_device.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/platform_device.h>
- #define MMIO_74XX_DIR_IN      (0 << 8)
-@@ -21,7 +20,7 @@
- #define MMIO_74XX_BIT_CNT(x)  ((x) & 0xff)
- struct mmio_74xx_gpio_priv {
--      struct bgpio_chip       bgc;
-+      struct gpio_chip        gc;
-       unsigned                flags;
- };
-@@ -78,30 +77,23 @@ static const struct of_device_id mmio_74
- };
- MODULE_DEVICE_TABLE(of, mmio_74xx_gpio_ids);
--static inline struct mmio_74xx_gpio_priv *to_74xx_gpio(struct gpio_chip *gc)
--{
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return container_of(bgc, struct mmio_74xx_gpio_priv, bgc);
--}
--
- static int mmio_74xx_get_direction(struct gpio_chip *gc, unsigned offset)
- {
--      struct mmio_74xx_gpio_priv *priv = to_74xx_gpio(gc);
-+      struct mmio_74xx_gpio_priv *priv = gpiochip_get_data(gc);
--      return (priv->flags & MMIO_74XX_DIR_OUT) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
-+      return !(priv->flags & MMIO_74XX_DIR_OUT);
- }
- static int mmio_74xx_dir_in(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct mmio_74xx_gpio_priv *priv = to_74xx_gpio(gc);
-+      struct mmio_74xx_gpio_priv *priv = gpiochip_get_data(gc);
-       return (priv->flags & MMIO_74XX_DIR_OUT) ? -ENOTSUPP : 0;
- }
- static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
- {
--      struct mmio_74xx_gpio_priv *priv = to_74xx_gpio(gc);
-+      struct mmio_74xx_gpio_priv *priv = gpiochip_get_data(gc);
-       if (priv->flags & MMIO_74XX_DIR_OUT) {
-               gc->set(gc, gpio, val);
-@@ -134,28 +126,29 @@ static int mmio_74xx_gpio_probe(struct p
-       priv->flags = (uintptr_t) of_id->data;
--      err = bgpio_init(&priv->bgc, &pdev->dev,
-+      err = bgpio_init(&priv->gc, &pdev->dev,
-                        DIV_ROUND_UP(MMIO_74XX_BIT_CNT(priv->flags), 8),
-                        dat, NULL, NULL, NULL, NULL, 0);
-       if (err)
-               return err;
--      priv->bgc.gc.direction_input = mmio_74xx_dir_in;
--      priv->bgc.gc.direction_output = mmio_74xx_dir_out;
--      priv->bgc.gc.get_direction = mmio_74xx_get_direction;
--      priv->bgc.gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags);
--      priv->bgc.gc.owner = THIS_MODULE;
-+      priv->gc.direction_input = mmio_74xx_dir_in;
-+      priv->gc.direction_output = mmio_74xx_dir_out;
-+      priv->gc.get_direction = mmio_74xx_get_direction;
-+      priv->gc.ngpio = MMIO_74XX_BIT_CNT(priv->flags);
-+      priv->gc.owner = THIS_MODULE;
-       platform_set_drvdata(pdev, priv);
--      return gpiochip_add(&priv->bgc.gc);
-+      return gpiochip_add_data(&priv->gc, priv);
- }
- static int mmio_74xx_gpio_remove(struct platform_device *pdev)
- {
-       struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev);
--      return bgpio_remove(&priv->bgc);
-+      gpiochip_remove(&priv->gc);
-+      return 0;
- }
- static struct platform_driver mmio_74xx_gpio_driver = {
---- a/drivers/gpio/gpio-brcmstb.c
-+++ b/drivers/gpio/gpio-brcmstb.c
-@@ -16,7 +16,6 @@
- #include <linux/of_device.h>
- #include <linux/of_irq.h>
- #include <linux/module.h>
--#include <linux/basic_mmio_gpio.h>
- #include <linux/irqdomain.h>
- #include <linux/irqchip/chained_irq.h>
- #include <linux/interrupt.h>
-@@ -35,7 +34,7 @@
- struct brcmstb_gpio_bank {
-       struct list_head node;
-       int id;
--      struct bgpio_chip bgc;
-+      struct gpio_chip gc;
-       struct brcmstb_gpio_priv *parent_priv;
-       u32 width;
-       struct irq_chip irq_chip;
-@@ -57,37 +56,30 @@ struct brcmstb_gpio_priv {
- /* assumes MAX_GPIO_PER_BANK is a multiple of 2 */
- #define GPIO_BIT(gpio)          ((gpio) & (MAX_GPIO_PER_BANK - 1))
--static inline struct brcmstb_gpio_bank *
--brcmstb_gpio_gc_to_bank(struct gpio_chip *gc)
--{
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      return container_of(bgc, struct brcmstb_gpio_bank, bgc);
--}
--
- static inline struct brcmstb_gpio_priv *
- brcmstb_gpio_gc_to_priv(struct gpio_chip *gc)
- {
--      struct brcmstb_gpio_bank *bank = brcmstb_gpio_gc_to_bank(gc);
-+      struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
-       return bank->parent_priv;
- }
- static void brcmstb_gpio_set_imask(struct brcmstb_gpio_bank *bank,
-               unsigned int offset, bool enable)
- {
--      struct bgpio_chip *bgc = &bank->bgc;
-+      struct gpio_chip *gc = &bank->gc;
-       struct brcmstb_gpio_priv *priv = bank->parent_priv;
--      u32 mask = bgc->pin2mask(bgc, offset);
-+      u32 mask = gc->pin2mask(gc, offset);
-       u32 imask;
-       unsigned long flags;
--      spin_lock_irqsave(&bgc->lock, flags);
--      imask = bgc->read_reg(priv->reg_base + GIO_MASK(bank->id));
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-+      imask = gc->read_reg(priv->reg_base + GIO_MASK(bank->id));
-       if (enable)
-               imask |= mask;
-       else
-               imask &= ~mask;
--      bgc->write_reg(priv->reg_base + GIO_MASK(bank->id), imask);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      gc->write_reg(priv->reg_base + GIO_MASK(bank->id), imask);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
- /* -------------------- IRQ chip functions -------------------- */
-@@ -95,7 +87,7 @@ static void brcmstb_gpio_set_imask(struc
- static void brcmstb_gpio_irq_mask(struct irq_data *d)
- {
-       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
--      struct brcmstb_gpio_bank *bank = brcmstb_gpio_gc_to_bank(gc);
-+      struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
-       brcmstb_gpio_set_imask(bank, d->hwirq, false);
- }
-@@ -103,7 +95,7 @@ static void brcmstb_gpio_irq_mask(struct
- static void brcmstb_gpio_irq_unmask(struct irq_data *d)
- {
-       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
--      struct brcmstb_gpio_bank *bank = brcmstb_gpio_gc_to_bank(gc);
-+      struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
-       brcmstb_gpio_set_imask(bank, d->hwirq, true);
- }
-@@ -111,7 +103,7 @@ static void brcmstb_gpio_irq_unmask(stru
- static int brcmstb_gpio_irq_set_type(struct irq_data *d, unsigned int type)
- {
-       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
--      struct brcmstb_gpio_bank *bank = brcmstb_gpio_gc_to_bank(gc);
-+      struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
-       struct brcmstb_gpio_priv *priv = bank->parent_priv;
-       u32 mask = BIT(d->hwirq);
-       u32 edge_insensitive, iedge_insensitive;
-@@ -149,23 +141,23 @@ static int brcmstb_gpio_irq_set_type(str
-               return -EINVAL;
-       }
--      spin_lock_irqsave(&bank->bgc.lock, flags);
-+      spin_lock_irqsave(&bank->gc.bgpio_lock, flags);
--      iedge_config = bank->bgc.read_reg(priv->reg_base +
-+      iedge_config = bank->gc.read_reg(priv->reg_base +
-                       GIO_EC(bank->id)) & ~mask;
--      iedge_insensitive = bank->bgc.read_reg(priv->reg_base +
-+      iedge_insensitive = bank->gc.read_reg(priv->reg_base +
-                       GIO_EI(bank->id)) & ~mask;
--      ilevel = bank->bgc.read_reg(priv->reg_base +
-+      ilevel = bank->gc.read_reg(priv->reg_base +
-                       GIO_LEVEL(bank->id)) & ~mask;
--      bank->bgc.write_reg(priv->reg_base + GIO_EC(bank->id),
-+      bank->gc.write_reg(priv->reg_base + GIO_EC(bank->id),
-                       iedge_config | edge_config);
--      bank->bgc.write_reg(priv->reg_base + GIO_EI(bank->id),
-+      bank->gc.write_reg(priv->reg_base + GIO_EI(bank->id),
-                       iedge_insensitive | edge_insensitive);
--      bank->bgc.write_reg(priv->reg_base + GIO_LEVEL(bank->id),
-+      bank->gc.write_reg(priv->reg_base + GIO_LEVEL(bank->id),
-                       ilevel | level);
--      spin_unlock_irqrestore(&bank->bgc.lock, flags);
-+      spin_unlock_irqrestore(&bank->gc.bgpio_lock, flags);
-       return 0;
- }
-@@ -210,29 +202,29 @@ static irqreturn_t brcmstb_gpio_wake_irq
- static void brcmstb_gpio_irq_bank_handler(struct brcmstb_gpio_bank *bank)
- {
-       struct brcmstb_gpio_priv *priv = bank->parent_priv;
--      struct irq_domain *irq_domain = bank->bgc.gc.irqdomain;
-+      struct irq_domain *irq_domain = bank->gc.irqdomain;
-       void __iomem *reg_base = priv->reg_base;
-       unsigned long status;
-       unsigned long flags;
--      spin_lock_irqsave(&bank->bgc.lock, flags);
--      while ((status = bank->bgc.read_reg(reg_base + GIO_STAT(bank->id)) &
--                       bank->bgc.read_reg(reg_base + GIO_MASK(bank->id)))) {
-+      spin_lock_irqsave(&bank->gc.bgpio_lock, flags);
-+      while ((status = bank->gc.read_reg(reg_base + GIO_STAT(bank->id)) &
-+                       bank->gc.read_reg(reg_base + GIO_MASK(bank->id)))) {
-               int bit;
-               for_each_set_bit(bit, &status, 32) {
--                      u32 stat = bank->bgc.read_reg(reg_base +
-+                      u32 stat = bank->gc.read_reg(reg_base +
-                                                     GIO_STAT(bank->id));
-                       if (bit >= bank->width)
-                               dev_warn(&priv->pdev->dev,
-                                        "IRQ for invalid GPIO (bank=%d, offset=%d)\n",
-                                        bank->id, bit);
--                      bank->bgc.write_reg(reg_base + GIO_STAT(bank->id),
-+                      bank->gc.write_reg(reg_base + GIO_STAT(bank->id),
-                                           stat | BIT(bit));
-                       generic_handle_irq(irq_find_mapping(irq_domain, bit));
-               }
-       }
--      spin_unlock_irqrestore(&bank->bgc.lock, flags);
-+      spin_unlock_irqrestore(&bank->gc.bgpio_lock, flags);
- }
- /* Each UPG GIO block has one IRQ for all banks */
-@@ -303,9 +295,7 @@ static int brcmstb_gpio_remove(struct pl
-        */
-       list_for_each(pos, &priv->bank_list) {
-               bank = list_entry(pos, struct brcmstb_gpio_bank, node);
--              ret = bgpio_remove(&bank->bgc);
--              if (ret)
--                      dev_err(&pdev->dev, "gpiochip_remove fail in cleanup\n");
-+              gpiochip_remove(&bank->gc);
-       }
-       if (priv->reboot_notifier.notifier_call) {
-               ret = unregister_reboot_notifier(&priv->reboot_notifier);
-@@ -320,7 +310,7 @@ static int brcmstb_gpio_of_xlate(struct
-               const struct of_phandle_args *gpiospec, u32 *flags)
- {
-       struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc);
--      struct brcmstb_gpio_bank *bank = brcmstb_gpio_gc_to_bank(gc);
-+      struct brcmstb_gpio_bank *bank = gpiochip_get_data(gc);
-       int offset;
-       if (gc->of_gpio_n_cells != 2) {
-@@ -398,9 +388,9 @@ static int brcmstb_gpio_irq_setup(struct
-       if (priv->can_wake)
-               bank->irq_chip.irq_set_wake = brcmstb_gpio_irq_set_wake;
--      gpiochip_irqchip_add(&bank->bgc.gc, &bank->irq_chip, 0,
-+      gpiochip_irqchip_add(&bank->gc, &bank->irq_chip, 0,
-                       handle_simple_irq, IRQ_TYPE_NONE);
--      gpiochip_set_chained_irqchip(&bank->bgc.gc, &bank->irq_chip,
-+      gpiochip_set_chained_irqchip(&bank->gc, &bank->irq_chip,
-                       priv->parent_irq, brcmstb_gpio_irq_handler);
-       return 0;
-@@ -451,7 +441,6 @@ static int brcmstb_gpio_probe(struct pla
-       of_property_for_each_u32(np, "brcm,gpio-bank-widths", prop, p,
-                       bank_width) {
-               struct brcmstb_gpio_bank *bank;
--              struct bgpio_chip *bgc;
-               struct gpio_chip *gc;
-               bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL);
-@@ -473,8 +462,8 @@ static int brcmstb_gpio_probe(struct pla
-                * Regs are 4 bytes wide, have data reg, no set/clear regs,
-                * and direction bits have 0 = output and 1 = input
-                */
--              bgc = &bank->bgc;
--              err = bgpio_init(bgc, dev, 4,
-+              gc = &bank->gc;
-+              err = bgpio_init(gc, dev, 4,
-                               reg_base + GIO_DATA(bank->id),
-                               NULL, NULL, NULL,
-                               reg_base + GIO_IODIR(bank->id), 0);
-@@ -483,7 +472,6 @@ static int brcmstb_gpio_probe(struct pla
-                       goto fail;
-               }
--              gc = &bgc->gc;
-               gc->of_node = np;
-               gc->owner = THIS_MODULE;
-               gc->label = np->full_name;
-@@ -497,9 +485,9 @@ static int brcmstb_gpio_probe(struct pla
-                * Mask all interrupts by default, since wakeup interrupts may
-                * be retained from S5 cold boot
-                */
--              bank->bgc.write_reg(reg_base + GIO_MASK(bank->id), 0);
-+              gc->write_reg(reg_base + GIO_MASK(bank->id), 0);
--              err = gpiochip_add(gc);
-+              err = gpiochip_add_data(gc, bank);
-               if (err) {
-                       dev_err(dev, "Could not add gpiochip for bank %d\n",
-                                       bank->id);
---- a/drivers/gpio/gpio-clps711x.c
-+++ b/drivers/gpio/gpio-clps711x.c
-@@ -10,24 +10,23 @@
-  */
- #include <linux/err.h>
--#include <linux/gpio.h>
- #include <linux/module.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/platform_device.h>
- static int clps711x_gpio_probe(struct platform_device *pdev)
- {
-       struct device_node *np = pdev->dev.of_node;
-       void __iomem *dat, *dir;
--      struct bgpio_chip *bgc;
-+      struct gpio_chip *gc;
-       struct resource *res;
-       int err, id = np ? of_alias_get_id(np, "gpio") : pdev->id;
-       if ((id < 0) || (id > 4))
-               return -ENODEV;
--      bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL);
--      if (!bgc)
-+      gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL);
-+      if (!gc)
-               return -ENOMEM;
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-@@ -43,11 +42,11 @@ static int clps711x_gpio_probe(struct pl
-       switch (id) {
-       case 3:
-               /* PORTD is inverted logic for direction register */
--              err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL,
-+              err = bgpio_init(gc, &pdev->dev, 1, dat, NULL, NULL,
-                                NULL, dir, 0);
-               break;
-       default:
--              err = bgpio_init(bgc, &pdev->dev, 1, dat, NULL, NULL,
-+              err = bgpio_init(gc, &pdev->dev, 1, dat, NULL, NULL,
-                                dir, NULL, 0);
-               break;
-       }
-@@ -58,24 +57,25 @@ static int clps711x_gpio_probe(struct pl
-       switch (id) {
-       case 4:
-               /* PORTE is 3 lines only */
--              bgc->gc.ngpio = 3;
-+              gc->ngpio = 3;
-               break;
-       default:
-               break;
-       }
--      bgc->gc.base = id * 8;
--      bgc->gc.owner = THIS_MODULE;
--      platform_set_drvdata(pdev, bgc);
-+      gc->base = id * 8;
-+      gc->owner = THIS_MODULE;
-+      platform_set_drvdata(pdev, gc);
--      return gpiochip_add(&bgc->gc);
-+      return gpiochip_add_data(gc, NULL);
- }
- static int clps711x_gpio_remove(struct platform_device *pdev)
- {
--      struct bgpio_chip *bgc = platform_get_drvdata(pdev);
-+      struct gpio_chip *gc = platform_get_drvdata(pdev);
--      return bgpio_remove(bgc);
-+      gpiochip_remove(gc);
-+      return 0;
- }
- static const struct of_device_id __maybe_unused clps711x_gpio_ids[] = {
---- a/drivers/gpio/gpio-dwapb.c
-+++ b/drivers/gpio/gpio-dwapb.c
-@@ -7,7 +7,9 @@
-  *
-  * All enquiries to support@picochip.com
-  */
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
-+/* FIXME: for gpio_get_value(), replace this with direct register read */
-+#include <linux/gpio.h>
- #include <linux/err.h>
- #include <linux/init.h>
- #include <linux/interrupt.h>
-@@ -66,7 +68,7 @@ struct dwapb_context {
- #endif
- struct dwapb_gpio_port {
--      struct bgpio_chip       bgc;
-+      struct gpio_chip        gc;
-       bool                    is_registered;
-       struct dwapb_gpio       *gpio;
- #ifdef CONFIG_PM_SLEEP
-@@ -83,33 +85,26 @@ struct dwapb_gpio {
-       struct irq_domain       *domain;
- };
--static inline struct dwapb_gpio_port *
--to_dwapb_gpio_port(struct bgpio_chip *bgc)
--{
--      return container_of(bgc, struct dwapb_gpio_port, bgc);
--}
--
- static inline u32 dwapb_read(struct dwapb_gpio *gpio, unsigned int offset)
- {
--      struct bgpio_chip *bgc  = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc    = &gpio->ports[0].gc;
-       void __iomem *reg_base  = gpio->regs;
--      return bgc->read_reg(reg_base + offset);
-+      return gc->read_reg(reg_base + offset);
- }
- static inline void dwapb_write(struct dwapb_gpio *gpio, unsigned int offset,
-                              u32 val)
- {
--      struct bgpio_chip *bgc  = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc    = &gpio->ports[0].gc;
-       void __iomem *reg_base  = gpio->regs;
--      bgc->write_reg(reg_base + offset, val);
-+      gc->write_reg(reg_base + offset, val);
- }
- static int dwapb_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      struct dwapb_gpio_port *port = to_dwapb_gpio_port(bgc);
-+      struct dwapb_gpio_port *port = gpiochip_get_data(gc);
-       struct dwapb_gpio *gpio = port->gpio;
-       return irq_find_mapping(gpio->domain, offset);
-@@ -119,7 +114,7 @@ static void dwapb_toggle_trigger(struct
- {
-       u32 v = dwapb_read(gpio, GPIO_INT_POLARITY);
--      if (gpio_get_value(gpio->ports[0].bgc.gc.base + offs))
-+      if (gpio_get_value(gpio->ports[0].gc.base + offs))
-               v &= ~BIT(offs);
-       else
-               v |= BIT(offs);
-@@ -162,39 +157,39 @@ static void dwapb_irq_enable(struct irq_
- {
-       struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
-       struct dwapb_gpio *gpio = igc->private;
--      struct bgpio_chip *bgc = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc = &gpio->ports[0].gc;
-       unsigned long flags;
-       u32 val;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       val = dwapb_read(gpio, GPIO_INTEN);
-       val |= BIT(d->hwirq);
-       dwapb_write(gpio, GPIO_INTEN, val);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
- static void dwapb_irq_disable(struct irq_data *d)
- {
-       struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
-       struct dwapb_gpio *gpio = igc->private;
--      struct bgpio_chip *bgc = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc = &gpio->ports[0].gc;
-       unsigned long flags;
-       u32 val;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       val = dwapb_read(gpio, GPIO_INTEN);
-       val &= ~BIT(d->hwirq);
-       dwapb_write(gpio, GPIO_INTEN, val);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
- static int dwapb_irq_reqres(struct irq_data *d)
- {
-       struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
-       struct dwapb_gpio *gpio = igc->private;
--      struct bgpio_chip *bgc = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc = &gpio->ports[0].gc;
--      if (gpiochip_lock_as_irq(&bgc->gc, irqd_to_hwirq(d))) {
-+      if (gpiochip_lock_as_irq(gc, irqd_to_hwirq(d))) {
-               dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n",
-                       irqd_to_hwirq(d));
-               return -EINVAL;
-@@ -206,16 +201,16 @@ static void dwapb_irq_relres(struct irq_
- {
-       struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
-       struct dwapb_gpio *gpio = igc->private;
--      struct bgpio_chip *bgc = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc = &gpio->ports[0].gc;
--      gpiochip_unlock_as_irq(&bgc->gc, irqd_to_hwirq(d));
-+      gpiochip_unlock_as_irq(gc, irqd_to_hwirq(d));
- }
- static int dwapb_irq_set_type(struct irq_data *d, u32 type)
- {
-       struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
-       struct dwapb_gpio *gpio = igc->private;
--      struct bgpio_chip *bgc = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc = &gpio->ports[0].gc;
-       int bit = d->hwirq;
-       unsigned long level, polarity, flags;
-@@ -223,7 +218,7 @@ static int dwapb_irq_set_type(struct irq
-                    IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
-               return -EINVAL;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       level = dwapb_read(gpio, GPIO_INTTYPE_LEVEL);
-       polarity = dwapb_read(gpio, GPIO_INT_POLARITY);
-@@ -254,7 +249,7 @@ static int dwapb_irq_set_type(struct irq
-       dwapb_write(gpio, GPIO_INTTYPE_LEVEL, level);
-       dwapb_write(gpio, GPIO_INT_POLARITY, polarity);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
-@@ -262,13 +257,12 @@ static int dwapb_irq_set_type(struct irq
- static int dwapb_gpio_set_debounce(struct gpio_chip *gc,
-                                  unsigned offset, unsigned debounce)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      struct dwapb_gpio_port *port = to_dwapb_gpio_port(bgc);
-+      struct dwapb_gpio_port *port = gpiochip_get_data(gc);
-       struct dwapb_gpio *gpio = port->gpio;
-       unsigned long flags, val_deb;
--      unsigned long mask = bgc->pin2mask(bgc, offset);
-+      unsigned long mask = gc->pin2mask(gc, offset);
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       val_deb = dwapb_read(gpio, GPIO_PORTA_DEBOUNCE);
-       if (debounce)
-@@ -276,7 +270,7 @@ static int dwapb_gpio_set_debounce(struc
-       else
-               dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb & ~mask);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
-@@ -295,7 +289,7 @@ static void dwapb_configure_irqs(struct
-                                struct dwapb_gpio_port *port,
-                                struct dwapb_port_property *pp)
- {
--      struct gpio_chip *gc = &port->bgc.gc;
-+      struct gpio_chip *gc = &port->gc;
-       struct device_node *node = pp->node;
-       struct irq_chip_generic *irq_gc = NULL;
-       unsigned int hwirq, ngpio = gc->ngpio;
-@@ -369,13 +363,13 @@ static void dwapb_configure_irqs(struct
-       for (hwirq = 0 ; hwirq < ngpio ; hwirq++)
-               irq_create_mapping(gpio->domain, hwirq);
--      port->bgc.gc.to_irq = dwapb_gpio_to_irq;
-+      port->gc.to_irq = dwapb_gpio_to_irq;
- }
- static void dwapb_irq_teardown(struct dwapb_gpio *gpio)
- {
-       struct dwapb_gpio_port *port = &gpio->ports[0];
--      struct gpio_chip *gc = &port->bgc.gc;
-+      struct gpio_chip *gc = &port->gc;
-       unsigned int ngpio = gc->ngpio;
-       irq_hw_number_t hwirq;
-@@ -412,7 +406,7 @@ static int dwapb_gpio_add_port(struct dw
-       dirout = gpio->regs + GPIO_SWPORTA_DDR +
-               (pp->idx * GPIO_SWPORT_DDR_SIZE);
--      err = bgpio_init(&port->bgc, gpio->dev, 4, dat, set, NULL, dirout,
-+      err = bgpio_init(&port->gc, gpio->dev, 4, dat, set, NULL, dirout,
-                        NULL, false);
-       if (err) {
-               dev_err(gpio->dev, "failed to init gpio chip for %s\n",
-@@ -421,19 +415,19 @@ static int dwapb_gpio_add_port(struct dw
-       }
- #ifdef CONFIG_OF_GPIO
--      port->bgc.gc.of_node = pp->node;
-+      port->gc.of_node = pp->node;
- #endif
--      port->bgc.gc.ngpio = pp->ngpio;
--      port->bgc.gc.base = pp->gpio_base;
-+      port->gc.ngpio = pp->ngpio;
-+      port->gc.base = pp->gpio_base;
-       /* Only port A support debounce */
-       if (pp->idx == 0)
--              port->bgc.gc.set_debounce = dwapb_gpio_set_debounce;
-+              port->gc.set_debounce = dwapb_gpio_set_debounce;
-       if (pp->irq)
-               dwapb_configure_irqs(gpio, port, pp);
--      err = gpiochip_add(&port->bgc.gc);
-+      err = gpiochip_add_data(&port->gc, port);
-       if (err)
-               dev_err(gpio->dev, "failed to register gpiochip for %s\n",
-                       pp->name);
-@@ -449,7 +443,7 @@ static void dwapb_gpio_unregister(struct
-       for (m = 0; m < gpio->nr_ports; ++m)
-               if (gpio->ports[m].is_registered)
--                      gpiochip_remove(&gpio->ports[m].bgc.gc);
-+                      gpiochip_remove(&gpio->ports[m].gc);
- }
- static struct dwapb_platform_data *
-@@ -591,11 +585,11 @@ static int dwapb_gpio_suspend(struct dev
- {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct dwapb_gpio *gpio = platform_get_drvdata(pdev);
--      struct bgpio_chip *bgc  = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc    = &gpio->ports[0].gc;
-       unsigned long flags;
-       int i;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       for (i = 0; i < gpio->nr_ports; i++) {
-               unsigned int offset;
-               unsigned int idx = gpio->ports[i].idx;
-@@ -624,7 +618,7 @@ static int dwapb_gpio_suspend(struct dev
-                       dwapb_write(gpio, GPIO_INTMASK, 0xffffffff);
-               }
-       }
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
-@@ -633,11 +627,11 @@ static int dwapb_gpio_resume(struct devi
- {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct dwapb_gpio *gpio = platform_get_drvdata(pdev);
--      struct bgpio_chip *bgc  = &gpio->ports[0].bgc;
-+      struct gpio_chip *gc    = &gpio->ports[0].gc;
-       unsigned long flags;
-       int i;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       for (i = 0; i < gpio->nr_ports; i++) {
-               unsigned int offset;
-               unsigned int idx = gpio->ports[i].idx;
-@@ -666,7 +660,7 @@ static int dwapb_gpio_resume(struct devi
-                       dwapb_write(gpio, GPIO_PORTA_EOI, 0xffffffff);
-               }
-       }
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
---- a/drivers/gpio/gpio-ep93xx.c
-+++ b/drivers/gpio/gpio-ep93xx.c
-@@ -16,10 +16,11 @@
- #include <linux/module.h>
- #include <linux/platform_device.h>
- #include <linux/io.h>
--#include <linux/gpio.h>
- #include <linux/irq.h>
- #include <linux/slab.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
-+/* FIXME: this is here for gpio_to_irq() - get rid of this! */
-+#include <linux/gpio.h>
- #include <mach/hardware.h>
- #include <mach/gpio-ep93xx.h>
-@@ -28,7 +29,7 @@
- struct ep93xx_gpio {
-       void __iomem            *mmio_base;
--      struct bgpio_chip       bgc[8];
-+      struct gpio_chip        gc[8];
- };
- /*************************************************************************
-@@ -319,26 +320,26 @@ static int ep93xx_gpio_to_irq(struct gpi
-       return 64 + gpio;
- }
--static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev,
-+static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,
-       void __iomem *mmio_base, struct ep93xx_gpio_bank *bank)
- {
-       void __iomem *data = mmio_base + bank->data;
-       void __iomem *dir =  mmio_base + bank->dir;
-       int err;
--      err = bgpio_init(bgc, dev, 1, data, NULL, NULL, dir, NULL, 0);
-+      err = bgpio_init(gc, dev, 1, data, NULL, NULL, dir, NULL, 0);
-       if (err)
-               return err;
--      bgc->gc.label = bank->label;
--      bgc->gc.base = bank->base;
-+      gc->label = bank->label;
-+      gc->base = bank->base;
-       if (bank->has_debounce) {
--              bgc->gc.set_debounce = ep93xx_gpio_set_debounce;
--              bgc->gc.to_irq = ep93xx_gpio_to_irq;
-+              gc->set_debounce = ep93xx_gpio_set_debounce;
-+              gc->to_irq = ep93xx_gpio_to_irq;
-       }
--      return gpiochip_add(&bgc->gc);
-+      return gpiochip_add_data(gc, NULL);
- }
- static int ep93xx_gpio_probe(struct platform_device *pdev)
-@@ -358,10 +359,10 @@ static int ep93xx_gpio_probe(struct plat
-               return PTR_ERR(ep93xx_gpio->mmio_base);
-       for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) {
--              struct bgpio_chip *bgc = &ep93xx_gpio->bgc[i];
-+              struct gpio_chip *gc = &ep93xx_gpio->gc[i];
-               struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];
--              if (ep93xx_gpio_add_bank(bgc, &pdev->dev,
-+              if (ep93xx_gpio_add_bank(gc, &pdev->dev,
-                                        ep93xx_gpio->mmio_base, bank))
-                       dev_warn(&pdev->dev, "Unable to add gpio bank %s\n",
-                               bank->label);
---- a/drivers/gpio/gpio-etraxfs.c
-+++ b/drivers/gpio/gpio-etraxfs.c
-@@ -1,12 +1,10 @@
- #include <linux/kernel.h>
- #include <linux/init.h>
--#include <linux/gpio.h>
- #include <linux/gpio/driver.h>
- #include <linux/of_gpio.h>
- #include <linux/io.h>
- #include <linux/interrupt.h>
- #include <linux/platform_device.h>
--#include <linux/basic_mmio_gpio.h>
- #define ETRAX_FS_rw_pa_dout   0
- #define ETRAX_FS_r_pa_din     4
-@@ -67,7 +65,7 @@ struct etraxfs_gpio_block {
- };
- struct etraxfs_gpio_chip {
--      struct bgpio_chip bgc;
-+      struct gpio_chip gc;
-       struct etraxfs_gpio_block *block;
- };
-@@ -176,11 +174,6 @@ static const struct etraxfs_gpio_info et
-       .rw_intr_pins   = ARTPEC3_rw_intr_pins,
- };
--static struct etraxfs_gpio_chip *to_etraxfs(struct gpio_chip *gc)
--{
--      return container_of(gc, struct etraxfs_gpio_chip, bgc.gc);
--}
--
- static unsigned int etraxfs_gpio_chip_to_port(struct gpio_chip *gc)
- {
-       return gc->label[0] - 'A';
-@@ -220,13 +213,13 @@ static unsigned int etraxfs_gpio_to_grou
- static unsigned int etraxfs_gpio_to_group_pin(struct etraxfs_gpio_chip *chip,
-                                             unsigned int gpio)
- {
--      return 4 * etraxfs_gpio_chip_to_port(&chip->bgc.gc) + gpio / 8;
-+      return 4 * etraxfs_gpio_chip_to_port(&chip->gc) + gpio / 8;
- }
- static void etraxfs_gpio_irq_ack(struct irq_data *d)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-@@ -236,7 +229,7 @@ static void etraxfs_gpio_irq_ack(struct
- static void etraxfs_gpio_irq_mask(struct irq_data *d)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-@@ -249,7 +242,7 @@ static void etraxfs_gpio_irq_mask(struct
- static void etraxfs_gpio_irq_unmask(struct irq_data *d)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-@@ -262,7 +255,7 @@ static void etraxfs_gpio_irq_unmask(stru
- static int etraxfs_gpio_irq_set_type(struct irq_data *d, u32 type)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-       u32 cfg;
-@@ -299,7 +292,7 @@ static int etraxfs_gpio_irq_set_type(str
- static int etraxfs_gpio_irq_request_resources(struct irq_data *d)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-       int ret = -EBUSY;
-@@ -308,7 +301,7 @@ static int etraxfs_gpio_irq_request_reso
-       if (block->group[grpirq])
-               goto out;
--      ret = gpiochip_lock_as_irq(&chip->bgc.gc, d->hwirq);
-+      ret = gpiochip_lock_as_irq(&chip->gc, d->hwirq);
-       if (ret)
-               goto out;
-@@ -330,13 +323,13 @@ out:
- static void etraxfs_gpio_irq_release_resources(struct irq_data *d)
- {
-       struct etraxfs_gpio_chip *chip =
--              to_etraxfs(irq_data_get_irq_chip_data(d));
-+              gpiochip_get_data(irq_data_get_irq_chip_data(d));
-       struct etraxfs_gpio_block *block = chip->block;
-       unsigned int grpirq = etraxfs_gpio_to_group_irq(d->hwirq);
-       spin_lock(&block->lock);
-       block->group[grpirq] = 0;
--      gpiochip_unlock_as_irq(&chip->bgc.gc, d->hwirq);
-+      gpiochip_unlock_as_irq(&chip->gc, d->hwirq);
-       spin_unlock(&block->lock);
- }
-@@ -419,7 +412,7 @@ static int etraxfs_gpio_probe(struct pla
-       for (i = 0; i < info->num_ports; i++) {
-               struct etraxfs_gpio_chip *chip = &chips[i];
--              struct bgpio_chip *bgc = &chip->bgc;
-+              struct gpio_chip *gc = &chip->gc;
-               const struct etraxfs_gpio_port *port = &info->ports[i];
-               unsigned long flags = BGPIOF_READ_OUTPUT_REG_SET;
-               void __iomem *dat = regs + port->din;
-@@ -433,7 +426,7 @@ static int etraxfs_gpio_probe(struct pla
-                       flags = BGPIOF_NO_OUTPUT;
-               }
--              ret = bgpio_init(bgc, dev, 4,
-+              ret = bgpio_init(gc, dev, 4,
-                                dat, set, NULL, dirout, NULL,
-                                flags);
-               if (ret) {
-@@ -442,28 +435,28 @@ static int etraxfs_gpio_probe(struct pla
-                       continue;
-               }
--              bgc->gc.ngpio = port->ngpio;
--              bgc->gc.label = port->label;
-+              gc->ngpio = port->ngpio;
-+              gc->label = port->label;
--              bgc->gc.of_node = dev->of_node;
--              bgc->gc.of_gpio_n_cells = 3;
--              bgc->gc.of_xlate = etraxfs_gpio_of_xlate;
-+              gc->of_node = dev->of_node;
-+              gc->of_gpio_n_cells = 3;
-+              gc->of_xlate = etraxfs_gpio_of_xlate;
--              ret = gpiochip_add(&bgc->gc);
-+              ret = gpiochip_add_data(gc, chip);
-               if (ret) {
-                       dev_err(dev, "Unable to register port %s\n",
--                              bgc->gc.label);
-+                              gc->label);
-                       continue;
-               }
-               if (i > 0 && !allportsirq)
-                       continue;
--              ret = gpiochip_irqchip_add(&bgc->gc, &etraxfs_gpio_irq_chip, 0,
-+              ret = gpiochip_irqchip_add(gc, &etraxfs_gpio_irq_chip, 0,
-                                          handle_level_irq, IRQ_TYPE_NONE);
-               if (ret) {
-                       dev_err(dev, "Unable to add irqchip to port %s\n",
--                              bgc->gc.label);
-+                              gc->label);
-               }
-       }
---- a/drivers/gpio/gpio-ge.c
-+++ b/drivers/gpio/gpio-ge.c
-@@ -24,7 +24,7 @@
- #include <linux/of_gpio.h>
- #include <linux/of_address.h>
- #include <linux/module.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #define GEF_GPIO_DIRECT               0x00
- #define GEF_GPIO_IN           0x04
-@@ -55,19 +55,19 @@ static int __init gef_gpio_probe(struct
- {
-       const struct of_device_id *of_id =
-               of_match_device(gef_gpio_ids, &pdev->dev);
--      struct bgpio_chip *bgc;
-+      struct gpio_chip *gc;
-       void __iomem *regs;
-       int ret;
--      bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL);
--      if (!bgc)
-+      gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL);
-+      if (!gc)
-               return -ENOMEM;
-       regs = of_iomap(pdev->dev.of_node, 0);
-       if (!regs)
-               return -ENOMEM;
--      ret = bgpio_init(bgc, &pdev->dev, 4, regs + GEF_GPIO_IN,
-+      ret = bgpio_init(gc, &pdev->dev, 4, regs + GEF_GPIO_IN,
-                        regs + GEF_GPIO_OUT, NULL, NULL,
-                        regs + GEF_GPIO_DIRECT, BGPIOF_BIG_ENDIAN_BYTE_ORDER);
-       if (ret) {
-@@ -76,20 +76,20 @@ static int __init gef_gpio_probe(struct
-       }
-       /* Setup pointers to chip functions */
--      bgc->gc.label = devm_kstrdup(&pdev->dev, pdev->dev.of_node->full_name,
-+      gc->label = devm_kstrdup(&pdev->dev, pdev->dev.of_node->full_name,
-                                    GFP_KERNEL);
--      if (!bgc->gc.label) {
-+      if (!gc->label) {
-               ret = -ENOMEM;
-               goto err0;
-       }
--      bgc->gc.base = -1;
--      bgc->gc.ngpio = (u16)(uintptr_t)of_id->data;
--      bgc->gc.of_gpio_n_cells = 2;
--      bgc->gc.of_node = pdev->dev.of_node;
-+      gc->base = -1;
-+      gc->ngpio = (u16)(uintptr_t)of_id->data;
-+      gc->of_gpio_n_cells = 2;
-+      gc->of_node = pdev->dev.of_node;
-       /* This function adds a memory mapped GPIO chip */
--      ret = gpiochip_add(&bgc->gc);
-+      ret = gpiochip_add_data(gc, NULL);
-       if (ret)
-               goto err0;
---- a/drivers/gpio/gpio-generic.c
-+++ b/drivers/gpio/gpio-generic.c
-@@ -56,11 +56,10 @@ o        `                     ~~~~\___/
- #include <linux/log2.h>
- #include <linux/ioport.h>
- #include <linux/io.h>
--#include <linux/gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/slab.h>
- #include <linux/platform_device.h>
- #include <linux/mod_devicetable.h>
--#include <linux/basic_mmio_gpio.h>
- static void bgpio_write8(void __iomem *reg, unsigned long data)
- {
-@@ -124,33 +123,30 @@ static unsigned long bgpio_read32be(void
-       return ioread32be(reg);
- }
--static unsigned long bgpio_pin2mask(struct bgpio_chip *bgc, unsigned int pin)
-+static unsigned long bgpio_pin2mask(struct gpio_chip *gc, unsigned int pin)
- {
-       return 1 << pin;
- }
--static unsigned long bgpio_pin2mask_be(struct bgpio_chip *bgc,
-+static unsigned long bgpio_pin2mask_be(struct gpio_chip *gc,
-                                      unsigned int pin)
- {
--      return 1 << (bgc->bits - 1 - pin);
-+      return 1 << (gc->bgpio_bits - 1 - pin);
- }
- static int bgpio_get_set(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      unsigned long pinmask = bgc->pin2mask(bgc, gpio);
-+      unsigned long pinmask = gc->pin2mask(gc, gpio);
--      if (bgc->dir & pinmask)
--              return !!(bgc->read_reg(bgc->reg_set) & pinmask);
-+      if (gc->bgpio_dir & pinmask)
-+              return !!(gc->read_reg(gc->reg_set) & pinmask);
-       else
--              return !!(bgc->read_reg(bgc->reg_dat) & pinmask);
-+              return !!(gc->read_reg(gc->reg_dat) & pinmask);
- }
- static int bgpio_get(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return !!(bgc->read_reg(bgc->reg_dat) & bgc->pin2mask(bgc, gpio));
-+      return !!(gc->read_reg(gc->reg_dat) & gc->pin2mask(gc, gpio));
- }
- static void bgpio_set_none(struct gpio_chip *gc, unsigned int gpio, int val)
-@@ -159,53 +155,50 @@ static void bgpio_set_none(struct gpio_c
- static void bgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      unsigned long mask = bgc->pin2mask(bgc, gpio);
-+      unsigned long mask = gc->pin2mask(gc, gpio);
-       unsigned long flags;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       if (val)
--              bgc->data |= mask;
-+              gc->bgpio_data |= mask;
-       else
--              bgc->data &= ~mask;
-+              gc->bgpio_data &= ~mask;
--      bgc->write_reg(bgc->reg_dat, bgc->data);
-+      gc->write_reg(gc->reg_dat, gc->bgpio_data);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
- static void bgpio_set_with_clear(struct gpio_chip *gc, unsigned int gpio,
-                                int val)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      unsigned long mask = bgc->pin2mask(bgc, gpio);
-+      unsigned long mask = gc->pin2mask(gc, gpio);
-       if (val)
--              bgc->write_reg(bgc->reg_set, mask);
-+              gc->write_reg(gc->reg_set, mask);
-       else
--              bgc->write_reg(bgc->reg_clr, mask);
-+              gc->write_reg(gc->reg_clr, mask);
- }
- static void bgpio_set_set(struct gpio_chip *gc, unsigned int gpio, int val)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      unsigned long mask = bgc->pin2mask(bgc, gpio);
-+      unsigned long mask = gc->pin2mask(gc, gpio);
-       unsigned long flags;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
-       if (val)
--              bgc->data |= mask;
-+              gc->bgpio_data |= mask;
-       else
--              bgc->data &= ~mask;
-+              gc->bgpio_data &= ~mask;
--      bgc->write_reg(bgc->reg_set, bgc->data);
-+      gc->write_reg(gc->reg_set, gc->bgpio_data);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
--static void bgpio_multiple_get_masks(struct bgpio_chip *bgc,
-+static void bgpio_multiple_get_masks(struct gpio_chip *gc,
-                                    unsigned long *mask, unsigned long *bits,
-                                    unsigned long *set_mask,
-                                    unsigned long *clear_mask)
-@@ -215,19 +208,19 @@ static void bgpio_multiple_get_masks(str
-       *set_mask = 0;
-       *clear_mask = 0;
--      for (i = 0; i < bgc->bits; i++) {
-+      for (i = 0; i < gc->bgpio_bits; i++) {
-               if (*mask == 0)
-                       break;
-               if (__test_and_clear_bit(i, mask)) {
-                       if (test_bit(i, bits))
--                              *set_mask |= bgc->pin2mask(bgc, i);
-+                              *set_mask |= gc->pin2mask(gc, i);
-                       else
--                              *clear_mask |= bgc->pin2mask(bgc, i);
-+                              *clear_mask |= gc->pin2mask(gc, i);
-               }
-       }
- }
--static void bgpio_set_multiple_single_reg(struct bgpio_chip *bgc,
-+static void bgpio_set_multiple_single_reg(struct gpio_chip *gc,
-                                         unsigned long *mask,
-                                         unsigned long *bits,
-                                         void __iomem *reg)
-@@ -235,47 +228,42 @@ static void bgpio_set_multiple_single_re
-       unsigned long flags;
-       unsigned long set_mask, clear_mask;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
--      bgpio_multiple_get_masks(bgc, mask, bits, &set_mask, &clear_mask);
-+      bgpio_multiple_get_masks(gc, mask, bits, &set_mask, &clear_mask);
--      bgc->data |= set_mask;
--      bgc->data &= ~clear_mask;
-+      gc->bgpio_data |= set_mask;
-+      gc->bgpio_data &= ~clear_mask;
--      bgc->write_reg(reg, bgc->data);
-+      gc->write_reg(reg, gc->bgpio_data);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
- }
- static void bgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
-                              unsigned long *bits)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      bgpio_set_multiple_single_reg(bgc, mask, bits, bgc->reg_dat);
-+      bgpio_set_multiple_single_reg(gc, mask, bits, gc->reg_dat);
- }
- static void bgpio_set_multiple_set(struct gpio_chip *gc, unsigned long *mask,
-                                  unsigned long *bits)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      bgpio_set_multiple_single_reg(bgc, mask, bits, bgc->reg_set);
-+      bgpio_set_multiple_single_reg(gc, mask, bits, gc->reg_set);
- }
- static void bgpio_set_multiple_with_clear(struct gpio_chip *gc,
-                                         unsigned long *mask,
-                                         unsigned long *bits)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
-       unsigned long set_mask, clear_mask;
--      bgpio_multiple_get_masks(bgc, mask, bits, &set_mask, &clear_mask);
-+      bgpio_multiple_get_masks(gc, mask, bits, &set_mask, &clear_mask);
-       if (set_mask)
--              bgc->write_reg(bgc->reg_set, set_mask);
-+              gc->write_reg(gc->reg_set, set_mask);
-       if (clear_mask)
--              bgc->write_reg(bgc->reg_clr, clear_mask);
-+              gc->write_reg(gc->reg_clr, clear_mask);
- }
- static int bgpio_simple_dir_in(struct gpio_chip *gc, unsigned int gpio)
-@@ -299,111 +287,103 @@ static int bgpio_simple_dir_out(struct g
- static int bgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
-       unsigned long flags;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
--      bgc->dir &= ~bgc->pin2mask(bgc, gpio);
--      bgc->write_reg(bgc->reg_dir, bgc->dir);
-+      gc->bgpio_dir &= ~gc->pin2mask(gc, gpio);
-+      gc->write_reg(gc->reg_dir, gc->bgpio_dir);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
- static int bgpio_get_dir(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return (bgc->read_reg(bgc->reg_dir) & bgc->pin2mask(bgc, gpio)) ?
--             GPIOF_DIR_OUT : GPIOF_DIR_IN;
-+      /* Return 0 if output, 1 of input */
-+      return !(gc->read_reg(gc->reg_dir) & gc->pin2mask(gc, gpio));
- }
- static int bgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
-       unsigned long flags;
-       gc->set(gc, gpio, val);
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
--      bgc->dir |= bgc->pin2mask(bgc, gpio);
--      bgc->write_reg(bgc->reg_dir, bgc->dir);
-+      gc->bgpio_dir |= gc->pin2mask(gc, gpio);
-+      gc->write_reg(gc->reg_dir, gc->bgpio_dir);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
- static int bgpio_dir_in_inv(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
-       unsigned long flags;
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
--      bgc->dir |= bgc->pin2mask(bgc, gpio);
--      bgc->write_reg(bgc->reg_dir, bgc->dir);
-+      gc->bgpio_dir |= gc->pin2mask(gc, gpio);
-+      gc->write_reg(gc->reg_dir, gc->bgpio_dir);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
- static int bgpio_dir_out_inv(struct gpio_chip *gc, unsigned int gpio, int val)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
-       unsigned long flags;
-       gc->set(gc, gpio, val);
--      spin_lock_irqsave(&bgc->lock, flags);
-+      spin_lock_irqsave(&gc->bgpio_lock, flags);
--      bgc->dir &= ~bgc->pin2mask(bgc, gpio);
--      bgc->write_reg(bgc->reg_dir, bgc->dir);
-+      gc->bgpio_dir &= ~gc->pin2mask(gc, gpio);
-+      gc->write_reg(gc->reg_dir, gc->bgpio_dir);
--      spin_unlock_irqrestore(&bgc->lock, flags);
-+      spin_unlock_irqrestore(&gc->bgpio_lock, flags);
-       return 0;
- }
- static int bgpio_get_dir_inv(struct gpio_chip *gc, unsigned int gpio)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return (bgc->read_reg(bgc->reg_dir) & bgc->pin2mask(bgc, gpio)) ?
--             GPIOF_DIR_IN : GPIOF_DIR_OUT;
-+      /* Return 0 if output, 1 if input */
-+      return !!(gc->read_reg(gc->reg_dir) & gc->pin2mask(gc, gpio));
- }
- static int bgpio_setup_accessors(struct device *dev,
--                               struct bgpio_chip *bgc,
-+                               struct gpio_chip *gc,
-                                bool bit_be,
-                                bool byte_be)
- {
--      switch (bgc->bits) {
-+      switch (gc->bgpio_bits) {
-       case 8:
--              bgc->read_reg   = bgpio_read8;
--              bgc->write_reg  = bgpio_write8;
-+              gc->read_reg    = bgpio_read8;
-+              gc->write_reg   = bgpio_write8;
-               break;
-       case 16:
-               if (byte_be) {
--                      bgc->read_reg   = bgpio_read16be;
--                      bgc->write_reg  = bgpio_write16be;
-+                      gc->read_reg    = bgpio_read16be;
-+                      gc->write_reg   = bgpio_write16be;
-               } else {
--                      bgc->read_reg   = bgpio_read16;
--                      bgc->write_reg  = bgpio_write16;
-+                      gc->read_reg    = bgpio_read16;
-+                      gc->write_reg   = bgpio_write16;
-               }
-               break;
-       case 32:
-               if (byte_be) {
--                      bgc->read_reg   = bgpio_read32be;
--                      bgc->write_reg  = bgpio_write32be;
-+                      gc->read_reg    = bgpio_read32be;
-+                      gc->write_reg   = bgpio_write32be;
-               } else {
--                      bgc->read_reg   = bgpio_read32;
--                      bgc->write_reg  = bgpio_write32;
-+                      gc->read_reg    = bgpio_read32;
-+                      gc->write_reg   = bgpio_write32;
-               }
-               break;
- #if BITS_PER_LONG >= 64
-@@ -413,17 +393,17 @@ static int bgpio_setup_accessors(struct
-                               "64 bit big endian byte order unsupported\n");
-                       return -EINVAL;
-               } else {
--                      bgc->read_reg   = bgpio_read64;
--                      bgc->write_reg  = bgpio_write64;
-+                      gc->read_reg    = bgpio_read64;
-+                      gc->write_reg   = bgpio_write64;
-               }
-               break;
- #endif /* BITS_PER_LONG >= 64 */
-       default:
--              dev_err(dev, "unsupported data width %u bits\n", bgc->bits);
-+              dev_err(dev, "unsupported data width %u bits\n", gc->bgpio_bits);
-               return -EINVAL;
-       }
--      bgc->pin2mask = bit_be ? bgpio_pin2mask_be : bgpio_pin2mask;
-+      gc->pin2mask = bit_be ? bgpio_pin2mask_be : bgpio_pin2mask;
-       return 0;
- }
-@@ -450,44 +430,44 @@ static int bgpio_setup_accessors(struct
-  *    - an input direction register (named "dirin") where a 1 bit indicates
-  *    the GPIO is an input.
-  */
--static int bgpio_setup_io(struct bgpio_chip *bgc,
-+static int bgpio_setup_io(struct gpio_chip *gc,
-                         void __iomem *dat,
-                         void __iomem *set,
-                         void __iomem *clr,
-                         unsigned long flags)
- {
--      bgc->reg_dat = dat;
--      if (!bgc->reg_dat)
-+      gc->reg_dat = dat;
-+      if (!gc->reg_dat)
-               return -EINVAL;
-       if (set && clr) {
--              bgc->reg_set = set;
--              bgc->reg_clr = clr;
--              bgc->gc.set = bgpio_set_with_clear;
--              bgc->gc.set_multiple = bgpio_set_multiple_with_clear;
-+              gc->reg_set = set;
-+              gc->reg_clr = clr;
-+              gc->set = bgpio_set_with_clear;
-+              gc->set_multiple = bgpio_set_multiple_with_clear;
-       } else if (set && !clr) {
--              bgc->reg_set = set;
--              bgc->gc.set = bgpio_set_set;
--              bgc->gc.set_multiple = bgpio_set_multiple_set;
-+              gc->reg_set = set;
-+              gc->set = bgpio_set_set;
-+              gc->set_multiple = bgpio_set_multiple_set;
-       } else if (flags & BGPIOF_NO_OUTPUT) {
--              bgc->gc.set = bgpio_set_none;
--              bgc->gc.set_multiple = NULL;
-+              gc->set = bgpio_set_none;
-+              gc->set_multiple = NULL;
-       } else {
--              bgc->gc.set = bgpio_set;
--              bgc->gc.set_multiple = bgpio_set_multiple;
-+              gc->set = bgpio_set;
-+              gc->set_multiple = bgpio_set_multiple;
-       }
-       if (!(flags & BGPIOF_UNREADABLE_REG_SET) &&
-           (flags & BGPIOF_READ_OUTPUT_REG_SET))
--              bgc->gc.get = bgpio_get_set;
-+              gc->get = bgpio_get_set;
-       else
--              bgc->gc.get = bgpio_get;
-+              gc->get = bgpio_get;
-       return 0;
- }
--static int bgpio_setup_direction(struct bgpio_chip *bgc,
-+static int bgpio_setup_direction(struct gpio_chip *gc,
-                                void __iomem *dirout,
-                                void __iomem *dirin,
-                                unsigned long flags)
-@@ -495,21 +475,21 @@ static int bgpio_setup_direction(struct
-       if (dirout && dirin) {
-               return -EINVAL;
-       } else if (dirout) {
--              bgc->reg_dir = dirout;
--              bgc->gc.direction_output = bgpio_dir_out;
--              bgc->gc.direction_input = bgpio_dir_in;
--              bgc->gc.get_direction = bgpio_get_dir;
-+              gc->reg_dir = dirout;
-+              gc->direction_output = bgpio_dir_out;
-+              gc->direction_input = bgpio_dir_in;
-+              gc->get_direction = bgpio_get_dir;
-       } else if (dirin) {
--              bgc->reg_dir = dirin;
--              bgc->gc.direction_output = bgpio_dir_out_inv;
--              bgc->gc.direction_input = bgpio_dir_in_inv;
--              bgc->gc.get_direction = bgpio_get_dir_inv;
-+              gc->reg_dir = dirin;
-+              gc->direction_output = bgpio_dir_out_inv;
-+              gc->direction_input = bgpio_dir_in_inv;
-+              gc->get_direction = bgpio_get_dir_inv;
-       } else {
-               if (flags & BGPIOF_NO_OUTPUT)
--                      bgc->gc.direction_output = bgpio_dir_out_err;
-+                      gc->direction_output = bgpio_dir_out_err;
-               else
--                      bgc->gc.direction_output = bgpio_simple_dir_out;
--              bgc->gc.direction_input = bgpio_simple_dir_in;
-+                      gc->direction_output = bgpio_simple_dir_out;
-+              gc->direction_input = bgpio_simple_dir_in;
-       }
-       return 0;
-@@ -523,14 +503,7 @@ static int bgpio_request(struct gpio_chi
-       return -EINVAL;
- }
--int bgpio_remove(struct bgpio_chip *bgc)
--{
--      gpiochip_remove(&bgc->gc);
--      return 0;
--}
--EXPORT_SYMBOL_GPL(bgpio_remove);
--
--int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
-+int bgpio_init(struct gpio_chip *gc, struct device *dev,
-              unsigned long sz, void __iomem *dat, void __iomem *set,
-              void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
-              unsigned long flags)
-@@ -540,36 +513,36 @@ int bgpio_init(struct bgpio_chip *bgc, s
-       if (!is_power_of_2(sz))
-               return -EINVAL;
--      bgc->bits = sz * 8;
--      if (bgc->bits > BITS_PER_LONG)
-+      gc->bgpio_bits = sz * 8;
-+      if (gc->bgpio_bits > BITS_PER_LONG)
-               return -EINVAL;
--      spin_lock_init(&bgc->lock);
--      bgc->gc.dev = dev;
--      bgc->gc.label = dev_name(dev);
--      bgc->gc.base = -1;
--      bgc->gc.ngpio = bgc->bits;
--      bgc->gc.request = bgpio_request;
-+      spin_lock_init(&gc->bgpio_lock);
-+      gc->dev = dev;
-+      gc->label = dev_name(dev);
-+      gc->base = -1;
-+      gc->ngpio = gc->bgpio_bits;
-+      gc->request = bgpio_request;
--      ret = bgpio_setup_io(bgc, dat, set, clr, flags);
-+      ret = bgpio_setup_io(gc, dat, set, clr, flags);
-       if (ret)
-               return ret;
--      ret = bgpio_setup_accessors(dev, bgc, flags & BGPIOF_BIG_ENDIAN,
-+      ret = bgpio_setup_accessors(dev, gc, flags & BGPIOF_BIG_ENDIAN,
-                                   flags & BGPIOF_BIG_ENDIAN_BYTE_ORDER);
-       if (ret)
-               return ret;
--      ret = bgpio_setup_direction(bgc, dirout, dirin, flags);
-+      ret = bgpio_setup_direction(gc, dirout, dirin, flags);
-       if (ret)
-               return ret;
--      bgc->data = bgc->read_reg(bgc->reg_dat);
--      if (bgc->gc.set == bgpio_set_set &&
-+      gc->bgpio_data = gc->read_reg(gc->reg_dat);
-+      if (gc->set == bgpio_set_set &&
-                       !(flags & BGPIOF_UNREADABLE_REG_SET))
--              bgc->data = bgc->read_reg(bgc->reg_set);
--      if (bgc->reg_dir && !(flags & BGPIOF_UNREADABLE_REG_DIR))
--              bgc->dir = bgc->read_reg(bgc->reg_dir);
-+              gc->bgpio_data = gc->read_reg(gc->reg_set);
-+      if (gc->reg_dir && !(flags & BGPIOF_UNREADABLE_REG_DIR))
-+              gc->bgpio_dir = gc->read_reg(gc->reg_dir);
-       return ret;
- }
-@@ -607,7 +580,7 @@ static int bgpio_pdev_probe(struct platf
-       unsigned long sz;
-       unsigned long flags = pdev->id_entry->driver_data;
-       int err;
--      struct bgpio_chip *bgc;
-+      struct gpio_chip *gc;
-       struct bgpio_pdata *pdata = dev_get_platdata(dev);
-       r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dat");
-@@ -636,32 +609,33 @@ static int bgpio_pdev_probe(struct platf
-       if (IS_ERR(dirin))
-               return PTR_ERR(dirin);
--      bgc = devm_kzalloc(&pdev->dev, sizeof(*bgc), GFP_KERNEL);
--      if (!bgc)
-+      gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL);
-+      if (!gc)
-               return -ENOMEM;
--      err = bgpio_init(bgc, dev, sz, dat, set, clr, dirout, dirin, flags);
-+      err = bgpio_init(gc, dev, sz, dat, set, clr, dirout, dirin, flags);
-       if (err)
-               return err;
-       if (pdata) {
-               if (pdata->label)
--                      bgc->gc.label = pdata->label;
--              bgc->gc.base = pdata->base;
-+                      gc->label = pdata->label;
-+              gc->base = pdata->base;
-               if (pdata->ngpio > 0)
--                      bgc->gc.ngpio = pdata->ngpio;
-+                      gc->ngpio = pdata->ngpio;
-       }
--      platform_set_drvdata(pdev, bgc);
-+      platform_set_drvdata(pdev, gc);
--      return gpiochip_add(&bgc->gc);
-+      return gpiochip_add_data(gc, NULL);
- }
- static int bgpio_pdev_remove(struct platform_device *pdev)
- {
--      struct bgpio_chip *bgc = platform_get_drvdata(pdev);
-+      struct gpio_chip *gc = platform_get_drvdata(pdev);
--      return bgpio_remove(bgc);
-+      gpiochip_remove(gc);
-+      return 0;
- }
- static const struct platform_device_id bgpio_id_table[] = {
---- a/drivers/gpio/gpio-grgpio.c
-+++ b/drivers/gpio/gpio-grgpio.c
-@@ -31,7 +31,7 @@
- #include <linux/gpio.h>
- #include <linux/slab.h>
- #include <linux/err.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/interrupt.h>
- #include <linux/irq.h>
- #include <linux/irqdomain.h>
-@@ -63,7 +63,7 @@ struct grgpio_lirq {
- };
- struct grgpio_priv {
--      struct bgpio_chip bgc;
-+      struct gpio_chip gc;
-       void __iomem *regs;
-       struct device *dev;
-@@ -92,29 +92,22 @@ struct grgpio_priv {
-       struct grgpio_lirq lirqs[GRGPIO_MAX_NGPIO];
- };
--static inline struct grgpio_priv *grgpio_gc_to_priv(struct gpio_chip *gc)
--{
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return container_of(bgc, struct grgpio_priv, bgc);
--}
--
- static void grgpio_set_imask(struct grgpio_priv *priv, unsigned int offset,
-                            int val)
- {
--      struct bgpio_chip *bgc = &priv->bgc;
--      unsigned long mask = bgc->pin2mask(bgc, offset);
-+      struct gpio_chip *gc = &priv->gc;
-+      unsigned long mask = gc->pin2mask(gc, offset);
-       if (val)
-               priv->imask |= mask;
-       else
-               priv->imask &= ~mask;
--      bgc->write_reg(priv->regs + GRGPIO_IMASK, priv->imask);
-+      gc->write_reg(priv->regs + GRGPIO_IMASK, priv->imask);
- }
- static int grgpio_to_irq(struct gpio_chip *gc, unsigned offset)
- {
--      struct grgpio_priv *priv = grgpio_gc_to_priv(gc);
-+      struct grgpio_priv *priv = gpiochip_get_data(gc);
-       if (offset >= gc->ngpio)
-               return -ENXIO;
-@@ -158,15 +151,15 @@ static int grgpio_irq_set_type(struct ir
-               return -EINVAL;
-       }
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
--      ipol = priv->bgc.read_reg(priv->regs + GRGPIO_IPOL) & ~mask;
--      iedge = priv->bgc.read_reg(priv->regs + GRGPIO_IEDGE) & ~mask;
-+      ipol = priv->gc.read_reg(priv->regs + GRGPIO_IPOL) & ~mask;
-+      iedge = priv->gc.read_reg(priv->regs + GRGPIO_IEDGE) & ~mask;
--      priv->bgc.write_reg(priv->regs + GRGPIO_IPOL, ipol | pol);
--      priv->bgc.write_reg(priv->regs + GRGPIO_IEDGE, iedge | edge);
-+      priv->gc.write_reg(priv->regs + GRGPIO_IPOL, ipol | pol);
-+      priv->gc.write_reg(priv->regs + GRGPIO_IEDGE, iedge | edge);
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
-       return 0;
- }
-@@ -177,11 +170,11 @@ static void grgpio_irq_mask(struct irq_d
-       int offset = d->hwirq;
-       unsigned long flags;
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       grgpio_set_imask(priv, offset, 0);
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
- }
- static void grgpio_irq_unmask(struct irq_data *d)
-@@ -190,11 +183,11 @@ static void grgpio_irq_unmask(struct irq
-       int offset = d->hwirq;
-       unsigned long flags;
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       grgpio_set_imask(priv, offset, 1);
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
- }
- static struct irq_chip grgpio_irq_chip = {
-@@ -207,12 +200,12 @@ static struct irq_chip grgpio_irq_chip =
- static irqreturn_t grgpio_irq_handler(int irq, void *dev)
- {
-       struct grgpio_priv *priv = dev;
--      int ngpio = priv->bgc.gc.ngpio;
-+      int ngpio = priv->gc.ngpio;
-       unsigned long flags;
-       int i;
-       int match = 0;
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       /*
-        * For each gpio line, call its interrupt handler if it its underlying
-@@ -228,7 +221,7 @@ static irqreturn_t grgpio_irq_handler(in
-               }
-       }
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
-       if (!match)
-               dev_warn(priv->dev, "No gpio line matched irq %d\n", irq);
-@@ -260,7 +253,7 @@ static int grgpio_irq_map(struct irq_dom
-       dev_dbg(priv->dev, "Mapping irq %d for gpio line %d\n",
-               irq, offset);
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       /* Request underlying irq if not already requested */
-       lirq->irq = irq;
-@@ -273,14 +266,14 @@ static int grgpio_irq_map(struct irq_dom
-                               "Could not request underlying irq %d\n",
-                               uirq->uirq);
--                      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+                      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
-                       return ret;
-               }
-       }
-       uirq->refcnt++;
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
-       /* Setup irq  */
-       irq_set_chip_data(irq, priv);
-@@ -298,13 +291,13 @@ static void grgpio_irq_unmap(struct irq_
-       struct grgpio_lirq *lirq;
-       struct grgpio_uirq *uirq;
-       unsigned long flags;
--      int ngpio = priv->bgc.gc.ngpio;
-+      int ngpio = priv->gc.ngpio;
-       int i;
-       irq_set_chip_and_handler(irq, NULL, NULL);
-       irq_set_chip_data(irq, NULL);
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       /* Free underlying irq if last user unmapped */
-       index = -1;
-@@ -326,7 +319,7 @@ static void grgpio_irq_unmap(struct irq_
-                       free_irq(uirq->uirq, priv);
-       }
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
- }
- static const struct irq_domain_ops grgpio_irq_domain_ops = {
-@@ -341,7 +334,6 @@ static int grgpio_probe(struct platform_
-       struct device_node *np = ofdev->dev.of_node;
-       void  __iomem *regs;
-       struct gpio_chip *gc;
--      struct bgpio_chip *bgc;
-       struct grgpio_priv *priv;
-       struct resource *res;
-       int err;
-@@ -359,8 +351,8 @@ static int grgpio_probe(struct platform_
-       if (IS_ERR(regs))
-               return PTR_ERR(regs);
--      bgc = &priv->bgc;
--      err = bgpio_init(bgc, &ofdev->dev, 4, regs + GRGPIO_DATA,
-+      gc = &priv->gc;
-+      err = bgpio_init(gc, &ofdev->dev, 4, regs + GRGPIO_DATA,
-                        regs + GRGPIO_OUTPUT, NULL, regs + GRGPIO_DIR, NULL,
-                        BGPIOF_BIG_ENDIAN_BYTE_ORDER);
-       if (err) {
-@@ -369,10 +361,9 @@ static int grgpio_probe(struct platform_
-       }
-       priv->regs = regs;
--      priv->imask = bgc->read_reg(regs + GRGPIO_IMASK);
-+      priv->imask = gc->read_reg(regs + GRGPIO_IMASK);
-       priv->dev = &ofdev->dev;
--      gc = &bgc->gc;
-       gc->of_node = np;
-       gc->owner = THIS_MODULE;
-       gc->to_irq = grgpio_to_irq;
-@@ -435,7 +426,7 @@ static int grgpio_probe(struct platform_
-       platform_set_drvdata(ofdev, priv);
--      err = gpiochip_add(gc);
-+      err = gpiochip_add_data(gc, priv);
-       if (err) {
-               dev_err(&ofdev->dev, "Could not add gpiochip\n");
-               if (priv->domain)
-@@ -456,7 +447,7 @@ static int grgpio_remove(struct platform
-       int i;
-       int ret = 0;
--      spin_lock_irqsave(&priv->bgc.lock, flags);
-+      spin_lock_irqsave(&priv->gc.bgpio_lock, flags);
-       if (priv->domain) {
-               for (i = 0; i < GRGPIO_MAX_NGPIO; i++) {
-@@ -467,13 +458,13 @@ static int grgpio_remove(struct platform
-               }
-       }
--      gpiochip_remove(&priv->bgc.gc);
-+      gpiochip_remove(&priv->gc);
-       if (priv->domain)
-               irq_domain_remove(priv->domain);
- out:
--      spin_unlock_irqrestore(&priv->bgc.lock, flags);
-+      spin_unlock_irqrestore(&priv->gc.bgpio_lock, flags);
-       return ret;
- }
---- a/drivers/gpio/gpio-moxart.c
-+++ b/drivers/gpio/gpio-moxart.c
-@@ -14,7 +14,6 @@
- #include <linux/init.h>
- #include <linux/irq.h>
- #include <linux/io.h>
--#include <linux/gpio.h>
- #include <linux/platform_device.h>
- #include <linux/module.h>
- #include <linux/of_address.h>
-@@ -23,7 +22,7 @@
- #include <linux/delay.h>
- #include <linux/timer.h>
- #include <linux/bitops.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #define GPIO_DATA_OUT         0x00
- #define GPIO_DATA_IN          0x04
-@@ -33,12 +32,12 @@ static int moxart_gpio_probe(struct plat
- {
-       struct device *dev = &pdev->dev;
-       struct resource *res;
--      struct bgpio_chip *bgc;
-+      struct gpio_chip *gc;
-       void __iomem *base;
-       int ret;
--      bgc = devm_kzalloc(dev, sizeof(*bgc), GFP_KERNEL);
--      if (!bgc)
-+      gc = devm_kzalloc(dev, sizeof(*gc), GFP_KERNEL);
-+      if (!gc)
-               return -ENOMEM;
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-@@ -46,7 +45,7 @@ static int moxart_gpio_probe(struct plat
-       if (IS_ERR(base))
-               return PTR_ERR(base);
--      ret = bgpio_init(bgc, dev, 4, base + GPIO_DATA_IN,
-+      ret = bgpio_init(gc, dev, 4, base + GPIO_DATA_IN,
-                        base + GPIO_DATA_OUT, NULL,
-                        base + GPIO_PIN_DIRECTION, NULL,
-                        BGPIOF_READ_OUTPUT_REG_SET);
-@@ -55,16 +54,16 @@ static int moxart_gpio_probe(struct plat
-               return ret;
-       }
--      bgc->gc.label = "moxart-gpio";
--      bgc->gc.request = gpiochip_generic_request;
--      bgc->gc.free = gpiochip_generic_free;
--      bgc->data = bgc->read_reg(bgc->reg_set);
--      bgc->gc.base = 0;
--      bgc->gc.ngpio = 32;
--      bgc->gc.dev = dev;
--      bgc->gc.owner = THIS_MODULE;
-+      gc->label = "moxart-gpio";
-+      gc->request = gpiochip_generic_request;
-+      gc->free = gpiochip_generic_free;
-+      gc->bgpio_data = bgc->read_reg(bgc->reg_set);
-+      gc->base = 0;
-+      gc->ngpio = 32;
-+      gc->dev = dev;
-+      gc->owner = THIS_MODULE;
--      ret = gpiochip_add(&bgc->gc);
-+      ret = gpiochip_add_data(gc, NULL);
-       if (ret) {
-               dev_err(dev, "%s: gpiochip_add failed\n",
-                       dev->of_node->full_name);
---- a/drivers/gpio/gpio-mxc.c
-+++ b/drivers/gpio/gpio-mxc.c
-@@ -26,10 +26,11 @@
- #include <linux/irq.h>
- #include <linux/irqdomain.h>
- #include <linux/irqchip/chained_irq.h>
--#include <linux/gpio.h>
- #include <linux/platform_device.h>
- #include <linux/slab.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
-+/* FIXME: for gpio_get_value() replace this with direct register read */
-+#include <linux/gpio.h>
- #include <linux/of.h>
- #include <linux/of_device.h>
- #include <linux/module.h>
-@@ -64,7 +65,7 @@ struct mxc_gpio_port {
-       int irq;
-       int irq_high;
-       struct irq_domain *domain;
--      struct bgpio_chip bgc;
-+      struct gpio_chip gc;
-       u32 both_edges;
- };
-@@ -172,7 +173,7 @@ static int gpio_set_irq_type(struct irq_
-       struct mxc_gpio_port *port = gc->private;
-       u32 bit, val;
-       u32 gpio_idx = d->hwirq;
--      u32 gpio = port->bgc.gc.base + gpio_idx;
-+      u32 gpio = port->gc.base + gpio_idx;
-       int edge;
-       void __iomem *reg = port->base;
-@@ -398,9 +399,7 @@ static void mxc_gpio_get_hw(struct platf
- static int mxc_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      struct mxc_gpio_port *port =
--              container_of(bgc, struct mxc_gpio_port, bgc);
-+      struct mxc_gpio_port *port = gpiochip_get_data(gc);
-       return irq_find_mapping(port->domain, offset);
- }
-@@ -451,7 +450,7 @@ static int mxc_gpio_probe(struct platfor
-                                                        port);
-       }
--      err = bgpio_init(&port->bgc, &pdev->dev, 4,
-+      err = bgpio_init(&port->gc, &pdev->dev, 4,
-                        port->base + GPIO_PSR,
-                        port->base + GPIO_DR, NULL,
-                        port->base + GPIO_GDIR, NULL,
-@@ -459,13 +458,13 @@ static int mxc_gpio_probe(struct platfor
-       if (err)
-               goto out_bgio;
--      port->bgc.gc.to_irq = mxc_gpio_to_irq;
--      port->bgc.gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
-+      port->gc.to_irq = mxc_gpio_to_irq;
-+      port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
-                                            pdev->id * 32;
--      err = gpiochip_add(&port->bgc.gc);
-+      err = gpiochip_add_data(&port->gc, port);
-       if (err)
--              goto out_bgpio_remove;
-+              goto out_bgio;
-       irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
-       if (irq_base < 0) {
-@@ -494,9 +493,7 @@ out_irqdomain_remove:
- out_irqdesc_free:
-       irq_free_descs(irq_base, 32);
- out_gpiochip_remove:
--      gpiochip_remove(&port->bgc.gc);
--out_bgpio_remove:
--      bgpio_remove(&port->bgc);
-+      gpiochip_remove(&port->gc);
- out_bgio:
-       dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
-       return err;
---- a/drivers/gpio/gpio-mxs.c
-+++ b/drivers/gpio/gpio-mxs.c
-@@ -26,13 +26,14 @@
- #include <linux/io.h>
- #include <linux/irq.h>
- #include <linux/irqdomain.h>
--#include <linux/gpio.h>
- #include <linux/of.h>
- #include <linux/of_address.h>
- #include <linux/of_device.h>
- #include <linux/platform_device.h>
- #include <linux/slab.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
-+/* FIXME: for gpio_get_value(), replace this by direct register read */
-+#include <linux/gpio.h>
- #include <linux/module.h>
- #define MXS_SET               0x4
-@@ -64,7 +65,7 @@ struct mxs_gpio_port {
-       int id;
-       int irq;
-       struct irq_domain *domain;
--      struct bgpio_chip bgc;
-+      struct gpio_chip gc;
-       enum mxs_gpio_id devid;
-       u32 both_edges;
- };
-@@ -93,7 +94,7 @@ static int mxs_gpio_set_irq_type(struct
-       port->both_edges &= ~pin_mask;
-       switch (type) {
-       case IRQ_TYPE_EDGE_BOTH:
--              val = gpio_get_value(port->bgc.gc.base + d->hwirq);
-+              val = gpio_get_value(port->gc.base + d->hwirq);
-               if (val)
-                       edge = GPIO_INT_FALL_EDGE;
-               else
-@@ -225,18 +226,14 @@ static int __init mxs_gpio_init_gc(struc
- static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      struct mxs_gpio_port *port =
--              container_of(bgc, struct mxs_gpio_port, bgc);
-+      struct mxs_gpio_port *port = gpiochip_get_data(gc);
-       return irq_find_mapping(port->domain, offset);
- }
- static int mxs_gpio_get_direction(struct gpio_chip *gc, unsigned offset)
- {
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--      struct mxs_gpio_port *port =
--              container_of(bgc, struct mxs_gpio_port, bgc);
-+      struct mxs_gpio_port *port = gpiochip_get_data(gc);
-       u32 mask = 1 << offset;
-       u32 dir;
-@@ -330,26 +327,24 @@ static int mxs_gpio_probe(struct platfor
-       irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler,
-                                        port);
--      err = bgpio_init(&port->bgc, &pdev->dev, 4,
-+      err = bgpio_init(&port->gc, &pdev->dev, 4,
-                        port->base + PINCTRL_DIN(port),
-                        port->base + PINCTRL_DOUT(port) + MXS_SET,
-                        port->base + PINCTRL_DOUT(port) + MXS_CLR,
-                        port->base + PINCTRL_DOE(port), NULL, 0);
-       if (err)
--              goto out_irqdesc_free;
-+              goto out_irqdomain_remove;
--      port->bgc.gc.to_irq = mxs_gpio_to_irq;
--      port->bgc.gc.get_direction = mxs_gpio_get_direction;
--      port->bgc.gc.base = port->id * 32;
-+      port->gc.to_irq = mxs_gpio_to_irq;
-+      port->gc.get_direction = mxs_gpio_get_direction;
-+      port->gc.base = port->id * 32;
--      err = gpiochip_add(&port->bgc.gc);
-+      err = gpiochip_add_data(&port->gc, port);
-       if (err)
--              goto out_bgpio_remove;
-+              goto out_irqdomain_remove;
-       return 0;
--out_bgpio_remove:
--      bgpio_remove(&port->bgc);
- out_irqdomain_remove:
-       irq_domain_remove(port->domain);
- out_irqdesc_free:
---- a/drivers/gpio/gpio-sodaville.c
-+++ b/drivers/gpio/gpio-sodaville.c
-@@ -10,7 +10,6 @@
-  */
- #include <linux/errno.h>
--#include <linux/gpio.h>
- #include <linux/init.h>
- #include <linux/io.h>
- #include <linux/irq.h>
-@@ -20,7 +19,7 @@
- #include <linux/pci.h>
- #include <linux/platform_device.h>
- #include <linux/of_irq.h>
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #define DRV_NAME              "sdv_gpio"
- #define SDV_NUM_PUB_GPIOS     12
-@@ -43,7 +42,7 @@ struct sdv_gpio_chip_data {
-       void __iomem *gpio_pub_base;
-       struct irq_domain *id;
-       struct irq_chip_generic *gc;
--      struct bgpio_chip bgpio;
-+      struct gpio_chip chip;
- };
- static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type)
-@@ -226,14 +225,14 @@ static int sdv_gpio_probe(struct pci_dev
-               writel(mux_val, sd->gpio_pub_base + GPMUXCTL);
-       }
--      ret = bgpio_init(&sd->bgpio, &pdev->dev, 4,
-+      ret = bgpio_init(&sd->chip, &pdev->dev, 4,
-                       sd->gpio_pub_base + GPINR, sd->gpio_pub_base + GPOUTR,
-                       NULL, sd->gpio_pub_base + GPOER, NULL, 0);
-       if (ret)
-               goto unmap;
--      sd->bgpio.gc.ngpio = SDV_NUM_PUB_GPIOS;
-+      sd->chip.ngpio = SDV_NUM_PUB_GPIOS;
--      ret = gpiochip_add(&sd->bgpio.gc);
-+      ret = gpiochip_add_data(&sd->chip, sd);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "gpiochip_add() failed.\n");
-               goto unmap;
-@@ -265,7 +264,7 @@ static void sdv_gpio_remove(struct pci_d
-       free_irq(pdev->irq, sd);
-       irq_free_descs(sd->irq_base, SDV_NUM_PUB_GPIOS);
--      gpiochip_remove(&sd->bgpio.gc);
-+      gpiochip_remove(&sd->chip);
-       pci_release_region(pdev, GPIO_BAR);
-       iounmap(sd->gpio_pub_base);
-       pci_disable_device(pdev);
---- a/drivers/gpio/gpio-xgene-sb.c
-+++ b/drivers/gpio/gpio-xgene-sb.c
-@@ -23,10 +23,8 @@
- #include <linux/io.h>
- #include <linux/platform_device.h>
- #include <linux/of_gpio.h>
--#include <linux/gpio.h>
- #include <linux/gpio/driver.h>
- #include <linux/acpi.h>
--#include <linux/basic_mmio_gpio.h>
- #include "gpiolib.h"
-@@ -43,38 +41,31 @@
- /**
-  * struct xgene_gpio_sb - GPIO-Standby private data structure.
-- * @bgc:                      memory-mapped GPIO controllers.
-+ * @gc:                               memory-mapped GPIO controllers.
-  * @irq:                      Mapping GPIO pins and interrupt number
-  * nirq:                      Number of GPIO pins that supports interrupt
-  */
- struct xgene_gpio_sb {
--      struct bgpio_chip       bgc;
-+      struct gpio_chip        gc;
-       u32 *irq;
-       u32 nirq;
- };
--static inline struct xgene_gpio_sb *to_xgene_gpio_sb(struct gpio_chip *gc)
--{
--      struct bgpio_chip *bgc = to_bgpio_chip(gc);
--
--      return container_of(bgc, struct xgene_gpio_sb, bgc);
--}
--
--static void xgene_gpio_set_bit(struct bgpio_chip *bgc, void __iomem *reg, u32 gpio, int val)
-+static void xgene_gpio_set_bit(struct gpio_chip *gc, void __iomem *reg, u32 gpio, int val)
- {
-       u32 data;
--      data = bgc->read_reg(reg);
-+      data = gc->read_reg(reg);
-       if (val)
-               data |= GPIO_MASK(gpio);
-       else
-               data &= ~GPIO_MASK(gpio);
--      bgc->write_reg(reg, data);
-+      gc->write_reg(reg, data);
- }
- static int apm_gpio_sb_to_irq(struct gpio_chip *gc, u32 gpio)
- {
--      struct xgene_gpio_sb *priv = to_xgene_gpio_sb(gc);
-+      struct xgene_gpio_sb *priv = gpiochip_get_data(gc);
-       if (priv->irq[gpio])
-               return priv->irq[gpio];
-@@ -99,15 +90,15 @@ static int xgene_gpio_sb_probe(struct pl
-       if (IS_ERR(regs))
-               return PTR_ERR(regs);
--      ret = bgpio_init(&priv->bgc, &pdev->dev, 4,
-+      ret = bgpio_init(&priv->gc, &pdev->dev, 4,
-                       regs + MPA_GPIO_IN_ADDR,
-                       regs + MPA_GPIO_OUT_ADDR, NULL,
-                       regs + MPA_GPIO_OE_ADDR, NULL, 0);
-         if (ret)
-                 return ret;
--      priv->bgc.gc.to_irq = apm_gpio_sb_to_irq;
--      priv->bgc.gc.ngpio = XGENE_MAX_GPIO_DS;
-+      priv->gc.to_irq = apm_gpio_sb_to_irq;
-+      priv->gc.ngpio = XGENE_MAX_GPIO_DS;
-       priv->nirq = XGENE_MAX_GPIO_DS_IRQ;
-@@ -118,14 +109,14 @@ static int xgene_gpio_sb_probe(struct pl
-       for (i = 0; i < priv->nirq; i++) {
-               priv->irq[default_lines[i]] = platform_get_irq(pdev, i);
--              xgene_gpio_set_bit(&priv->bgc, regs + MPA_GPIO_SEL_LO,
-+              xgene_gpio_set_bit(&priv->gc, regs + MPA_GPIO_SEL_LO,
-                                    default_lines[i] * 2, 1);
--              xgene_gpio_set_bit(&priv->bgc, regs + MPA_GPIO_INT_LVL, i, 1);
-+              xgene_gpio_set_bit(&priv->gc, regs + MPA_GPIO_INT_LVL, i, 1);
-       }
-       platform_set_drvdata(pdev, priv);
--      ret = gpiochip_add(&priv->bgc.gc);
-+      ret = gpiochip_add_data(&priv->gc, priv);
-       if (ret)
-               dev_err(&pdev->dev, "failed to register X-Gene GPIO Standby driver\n");
-       else
-@@ -133,7 +124,7 @@ static int xgene_gpio_sb_probe(struct pl
-       if (priv->nirq > 0) {
-               /* Register interrupt handlers for gpio signaled acpi events */
--              acpi_gpiochip_request_interrupts(&priv->bgc.gc);
-+              acpi_gpiochip_request_interrupts(&priv->gc);
-       }
-       return ret;
-@@ -144,10 +135,11 @@ static int xgene_gpio_sb_remove(struct p
-       struct xgene_gpio_sb *priv = platform_get_drvdata(pdev);
-       if (priv->nirq > 0) {
--              acpi_gpiochip_free_interrupts(&priv->bgc.gc);
-+              acpi_gpiochip_free_interrupts(&priv->gc);
-       }
--      return bgpio_remove(&priv->bgc);
-+      gpiochip_remove(&priv->gc);
-+      return 0;
- }
- static const struct of_device_id xgene_gpio_sb_of_match[] = {
---- a/drivers/mfd/vexpress-sysreg.c
-+++ b/drivers/mfd/vexpress-sysreg.c
-@@ -11,7 +11,7 @@
-  * Copyright (C) 2012 ARM Limited
-  */
--#include <linux/basic_mmio_gpio.h>
-+#include <linux/gpio/driver.h>
- #include <linux/err.h>
- #include <linux/io.h>
- #include <linux/mfd/core.h>
-@@ -164,7 +164,7 @@ static int vexpress_sysreg_probe(struct
- {
-       struct resource *mem;
-       void __iomem *base;
--      struct bgpio_chip *mmc_gpio_chip;
-+      struct gpio_chip *mmc_gpio_chip;
-       int master;
-       u32 dt_hbi;
-@@ -201,8 +201,8 @@ static int vexpress_sysreg_probe(struct
-               return -ENOMEM;
-       bgpio_init(mmc_gpio_chip, &pdev->dev, 0x4, base + SYS_MCI,
-                       NULL, NULL, NULL, NULL, 0);
--      mmc_gpio_chip->gc.ngpio = 2;
--      gpiochip_add(&mmc_gpio_chip->gc);
-+      mmc_gpio_chip->ngpio = 2;
-+      gpiochip_add(mmc_gpio_chip);
-       return mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
-                       vexpress_sysreg_cells,
---- a/include/linux/basic_mmio_gpio.h
-+++ /dev/null
-@@ -1,80 +0,0 @@
--/*
-- * Basic memory-mapped GPIO controllers.
-- *
-- * Copyright 2008 MontaVista Software, Inc.
-- * Copyright 2008,2010 Anton Vorontsov <cbouatmailru@gmail.com>
-- *
-- * This program is free software; you can redistribute  it and/or modify it
-- * under  the terms of  the GNU General  Public License as published by the
-- * Free Software Foundation;  either version 2 of the  License, or (at your
-- * option) any later version.
-- */
--
--#ifndef __BASIC_MMIO_GPIO_H
--#define __BASIC_MMIO_GPIO_H
--
--#include <linux/gpio.h>
--#include <linux/types.h>
--#include <linux/compiler.h>
--#include <linux/spinlock_types.h>
--
--struct bgpio_pdata {
--      const char *label;
--      int base;
--      int ngpio;
--};
--
--struct device;
--
--struct bgpio_chip {
--      struct gpio_chip gc;
--
--      unsigned long (*read_reg)(void __iomem *reg);
--      void (*write_reg)(void __iomem *reg, unsigned long data);
--
--      void __iomem *reg_dat;
--      void __iomem *reg_set;
--      void __iomem *reg_clr;
--      void __iomem *reg_dir;
--
--      /* Number of bits (GPIOs): <register width> * 8. */
--      int bits;
--
--      /*
--       * Some GPIO controllers work with the big-endian bits notation,
--       * e.g. in a 8-bits register, GPIO7 is the least significant bit.
--       */
--      unsigned long (*pin2mask)(struct bgpio_chip *bgc, unsigned int pin);
--
--      /*
--       * Used to lock bgpio_chip->data. Also, this is needed to keep
--       * shadowed and real data registers writes together.
--       */
--      spinlock_t lock;
--
--      /* Shadowed data register to clear/set bits safely. */
--      unsigned long data;
--
--      /* Shadowed direction registers to clear/set direction safely. */
--      unsigned long dir;
--};
--
--static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc)
--{
--      return container_of(gc, struct bgpio_chip, gc);
--}
--
--int bgpio_remove(struct bgpio_chip *bgc);
--int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
--             unsigned long sz, void __iomem *dat, void __iomem *set,
--             void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
--             unsigned long flags);
--
--#define BGPIOF_BIG_ENDIAN             BIT(0)
--#define BGPIOF_UNREADABLE_REG_SET     BIT(1) /* reg_set is unreadable */
--#define BGPIOF_UNREADABLE_REG_DIR     BIT(2) /* reg_dir is unreadable */
--#define BGPIOF_BIG_ENDIAN_BYTE_ORDER  BIT(3)
--#define BGPIOF_READ_OUTPUT_REG_SET     BIT(4) /* reg_set stores output value */
--#define BGPIOF_NO_OUTPUT              BIT(5) /* only input */
--
--#endif /* __BASIC_MMIO_GPIO_H */
---- a/include/linux/gpio/driver.h
-+++ b/include/linux/gpio/driver.h
-@@ -8,6 +8,7 @@
- #include <linux/irqdomain.h>
- #include <linux/lockdep.h>
- #include <linux/pinctrl/pinctrl.h>
-+#include <linux/kconfig.h>
- struct device;
- struct gpio_desc;
-@@ -66,6 +67,23 @@ struct seq_file;
-  *    registers.
-  * @irq_not_threaded: flag must be set if @can_sleep is set but the
-  *    IRQs don't need to be threaded
-+ * @read_reg: reader function for generic GPIO
-+ * @write_reg: writer function for generic GPIO
-+ * @pin2mask: some generic GPIO controllers work with the big-endian bits
-+ *    notation, e.g. in a 8-bits register, GPIO7 is the least significant
-+ *    bit. This callback assigns the right bit mask.
-+ * @reg_dat: data (in) register for generic GPIO
-+ * @reg_set: output set register (out=high) for generic GPIO
-+ * @reg_clk: output clear register (out=low) for generic GPIO
-+ * @reg_dir: direction setting register for generic GPIO
-+ * @bgpio_bits: number of register bits used for a generic GPIO i.e.
-+ *    <register width> * 8
-+ * @bgpio_lock: used to lock chip->bgpio_data. Also, this is needed to keep
-+ *    shadowed and real data registers writes together.
-+ * @bgpio_data:       shadowed data register for generic GPIO to clear/set bits
-+ *    safely.
-+ * @bgpio_dir: shadowed direction register for generic GPIO to clear/set
-+ *    direction safely.
-  * @irqchip: GPIO IRQ chip impl, provided by GPIO driver
-  * @irqdomain: Interrupt translation domain; responsible for mapping
-  *    between GPIO hwirq number and linux irq number
-@@ -129,6 +147,20 @@ struct gpio_chip {
-       bool                    can_sleep;
-       bool                    irq_not_threaded;
-+#if IS_ENABLED(CONFIG_GPIO_GENERIC)
-+      unsigned long (*read_reg)(void __iomem *reg);
-+      void (*write_reg)(void __iomem *reg, unsigned long data);
-+      unsigned long (*pin2mask)(struct gpio_chip *gc, unsigned int pin);
-+      void __iomem *reg_dat;
-+      void __iomem *reg_set;
-+      void __iomem *reg_clr;
-+      void __iomem *reg_dir;
-+      int bgpio_bits;
-+      spinlock_t bgpio_lock;
-+      unsigned long bgpio_data;
-+      unsigned long bgpio_dir;
-+#endif
-+
- #ifdef CONFIG_GPIOLIB_IRQCHIP
-       /*
-        * With CONFIG_GPIOLIB_IRQCHIP we get an irqchip inside the gpiolib
-@@ -189,6 +221,28 @@ static inline void *gpiochip_get_data(st
- struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
-+#if IS_ENABLED(CONFIG_GPIO_GENERIC)
-+
-+struct bgpio_pdata {
-+      const char *label;
-+      int base;
-+      int ngpio;
-+};
-+
-+int bgpio_init(struct gpio_chip *gc, struct device *dev,
-+             unsigned long sz, void __iomem *dat, void __iomem *set,
-+             void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
-+             unsigned long flags);
-+
-+#define BGPIOF_BIG_ENDIAN             BIT(0)
-+#define BGPIOF_UNREADABLE_REG_SET     BIT(1) /* reg_set is unreadable */
-+#define BGPIOF_UNREADABLE_REG_DIR     BIT(2) /* reg_dir is unreadable */
-+#define BGPIOF_BIG_ENDIAN_BYTE_ORDER  BIT(3)
-+#define BGPIOF_READ_OUTPUT_REG_SET    BIT(4) /* reg_set stores output value */
-+#define BGPIOF_NO_OUTPUT              BIT(5) /* only input */
-+
-+#endif
-+
- #ifdef CONFIG_GPIOLIB_IRQCHIP
- void gpiochip_set_chained_irqchip(struct gpio_chip *gpiochip,
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.6-01-gpio-Add-devm_-apis-for-gpiochip_add_data-and-gpioch.patch b/target/linux/brcm63xx/patches-4.4/000-4.6-01-gpio-Add-devm_-apis-for-gpiochip_add_data-and-gpioch.patch
deleted file mode 100644 (file)
index ab2fb07..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-From 0cf3292cde22f8843ae5d1eeb8466d8121243c1a Mon Sep 17 00:00:00 2001
-From: Laxman Dewangan <ldewangan@nvidia.com>
-Date: Mon, 15 Feb 2016 16:32:09 +0530
-Subject: [PATCH] gpio: Add devm_ apis for gpiochip_add_data and
- gpiochip_remove
-
-Add device managed APIs devm_gpiochip_add_data() and
-devm_gpiochip_remove() for the APIs gpiochip_add_data()
-and gpiochip_remove().
-
-This helps in reducing code in error path and sometimes
-removal of .remove callback for driver unbind.
-
-Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
----
- drivers/gpio/gpiolib.c      | 74 +++++++++++++++++++++++++++++++++++++++++++++
- include/linux/gpio/driver.h |  4 +++
- 2 files changed, 78 insertions(+)
-
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -433,6 +433,80 @@ void gpiochip_remove(struct gpio_chip *c
- }
- EXPORT_SYMBOL_GPL(gpiochip_remove);
-+static void devm_gpio_chip_release(struct device *dev, void *res)
-+{
-+      struct gpio_chip *chip = *(struct gpio_chip **)res;
-+
-+      gpiochip_remove(chip);
-+}
-+
-+static int devm_gpio_chip_match(struct device *dev, void *res, void *data)
-+
-+{
-+      struct gpio_chip **r = res;
-+
-+      if (!r || !*r) {
-+              WARN_ON(!r || !*r);
-+              return 0;
-+      }
-+
-+      return *r == data;
-+}
-+
-+/**
-+ * devm_gpiochip_add_data() - Resource manager piochip_add_data()
-+ * @dev: the device pointer on which irq_chip belongs to.
-+ * @chip: the chip to register, with chip->base initialized
-+ * Context: potentially before irqs will work
-+ *
-+ * Returns a negative errno if the chip can't be registered, such as
-+ * because the chip->base is invalid or already associated with a
-+ * different chip.  Otherwise it returns zero as a success code.
-+ *
-+ * The gpio chip automatically be released when the device is unbound.
-+ */
-+int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
-+                         void *data)
-+{
-+      struct gpio_chip **ptr;
-+      int ret;
-+
-+      ptr = devres_alloc(devm_gpio_chip_release, sizeof(*ptr),
-+                           GFP_KERNEL);
-+      if (!ptr)
-+              return -ENOMEM;
-+
-+      ret = gpiochip_add_data(chip, data);
-+      if (ret < 0) {
-+              devres_free(ptr);
-+              return ret;
-+      }
-+
-+      *ptr = chip;
-+      devres_add(dev, ptr);
-+
-+      return 0;
-+}
-+EXPORT_SYMBOL_GPL(devm_gpiochip_add_data);
-+
-+/**
-+ * devm_gpiochip_remove() - Resource manager of gpiochip_remove()
-+ * @dev: device for which which resource was allocated
-+ * @chip: the chip to remove
-+ *
-+ * A gpio_chip with any GPIOs still requested may not be removed.
-+ */
-+void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip)
-+{
-+      int ret;
-+
-+      ret = devres_release(dev, devm_gpio_chip_release,
-+                           devm_gpio_chip_match, chip);
-+      if (!ret)
-+              WARN_ON(ret);
-+}
-+EXPORT_SYMBOL_GPL(devm_gpiochip_remove);
-+
- /**
-  * gpiochip_find() - iterator for locating a specific gpio_chip
-  * @data: data to pass to match function
---- a/include/linux/gpio/driver.h
-+++ b/include/linux/gpio/driver.h
-@@ -206,6 +206,10 @@ static inline int gpiochip_add(struct gp
-       return gpiochip_add_data(chip, NULL);
- }
- extern void gpiochip_remove(struct gpio_chip *chip);
-+extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
-+                                void *data);
-+extern void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip);
-+
- extern struct gpio_chip *gpiochip_find(void *data,
-                             int (*match)(struct gpio_chip *chip, void *data));
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.7-01-pinctrl-Add-devm_-apis-for-pinctrl_-register-unregis.patch b/target/linux/brcm63xx/patches-4.4/000-4.7-01-pinctrl-Add-devm_-apis-for-pinctrl_-register-unregis.patch
deleted file mode 100644 (file)
index 205b6d7..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-From 80e0f8d94d3090f0f7bf3faf3e6180e920ee0d22 Mon Sep 17 00:00:00 2001
-From: Laxman Dewangan <ldewangan@nvidia.com>
-Date: Wed, 24 Feb 2016 14:12:59 +0530
-Subject: [PATCH] pinctrl: Add devm_ apis for pinctrl_{register, unregister}
-
-Add device managed APIs devm_pinctrl_register() and
-devm_pinctrl_unregister() for the APIs pinctrl_register()
-and pinctrl_unregister().
-
-This helps in reducing code in error path and sometimes
-removal of .remove callback for driver unbind.
-
-Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
-Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
-Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
----
- drivers/pinctrl/core.c          | 63 +++++++++++++++++++++++++++++++++++++++++
- include/linux/pinctrl/pinctrl.h |  6 ++++
- 2 files changed, 69 insertions(+)
-
---- a/drivers/pinctrl/core.c
-+++ b/drivers/pinctrl/core.c
-@@ -1861,6 +1861,69 @@ void pinctrl_unregister(struct pinctrl_d
- }
- EXPORT_SYMBOL_GPL(pinctrl_unregister);
-+static void devm_pinctrl_dev_release(struct device *dev, void *res)
-+{
-+      struct pinctrl_dev *pctldev = *(struct pinctrl_dev **)res;
-+
-+      pinctrl_unregister(pctldev);
-+}
-+
-+static int devm_pinctrl_dev_match(struct device *dev, void *res, void *data)
-+{
-+      struct pctldev **r = res;
-+
-+      if (WARN_ON(!r || !*r))
-+              return 0;
-+
-+      return *r == data;
-+}
-+
-+/**
-+ * devm_pinctrl_register() - Resource managed version of pinctrl_register().
-+ * @dev: parent device for this pin controller
-+ * @pctldesc: descriptor for this pin controller
-+ * @driver_data: private pin controller data for this pin controller
-+ *
-+ * Returns an error pointer if pincontrol register failed. Otherwise
-+ * it returns valid pinctrl handle.
-+ *
-+ * The pinctrl device will be automatically released when the device is unbound.
-+ */
-+struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
-+                                        struct pinctrl_desc *pctldesc,
-+                                        void *driver_data)
-+{
-+      struct pinctrl_dev **ptr, *pctldev;
-+
-+      ptr = devres_alloc(devm_pinctrl_dev_release, sizeof(*ptr), GFP_KERNEL);
-+      if (!ptr)
-+              return ERR_PTR(-ENOMEM);
-+
-+      pctldev = pinctrl_register(pctldesc, dev, driver_data);
-+      if (IS_ERR(pctldev)) {
-+              devres_free(ptr);
-+              return pctldev;
-+      }
-+
-+      *ptr = pctldev;
-+      devres_add(dev, ptr);
-+
-+      return pctldev;
-+}
-+EXPORT_SYMBOL_GPL(devm_pinctrl_register);
-+
-+/**
-+ * devm_pinctrl_unregister() - Resource managed version of pinctrl_unregister().
-+ * @dev: device for which which resource was allocated
-+ * @pctldev: the pinctrl device to unregister.
-+ */
-+void devm_pinctrl_unregister(struct device *dev, struct pinctrl_dev *pctldev)
-+{
-+      WARN_ON(devres_release(dev, devm_pinctrl_dev_release,
-+                             devm_pinctrl_dev_match, pctldev));
-+}
-+EXPORT_SYMBOL_GPL(devm_pinctrl_unregister);
-+
- static int __init pinctrl_init(void)
- {
-       pr_info("initialized pinctrl subsystem\n");
---- a/include/linux/pinctrl/pinctrl.h
-+++ b/include/linux/pinctrl/pinctrl.h
-@@ -144,6 +144,12 @@ struct pinctrl_desc {
- extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
-                               struct device *dev, void *driver_data);
- extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
-+extern struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
-+                              struct pinctrl_desc *pctldesc,
-+                              void *driver_data);
-+extern void devm_pinctrl_unregister(struct device *dev,
-+                              struct pinctrl_dev *pctldev);
-+
- extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
- extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
-                               struct pinctrl_gpio_range *range);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.7-02-pinctrl-Rename-pinctrl_utils_dt_free_map-to-pinctrl_.patch b/target/linux/brcm63xx/patches-4.4/000-4.7-02-pinctrl-Rename-pinctrl_utils_dt_free_map-to-pinctrl_.patch
deleted file mode 100644 (file)
index 5acb379..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-From d32f7fd3bbc32732b094d938b95169521503a9fb Mon Sep 17 00:00:00 2001
-From: Irina Tirdea <irina.tirdea@intel.com>
-Date: Thu, 31 Mar 2016 14:44:42 +0300
-Subject: [PATCH] pinctrl: Rename pinctrl_utils_dt_free_map to
- pinctrl_utils_free_map
-
-Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map, since
-it does not depend on device tree despite the current name. This
-will enforce a consistent naming in pinctr-utils.c and will make
-it clear it can be called from outside device tree (e.g. from
-ACPI handling code).
-
-Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
----
- drivers/pinctrl/pinconf-generic.c                | 2 +-
- drivers/pinctrl/pinctrl-utils.c                  | 4 ++--
- drivers/pinctrl/pinctrl-utils.h                  | 2 +-
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/pinctrl/pinconf-generic.c
-+++ b/drivers/pinctrl/pinconf-generic.c
-@@ -385,7 +385,7 @@ int pinconf_generic_dt_node_to_map(struc
-       return 0;
- exit:
--      pinctrl_utils_dt_free_map(pctldev, *map, *num_maps);
-+      pinctrl_utils_free_map(pctldev, *map, *num_maps);
-       return ret;
- }
- EXPORT_SYMBOL_GPL(pinconf_generic_dt_node_to_map);
---- a/drivers/pinctrl/pinctrl-utils.c
-+++ b/drivers/pinctrl/pinctrl-utils.c
-@@ -122,7 +122,7 @@ int pinctrl_utils_add_config(struct pinc
- }
- EXPORT_SYMBOL_GPL(pinctrl_utils_add_config);
--void pinctrl_utils_dt_free_map(struct pinctrl_dev *pctldev,
-+void pinctrl_utils_free_map(struct pinctrl_dev *pctldev,
-             struct pinctrl_map *map, unsigned num_maps)
- {
-       int i;
-@@ -139,4 +139,4 @@ void pinctrl_utils_dt_free_map(struct pi
-       }
-       kfree(map);
- }
--EXPORT_SYMBOL_GPL(pinctrl_utils_dt_free_map);
-+EXPORT_SYMBOL_GPL(pinctrl_utils_free_map);
---- a/drivers/pinctrl/pinctrl-utils.h
-+++ b/drivers/pinctrl/pinctrl-utils.h
-@@ -37,7 +37,7 @@ int pinctrl_utils_add_map_configs(struct
- int pinctrl_utils_add_config(struct pinctrl_dev *pctldev,
-               unsigned long **configs, unsigned *num_configs,
-               unsigned long config);
--void pinctrl_utils_dt_free_map(struct pinctrl_dev *pctldev,
-+void pinctrl_utils_free_map(struct pinctrl_dev *pctldev,
-               struct pinctrl_map *map, unsigned num_maps);
- #endif /* __PINCTRL_UTILS_H__ */
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-01-mtd-spi-nor-change-return-value-of-read-write.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-01-mtd-spi-nor-change-return-value-of-read-write.patch
deleted file mode 100644 (file)
index 31c24e5..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-From 59451e1233bd315c5379a631838a03d80e689581 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:47 -0700
-Subject: [PATCH 01/10] mtd: spi-nor: change return value of read/write
-
-Change the return value of spi-nor device read and write methods to
-allow returning amount of data transferred and errors as
-read(2)/write(2) does.
-
-Also, start handling positive returns in spi_nor_read(), since we want
-to convert drivers to start returning the read-length both via *retlen
-and the return code. (We don't need to do the same transition process
-for spi_nor_write(), since ->write() didn't used to have a return code
-at all.)
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/devices/m25p80.c      |  5 +++--
- drivers/mtd/spi-nor/fsl-quadspi.c |  5 +++--
- drivers/mtd/spi-nor/nxp-spifi.c   | 12 ++++++------
- drivers/mtd/spi-nor/spi-nor.c     |  5 ++++-
- include/linux/mtd/spi-nor.h       |  4 ++--
- 6 files changed, 36 insertions(+), 21 deletions(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -73,7 +73,7 @@ static int m25p80_write_reg(struct spi_n
-       return spi_write(spi, flash->command, len + 1);
- }
--static void m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
-+static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
-                       size_t *retlen, const u_char *buf)
- {
-       struct m25p *flash = nor->priv;
-@@ -101,6 +101,7 @@ static void m25p80_write(struct spi_nor
-       spi_sync(spi, &m);
-       *retlen += m.actual_length - cmd_sz;
-+      return 0;
- }
- static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor)
-@@ -119,7 +120,7 @@ static inline unsigned int m25p80_rx_nbi
-  * Read an address range from the nor chip.  The address range
-  * may be any size provided it is within the physical boundaries.
-  */
--static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
-+static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
-                       size_t *retlen, u_char *buf)
- {
-       struct m25p *flash = nor->priv;
---- a/drivers/mtd/spi-nor/fsl-quadspi.c
-+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
-@@ -822,7 +822,7 @@ static int fsl_qspi_write_reg(struct spi
-       return ret;
- }
--static void fsl_qspi_write(struct spi_nor *nor, loff_t to,
-+static ssize_t fsl_qspi_write(struct spi_nor *nor, loff_t to,
-               size_t len, size_t *retlen, const u_char *buf)
- {
-       struct fsl_qspi *q = nor->priv;
-@@ -832,9 +832,10 @@ static void fsl_qspi_write(struct spi_no
-       /* invalid the data in the AHB buffer. */
-       fsl_qspi_invalid(q);
-+      return 0;
- }
--static int fsl_qspi_read(struct spi_nor *nor, loff_t from,
-+static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
-               size_t len, size_t *retlen, u_char *buf)
- {
-       struct fsl_qspi *q = nor->priv;
---- a/drivers/mtd/spi-nor/nxp-spifi.c
-+++ b/drivers/mtd/spi-nor/nxp-spifi.c
-@@ -172,8 +172,8 @@ static int nxp_spifi_write_reg(struct sp
-       return nxp_spifi_wait_for_cmd(spifi);
- }
--static int nxp_spifi_read(struct spi_nor *nor, loff_t from, size_t len,
--                        size_t *retlen, u_char *buf)
-+static ssize_t nxp_spifi_read(struct spi_nor *nor, loff_t from, size_t len,
-+                            size_t *retlen, u_char *buf)
- {
-       struct nxp_spifi *spifi = nor->priv;
-       int ret;
-@@ -188,8 +188,8 @@ static int nxp_spifi_read(struct spi_nor
-       return 0;
- }
--static void nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len,
--                          size_t *retlen, const u_char *buf)
-+static ssize_t nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len,
-+                             size_t *retlen, const u_char *buf)
- {
-       struct nxp_spifi *spifi = nor->priv;
-       u32 cmd;
-@@ -197,7 +197,7 @@ static void nxp_spifi_write(struct spi_n
-       ret = nxp_spifi_set_memory_mode_off(spifi);
-       if (ret)
--              return;
-+              return ret;
-       writel(to, spifi->io_base + SPIFI_ADDR);
-       *retlen += len;
-@@ -212,7 +212,7 @@ static void nxp_spifi_write(struct spi_n
-       while (len--)
-               writeb(*buf++, spifi->io_base + SPIFI_DATA);
--      nxp_spifi_wait_for_cmd(spifi);
-+      return nxp_spifi_wait_for_cmd(spifi);
- }
- static int nxp_spifi_erase(struct spi_nor *nor, loff_t offs)
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -893,7 +893,10 @@ static int spi_nor_read(struct mtd_info
-       ret = nor->read(nor, from, len, retlen, buf);
-       spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
--      return ret;
-+      if (ret < 0)
-+              return ret;
-+
-+      return 0;
- }
- static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
---- a/include/linux/mtd/spi-nor.h
-+++ b/include/linux/mtd/spi-nor.h
-@@ -169,9 +169,9 @@ struct spi_nor {
-       int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
-       int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
--      int (*read)(struct spi_nor *nor, loff_t from,
-+      ssize_t (*read)(struct spi_nor *nor, loff_t from,
-                       size_t len, size_t *retlen, u_char *read_buf);
--      void (*write)(struct spi_nor *nor, loff_t to,
-+      ssize_t (*write)(struct spi_nor *nor, loff_t to,
-                       size_t len, size_t *retlen, const u_char *write_buf);
-       int (*erase)(struct spi_nor *nor, loff_t offs);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch
deleted file mode 100644 (file)
index fb89b77..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From 1992297b0810a42d78ec7b4de15304eb0489fd97 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:48 -0700
-Subject: [PATCH 02/10] mtd: m25p80: return amount of data transferred or error
- in read/write
-
-Add checking of SPI transfer errors and return them from read/write
-functions. Also return the amount of data transferred.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/devices/m25p80.c | 29 +++++++++++++++++++++--------
- 1 file changed, 21 insertions(+), 8 deletions(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -81,6 +81,7 @@ static ssize_t m25p80_write(struct spi_n
-       struct spi_transfer t[2] = {};
-       struct spi_message m;
-       int cmd_sz = m25p_cmdsz(nor);
-+      ssize_t ret;
-       spi_message_init(&m);
-@@ -98,10 +99,15 @@ static ssize_t m25p80_write(struct spi_n
-       t[1].len = len;
-       spi_message_add_tail(&t[1], &m);
--      spi_sync(spi, &m);
-+      ret = spi_sync(spi, &m);
-+      if (ret)
-+              return ret;
--      *retlen += m.actual_length - cmd_sz;
--      return 0;
-+      ret = m.actual_length - cmd_sz;
-+      if (ret < 0)
-+              return -EIO;
-+      *retlen += ret;
-+      return ret;
- }
- static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor)
-@@ -128,13 +134,13 @@ static ssize_t m25p80_read(struct spi_no
-       struct spi_transfer t[2];
-       struct spi_message m;
-       unsigned int dummy = nor->read_dummy;
-+      ssize_t ret;
-       /* convert the dummy cycles to the number of bytes */
-       dummy /= 8;
-       if (spi_flash_read_supported(spi)) {
-               struct spi_flash_read_message msg;
--              int ret;
-               memset(&msg, 0, sizeof(msg));
-@@ -151,7 +157,9 @@ static ssize_t m25p80_read(struct spi_no
-               ret = spi_flash_read(spi, &msg);
-               *retlen = msg.retlen;
--              return ret;
-+              if (ret < 0)
-+                      return ret;
-+              return msg.retlen;
-       }
-       spi_message_init(&m);
-@@ -169,10 +177,15 @@ static ssize_t m25p80_read(struct spi_no
-       t[1].len = len;
-       spi_message_add_tail(&t[1], &m);
--      spi_sync(spi, &m);
-+      ret = spi_sync(spi, &m);
-+      if (ret)
-+              return ret;
--      *retlen = m.actual_length - m25p_cmdsz(nor) - dummy;
--      return 0;
-+      ret = m.actual_length - m25p_cmdsz(nor) - dummy;
-+      if (ret < 0)
-+              return -EIO;
-+      *retlen += ret;
-+      return ret;
- }
- static int m25p80_erase(struct spi_nor *nor, loff_t offset)
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-03-mtd-fsl-quadspi-return-amount-of-data-read-written-o.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-03-mtd-fsl-quadspi-return-amount-of-data-read-written-o.patch
deleted file mode 100644 (file)
index 232f11c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From fc0d7e542a0d4193521899d15f8f4999dc295323 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:49 -0700
-Subject: [PATCH 03/10] mtd: fsl-quadspi: return amount of data read/written or
- error
-
-Return amount of data read/written or error as read(2)/write(2) does.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
----
- drivers/mtd/spi-nor/fsl-quadspi.c | 17 +++++++++++------
- 1 file changed, 11 insertions(+), 6 deletions(-)
-
---- a/drivers/mtd/spi-nor/fsl-quadspi.c
-+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
-@@ -575,7 +575,7 @@ static inline void fsl_qspi_invalid(stru
-       writel(reg, q->iobase + QUADSPI_MCR);
- }
--static int fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
-+static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
-                               u8 opcode, unsigned int to, u32 *txbuf,
-                               unsigned count, size_t *retlen)
- {
-@@ -604,8 +604,11 @@ static int fsl_qspi_nor_write(struct fsl
-       /* Trigger it */
-       ret = fsl_qspi_runcmd(q, opcode, to, count);
--      if (ret == 0 && retlen)
--              *retlen += count;
-+      if (ret == 0) {
-+              if (retlen)
-+                      *retlen += count;
-+              return count;
-+      }
-       return ret;
- }
-@@ -814,6 +817,8 @@ static int fsl_qspi_write_reg(struct spi
-       } else if (len > 0) {
-               ret = fsl_qspi_nor_write(q, nor, opcode, 0,
-                                       (u32 *)buf, len, NULL);
-+              if (ret > 0)
-+                      return 0;
-       } else {
-               dev_err(q->dev, "invalid cmd %d\n", opcode);
-               ret = -EINVAL;
-@@ -827,12 +832,12 @@ static ssize_t fsl_qspi_write(struct spi
- {
-       struct fsl_qspi *q = nor->priv;
--      fsl_qspi_nor_write(q, nor, nor->program_opcode, to,
-+      ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to,
-                               (u32 *)buf, len, retlen);
-       /* invalid the data in the AHB buffer. */
-       fsl_qspi_invalid(q);
--      return 0;
-+      return ret;
- }
- static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
-@@ -879,7 +884,7 @@ static ssize_t fsl_qspi_read(struct spi_
-               len);
-       *retlen += len;
--      return 0;
-+      return len;
- }
- static int fsl_qspi_erase(struct spi_nor *nor, loff_t offs)
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-05-mtd-nxp-spifi-return-amount-of-data-transferred-or-e.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-05-mtd-nxp-spifi-return-amount-of-data-transferred-or-e.patch
deleted file mode 100644 (file)
index 0458148..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From bc418cd2652f47a327e27f978caa3d85f9558b09 Mon Sep 17 00:00:00 2001
-From: Brian Norris <computersforpeace@gmail.com>
-Date: Thu, 5 May 2016 17:31:51 -0700
-Subject: [PATCH 05/10] mtd: nxp-spifi: return amount of data transferred or
- error in read/write
-
-Add checking of SPI transfer errors and return them from read/write
-functions. Also return the amount of data transferred.
-
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
----
- drivers/mtd/spi-nor/nxp-spifi.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
-
---- a/drivers/mtd/spi-nor/nxp-spifi.c
-+++ b/drivers/mtd/spi-nor/nxp-spifi.c
-@@ -185,7 +185,7 @@ static ssize_t nxp_spifi_read(struct spi
-       memcpy_fromio(buf, spifi->flash_base + from, len);
-       *retlen += len;
--      return 0;
-+      return len;
- }
- static ssize_t nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len,
-@@ -194,6 +194,7 @@ static ssize_t nxp_spifi_write(struct sp
-       struct nxp_spifi *spifi = nor->priv;
-       u32 cmd;
-       int ret;
-+      size_t i;
-       ret = nxp_spifi_set_memory_mode_off(spifi);
-       if (ret)
-@@ -209,10 +210,14 @@ static ssize_t nxp_spifi_write(struct sp
-             SPIFI_CMD_FRAMEFORM(spifi->nor.addr_width + 1);
-       writel(cmd, spifi->io_base + SPIFI_CMD);
--      while (len--)
--              writeb(*buf++, spifi->io_base + SPIFI_DATA);
-+      for (i = 0; i < len; i++)
-+              writeb(buf[i], spifi->io_base + SPIFI_DATA);
--      return nxp_spifi_wait_for_cmd(spifi);
-+      ret = nxp_spifi_wait_for_cmd(spifi);
-+      if (ret)
-+              return ret;
-+
-+      return len;
- }
- static int nxp_spifi_erase(struct spi_nor *nor, loff_t offs)
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-06-mtd-spi-nor-check-return-value-from-write.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-06-mtd-spi-nor-check-return-value-from-write.patch
deleted file mode 100644 (file)
index 0bdcccf..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-From 0bad7b9304d543dd7627f4cd564aea5d7338b950 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:52 -0700
-Subject: [PATCH 06/10] mtd: spi-nor: check return value from write
-
-SPI NOR hardware drivers now return useful value from their write
-functions so check them.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 45 ++++++++++++++++++++++++++++++-------------
- 1 file changed, 32 insertions(+), 13 deletions(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -922,10 +922,14 @@ static int sst_write(struct mtd_info *mt
-               nor->program_opcode = SPINOR_OP_BP;
-               /* write one byte. */
--              nor->write(nor, to, 1, retlen, buf);
-+              ret = nor->write(nor, to, 1, retlen, buf);
-+              if (ret < 0)
-+                      goto sst_write_err;
-+              WARN(ret != 1, "While writing 1 byte written %i bytes\n",
-+                   (int)ret);
-               ret = spi_nor_wait_till_ready(nor);
-               if (ret)
--                      goto time_out;
-+                      goto sst_write_err;
-       }
-       to += actual;
-@@ -934,10 +938,14 @@ static int sst_write(struct mtd_info *mt
-               nor->program_opcode = SPINOR_OP_AAI_WP;
-               /* write two bytes. */
--              nor->write(nor, to, 2, retlen, buf + actual);
-+              ret = nor->write(nor, to, 2, retlen, buf + actual);
-+              if (ret < 0)
-+                      goto sst_write_err;
-+              WARN(ret != 2, "While writing 2 bytes written %i bytes\n",
-+                   (int)ret);
-               ret = spi_nor_wait_till_ready(nor);
-               if (ret)
--                      goto time_out;
-+                      goto sst_write_err;
-               to += 2;
-               nor->sst_write_second = true;
-       }
-@@ -946,21 +954,24 @@ static int sst_write(struct mtd_info *mt
-       write_disable(nor);
-       ret = spi_nor_wait_till_ready(nor);
-       if (ret)
--              goto time_out;
-+              goto sst_write_err;
-       /* Write out trailing byte if it exists. */
-       if (actual != len) {
-               write_enable(nor);
-               nor->program_opcode = SPINOR_OP_BP;
--              nor->write(nor, to, 1, retlen, buf + actual);
--
-+              ret = nor->write(nor, to, 1, retlen, buf + actual);
-+              if (ret < 0)
-+                      goto sst_write_err;
-+              WARN(ret != 1, "While writing 1 byte written %i bytes\n",
-+                   (int)ret);
-               ret = spi_nor_wait_till_ready(nor);
-               if (ret)
--                      goto time_out;
-+                      goto sst_write_err;
-               write_disable(nor);
-       }
--time_out:
-+sst_write_err:
-       spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
-       return ret;
- }
-@@ -989,14 +1000,18 @@ static int spi_nor_write(struct mtd_info
-       /* do all the bytes fit onto one page? */
-       if (page_offset + len <= nor->page_size) {
--              nor->write(nor, to, len, retlen, buf);
-+              ret = nor->write(nor, to, len, retlen, buf);
-+              if (ret < 0)
-+                      goto write_err;
-       } else {
-               /* the size of data remaining on the first page */
-               page_size = nor->page_size - page_offset;
--              nor->write(nor, to, page_size, retlen, buf);
-+              ret = nor->write(nor, to, page_size, retlen, buf);
-+              if (ret < 0)
-+                      goto write_err;
-               /* write everything in nor->page_size chunks */
--              for (i = page_size; i < len; i += page_size) {
-+              for (i = ret; i < len; ) {
-                       page_size = len - i;
-                       if (page_size > nor->page_size)
-                               page_size = nor->page_size;
-@@ -1007,7 +1022,11 @@ static int spi_nor_write(struct mtd_info
-                       write_enable(nor);
--                      nor->write(nor, to + i, page_size, retlen, buf + i);
-+                      ret = nor->write(nor, to + i, page_size, retlen,
-+                                       buf + i);
-+                      if (ret < 0)
-+                              goto write_err;
-+                      i += ret;
-               }
-       }
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-07-mtd-spi-nor-stop-passing-around-retlen.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-07-mtd-spi-nor-stop-passing-around-retlen.patch
deleted file mode 100644 (file)
index 9949d35..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-From 2dd087b16946cf168f401526adf26afa771bb740 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:53 -0700
-Subject: [PATCH 07/10] mtd: spi-nor: stop passing around retlen
-
-Do not pass retlen to hardware driver read/write functions. Update it in
-spi-nor generic driver instead.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/devices/m25p80.c      |  7 ++-----
- drivers/mtd/spi-nor/fsl-quadspi.c | 17 ++++++-----------
- drivers/mtd/spi-nor/nxp-spifi.c   |  6 ++----
- drivers/mtd/spi-nor/spi-nor.c     | 21 +++++++++++++--------
- include/linux/mtd/spi-nor.h       |  4 ++--
- 6 files changed, 28 insertions(+), 35 deletions(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -74,7 +74,7 @@ static int m25p80_write_reg(struct spi_n
- }
- static ssize_t m25p80_write(struct spi_nor *nor, loff_t to, size_t len,
--                      size_t *retlen, const u_char *buf)
-+                          const u_char *buf)
- {
-       struct m25p *flash = nor->priv;
-       struct spi_device *spi = flash->spi;
-@@ -106,7 +106,6 @@ static ssize_t m25p80_write(struct spi_n
-       ret = m.actual_length - cmd_sz;
-       if (ret < 0)
-               return -EIO;
--      *retlen += ret;
-       return ret;
- }
-@@ -127,7 +126,7 @@ static inline unsigned int m25p80_rx_nbi
-  * may be any size provided it is within the physical boundaries.
-  */
- static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
--                      size_t *retlen, u_char *buf)
-+                         u_char *buf)
- {
-       struct m25p *flash = nor->priv;
-       struct spi_device *spi = flash->spi;
-@@ -156,7 +155,6 @@ static ssize_t m25p80_read(struct spi_no
-               msg.data_nbits = m25p80_rx_nbits(nor);
-               ret = spi_flash_read(spi, &msg);
--              *retlen = msg.retlen;
-               if (ret < 0)
-                       return ret;
-               return msg.retlen;
-@@ -184,7 +182,6 @@ static ssize_t m25p80_read(struct spi_no
-       ret = m.actual_length - m25p_cmdsz(nor) - dummy;
-       if (ret < 0)
-               return -EIO;
--      *retlen += ret;
-       return ret;
- }
---- a/drivers/mtd/spi-nor/fsl-quadspi.c
-+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
-@@ -577,7 +577,7 @@ static inline void fsl_qspi_invalid(stru
- static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
-                               u8 opcode, unsigned int to, u32 *txbuf,
--                              unsigned count, size_t *retlen)
-+                              unsigned count)
- {
-       int ret, i, j;
-       u32 tmp;
-@@ -604,11 +604,8 @@ static ssize_t fsl_qspi_nor_write(struct
-       /* Trigger it */
-       ret = fsl_qspi_runcmd(q, opcode, to, count);
--      if (ret == 0) {
--              if (retlen)
--                      *retlen += count;
-+      if (ret == 0)
-               return count;
--      }
-       return ret;
- }
-@@ -816,7 +813,7 @@ static int fsl_qspi_write_reg(struct spi
-       } else if (len > 0) {
-               ret = fsl_qspi_nor_write(q, nor, opcode, 0,
--                                      (u32 *)buf, len, NULL);
-+                                      (u32 *)buf, len);
-               if (ret > 0)
-                       return 0;
-       } else {
-@@ -828,12 +825,11 @@ static int fsl_qspi_write_reg(struct spi
- }
- static ssize_t fsl_qspi_write(struct spi_nor *nor, loff_t to,
--              size_t len, size_t *retlen, const u_char *buf)
-+                            size_t len, const u_char *buf)
- {
-       struct fsl_qspi *q = nor->priv;
--
-       ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to,
--                              (u32 *)buf, len, retlen);
-+                                       (u32 *)buf, len);
-       /* invalid the data in the AHB buffer. */
-       fsl_qspi_invalid(q);
-@@ -841,7 +837,7 @@ static ssize_t fsl_qspi_write(struct spi
- }
- static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
--              size_t len, size_t *retlen, u_char *buf)
-+                           size_t len, u_char *buf)
- {
-       struct fsl_qspi *q = nor->priv;
-       u8 cmd = nor->read_opcode;
-@@ -883,7 +879,6 @@ static ssize_t fsl_qspi_read(struct spi_
-       memcpy(buf, q->ahb_addr + q->chip_base_addr + from - q->memmap_offs,
-               len);
--      *retlen += len;
-       return len;
- }
---- a/drivers/mtd/spi-nor/nxp-spifi.c
-+++ b/drivers/mtd/spi-nor/nxp-spifi.c
-@@ -173,7 +173,7 @@ static int nxp_spifi_write_reg(struct sp
- }
- static ssize_t nxp_spifi_read(struct spi_nor *nor, loff_t from, size_t len,
--                            size_t *retlen, u_char *buf)
-+                            u_char *buf)
- {
-       struct nxp_spifi *spifi = nor->priv;
-       int ret;
-@@ -183,13 +183,12 @@ static ssize_t nxp_spifi_read(struct spi
-               return ret;
-       memcpy_fromio(buf, spifi->flash_base + from, len);
--      *retlen += len;
-       return len;
- }
- static ssize_t nxp_spifi_write(struct spi_nor *nor, loff_t to, size_t len,
--                             size_t *retlen, const u_char *buf)
-+                             const u_char *buf)
- {
-       struct nxp_spifi *spifi = nor->priv;
-       u32 cmd;
-@@ -201,7 +200,6 @@ static ssize_t nxp_spifi_write(struct sp
-               return ret;
-       writel(to, spifi->io_base + SPIFI_ADDR);
--      *retlen += len;
-       cmd = SPIFI_CMD_DOUT |
-             SPIFI_CMD_DATALEN(len) |
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -890,12 +890,13 @@ static int spi_nor_read(struct mtd_info
-       if (ret)
-               return ret;
--      ret = nor->read(nor, from, len, retlen, buf);
-+      ret = nor->read(nor, from, len, buf);
-       spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
-       if (ret < 0)
-               return ret;
-+      *retlen += ret;
-       return 0;
- }
-@@ -922,7 +923,7 @@ static int sst_write(struct mtd_info *mt
-               nor->program_opcode = SPINOR_OP_BP;
-               /* write one byte. */
--              ret = nor->write(nor, to, 1, retlen, buf);
-+              ret = nor->write(nor, to, 1, buf);
-               if (ret < 0)
-                       goto sst_write_err;
-               WARN(ret != 1, "While writing 1 byte written %i bytes\n",
-@@ -938,7 +939,7 @@ static int sst_write(struct mtd_info *mt
-               nor->program_opcode = SPINOR_OP_AAI_WP;
-               /* write two bytes. */
--              ret = nor->write(nor, to, 2, retlen, buf + actual);
-+              ret = nor->write(nor, to, 2, buf + actual);
-               if (ret < 0)
-                       goto sst_write_err;
-               WARN(ret != 2, "While writing 2 bytes written %i bytes\n",
-@@ -961,7 +962,7 @@ static int sst_write(struct mtd_info *mt
-               write_enable(nor);
-               nor->program_opcode = SPINOR_OP_BP;
--              ret = nor->write(nor, to, 1, retlen, buf + actual);
-+              ret = nor->write(nor, to, 1, buf + actual);
-               if (ret < 0)
-                       goto sst_write_err;
-               WARN(ret != 1, "While writing 1 byte written %i bytes\n",
-@@ -970,8 +971,10 @@ static int sst_write(struct mtd_info *mt
-               if (ret)
-                       goto sst_write_err;
-               write_disable(nor);
-+              actual += 1;
-       }
- sst_write_err:
-+      *retlen += actual;
-       spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
-       return ret;
- }
-@@ -1000,15 +1003,17 @@ static int spi_nor_write(struct mtd_info
-       /* do all the bytes fit onto one page? */
-       if (page_offset + len <= nor->page_size) {
--              ret = nor->write(nor, to, len, retlen, buf);
-+              ret = nor->write(nor, to, len, buf);
-               if (ret < 0)
-                       goto write_err;
-+              *retlen += ret;
-       } else {
-               /* the size of data remaining on the first page */
-               page_size = nor->page_size - page_offset;
--              ret = nor->write(nor, to, page_size, retlen, buf);
-+              ret = nor->write(nor, to, page_size, buf);
-               if (ret < 0)
-                       goto write_err;
-+              *retlen += ret;
-               /* write everything in nor->page_size chunks */
-               for (i = ret; i < len; ) {
-@@ -1022,10 +1027,10 @@ static int spi_nor_write(struct mtd_info
-                       write_enable(nor);
--                      ret = nor->write(nor, to + i, page_size, retlen,
--                                       buf + i);
-+                      ret = nor->write(nor, to + i, page_size, buf + i);
-                       if (ret < 0)
-                               goto write_err;
-+                      *retlen += ret;
-                       i += ret;
-               }
-       }
---- a/include/linux/mtd/spi-nor.h
-+++ b/include/linux/mtd/spi-nor.h
-@@ -170,9 +170,9 @@ struct spi_nor {
-       int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
-       ssize_t (*read)(struct spi_nor *nor, loff_t from,
--                      size_t len, size_t *retlen, u_char *read_buf);
-+                      size_t len, u_char *read_buf);
-       ssize_t (*write)(struct spi_nor *nor, loff_t to,
--                      size_t len, size_t *retlen, const u_char *write_buf);
-+                      size_t len, const u_char *write_buf);
-       int (*erase)(struct spi_nor *nor, loff_t offs);
-       int (*flash_lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-08-mtd-spi-nor-simplify-write-loop.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-08-mtd-spi-nor-simplify-write-loop.patch
deleted file mode 100644 (file)
index b2e840d..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-From e5d05cbd6d8b01f08c95c427a36c66aac769af4f Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:54 -0700
-Subject: [PATCH 08/10] mtd: spi-nor: simplify write loop
-
-The spi-nor write loop assumes that what is passed to the hardware
-driver write() is what gets written.
-
-When write() writes less than page size at once data is dropped on the
-floor. Check the amount of data writen and exit if it does not match
-requested amount.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 58 +++++++++++++++++++------------------------
- 1 file changed, 25 insertions(+), 33 deletions(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -988,8 +988,8 @@ static int spi_nor_write(struct mtd_info
-       size_t *retlen, const u_char *buf)
- {
-       struct spi_nor *nor = mtd_to_spi_nor(mtd);
--      u32 page_offset, page_size, i;
--      int ret;
-+      size_t page_offset, page_remain, i;
-+      ssize_t ret;
-       dev_dbg(nor->dev, "to 0x%08x, len %zd\n", (u32)to, len);
-@@ -997,45 +997,37 @@ static int spi_nor_write(struct mtd_info
-       if (ret)
-               return ret;
--      write_enable(nor);
-+      for (i = 0; i < len; ) {
-+              ssize_t written;
--      page_offset = to & (nor->page_size - 1);
--
--      /* do all the bytes fit onto one page? */
--      if (page_offset + len <= nor->page_size) {
--              ret = nor->write(nor, to, len, buf);
--              if (ret < 0)
--                      goto write_err;
--              *retlen += ret;
--      } else {
-+              page_offset = (to + i) & (nor->page_size - 1);
-+              WARN_ONCE(page_offset,
-+                        "Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.",
-+                        page_offset);
-               /* the size of data remaining on the first page */
--              page_size = nor->page_size - page_offset;
--              ret = nor->write(nor, to, page_size, buf);
-+              page_remain = min_t(size_t,
-+                                  nor->page_size - page_offset, len - i);
-+
-+              write_enable(nor);
-+              ret = nor->write(nor, to + i, page_remain, buf + i);
-               if (ret < 0)
-                       goto write_err;
--              *retlen += ret;
-+              written = ret;
--              /* write everything in nor->page_size chunks */
--              for (i = ret; i < len; ) {
--                      page_size = len - i;
--                      if (page_size > nor->page_size)
--                              page_size = nor->page_size;
--
--                      ret = spi_nor_wait_till_ready(nor);
--                      if (ret)
--                              goto write_err;
--
--                      write_enable(nor);
--
--                      ret = nor->write(nor, to + i, page_size, buf + i);
--                      if (ret < 0)
--                              goto write_err;
--                      *retlen += ret;
--                      i += ret;
-+              ret = spi_nor_wait_till_ready(nor);
-+              if (ret)
-+                      goto write_err;
-+              *retlen += written;
-+              i += written;
-+              if (written != page_remain) {
-+                      dev_err(nor->dev,
-+                              "While writing %zu bytes written %zd bytes\n",
-+                              page_remain, written);
-+                      ret = -EIO;
-+                      goto write_err;
-               }
-       }
--      ret = spi_nor_wait_till_ready(nor);
- write_err:
-       spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE);
-       return ret;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-09-mtd-spi-nor-add-read-loop.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-09-mtd-spi-nor-add-read-loop.patch
deleted file mode 100644 (file)
index 662c73a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-From 26f9bcad29a6c240881bd4efc90f16a9990dd6c2 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:55 -0700
-Subject: [PATCH 09/10] mtd: spi-nor: add read loop
-
-mtdblock and ubi do not handle the situation when read returns less data
-than requested. Loop in spi-nor until buffer is filled or an error is
-returned.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Tested-by Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 25 +++++++++++++++++++------
- 1 file changed, 19 insertions(+), 6 deletions(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -890,14 +890,27 @@ static int spi_nor_read(struct mtd_info
-       if (ret)
-               return ret;
--      ret = nor->read(nor, from, len, buf);
-+      while (len) {
-+              ret = nor->read(nor, from, len, buf);
-+              if (ret == 0) {
-+                      /* We shouldn't see 0-length reads */
-+                      ret = -EIO;
-+                      goto read_err;
-+              }
-+              if (ret < 0)
-+                      goto read_err;
--      spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
--      if (ret < 0)
--              return ret;
-+              WARN_ON(ret > len);
-+              *retlen += ret;
-+              buf += ret;
-+              from += ret;
-+              len -= ret;
-+      }
-+      ret = 0;
--      *retlen += ret;
--      return 0;
-+read_err:
-+      spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ);
-+      return ret;
- }
- static int sst_write(struct mtd_info *mtd, loff_t to, size_t len,
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-10-mtd-m25p80-read-in-spi_max_transfer_size-chunks.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-10-mtd-m25p80-read-in-spi_max_transfer_size-chunks.patch
deleted file mode 100644 (file)
index d4f13ec..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 95193796256cfce16e5d881318e15b6b04062c15 Mon Sep 17 00:00:00 2001
-From: Michal Suchanek <hramrach@gmail.com>
-Date: Thu, 5 May 2016 17:31:56 -0700
-Subject: [PATCH 10/10] mtd: m25p80: read in spi_max_transfer_size chunks
-
-Take into account transfer size limitation of SPI master.
-
-Signed-off-by: Michal Suchanek <hramrach@gmail.com>
-Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-Acked-by: Michal Suchanek <hramrach@gmail.com>
-Tested-by: Michal Suchanek <hramrach@gmail.com>
----
- drivers/mtd/devices/m25p80.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -172,7 +172,7 @@ static ssize_t m25p80_read(struct spi_no
-       t[1].rx_buf = buf;
-       t[1].rx_nbits = m25p80_rx_nbits(nor);
--      t[1].len = len;
-+      t[1].len = min(len, spi_max_transfer_size(spi));
-       spi_message_add_tail(&t[1], &m);
-       ret = spi_sync(spi, &m);
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch
deleted file mode 100644 (file)
index 9f4e21a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From a59388668d0ce19dadea909e09f4eb905a27b1ce Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jogo@openwrt.org>
-Date: Wed, 8 Jun 2016 12:08:43 +0200
-Subject: [PATCH] serial/bcm63xx_uart: use correct alias naming
-
-The bcm63xx_uart driver uses the of alias for determing its id. Recent
-changes in dts files changed the expected 'uartX' to the recommended
-'serialX', breaking serial output. Fix this by checking for a 'serialX'
-alias as well.
-
-Fixes: e3b992d028f8 ("MIPS: BMIPS: Improve BCM6328 device tree")
-Fixes: 2d52ee82b475 ("MIPS: BMIPS: Improve BCM6368 device tree")
-Fixes: 7537d273e2f3 ("MIPS: BMIPS: Add device tree example for BCM6358")
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
-Acked-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/tty/serial/bcm63xx_uart.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
---- a/drivers/tty/serial/bcm63xx_uart.c
-+++ b/drivers/tty/serial/bcm63xx_uart.c
-@@ -813,8 +813,12 @@ static int bcm_uart_probe(struct platfor
-       struct clk *clk;
-       int ret;
--      if (pdev->dev.of_node)
--              pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
-+      if (pdev->dev.of_node) {
-+              pdev->id = of_alias_get_id(pdev->dev.of_node, "serial");
-+
-+              if (pdev->id < 0)
-+                      pdev->id = of_alias_get_id(pdev->dev.of_node, "uart");
-+      }
-       if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS)
-               return -EINVAL;
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch b/target/linux/brcm63xx/patches-4.4/000-4.9-01-spi-introduce-max_message_size-hook-in-spi_master.patch
deleted file mode 100644 (file)
index 76a66a3..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-From 5090cc6ae2f79ee779e5faf7c8a28edf42b7d738 Mon Sep 17 00:00:00 2001
-From: Heiner Kallweit <hkallweit1@gmail.com>
-Date: Wed, 17 Aug 2016 21:08:01 +0200
-Subject: [PATCH] spi: introduce max_message_size hook in spi_master
-
-Recently a maximum transfer size was was introduced in struct spi_master.
-However there are also spi controllers with a maximum message size, e.g.
-fsl-espi has a max message size of 64KB.
-Introduce a hook max_message_size to deal with such limitations.
-
-Also make sure that spi_max_transfer_size doesn't return greater values
-than spi_max_message_size, even if hook max_transfer_size is not set.
-
-Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
-Signed-off-by: Mark Brown <broonie@kernel.org>
----
- include/linux/spi/spi.h | 25 +++++++++++++++++++++----
- 1 file changed, 21 insertions(+), 4 deletions(-)
-
---- a/include/linux/spi/spi.h
-+++ b/include/linux/spi/spi.h
-@@ -304,6 +304,8 @@ static inline void spi_unregister_driver
-  * @min_speed_hz: Lowest supported transfer speed
-  * @max_speed_hz: Highest supported transfer speed
-  * @flags: other constraints relevant to this driver
-+ * @max_message_size: function that returns the max message size for
-+ *    a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
-  * @bus_lock_spinlock: spinlock for SPI bus locking
-  * @bus_lock_mutex: mutex for SPI bus locking
-  * @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
-@@ -429,10 +431,11 @@ struct spi_master {
- #define SPI_MASTER_MUST_TX      BIT(4)                /* requires tx */
-       /*
--       * on some hardware transfer size may be constrained
-+       * on some hardware transfer / message size may be constrained
-        * the limit may depend on device transfer settings
-        */
-       size_t (*max_transfer_size)(struct spi_device *spi);
-+      size_t (*max_message_size)(struct spi_device *spi);
-       /* lock and mutex for SPI bus locking */
-       spinlock_t              bus_lock_spinlock;
-@@ -844,12 +847,26 @@ extern int spi_async_locked(struct spi_d
-                           struct spi_message *message);
- static inline size_t
--spi_max_transfer_size(struct spi_device *spi)
-+spi_max_message_size(struct spi_device *spi)
- {
-       struct spi_master *master = spi->master;
--      if (!master->max_transfer_size)
-+      if (!master->max_message_size)
-               return SIZE_MAX;
--      return master->max_transfer_size(spi);
-+      return master->max_message_size(spi);
-+}
-+
-+static inline size_t
-+spi_max_transfer_size(struct spi_device *spi)
-+{
-+      struct spi_master *master = spi->master;
-+      size_t tr_max = SIZE_MAX;
-+      size_t msg_max = spi_max_message_size(spi);
-+
-+      if (master->max_transfer_size)
-+              tr_max = master->max_transfer_size(spi);
-+
-+      /* transfer size limit must not be greater than messsage size limit */
-+      return min(tr_max, msg_max);
- }
- /*---------------------------------------------------------------------------*/
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch b/target/linux/brcm63xx/patches-4.4/001-4.11-01-mtd-m25p80-consider-max-message-size-in-m25p80_read.patch
deleted file mode 100644 (file)
index e902701..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 80a79a889ce5df16c5261ab2f1e8e63b94b78102 Mon Sep 17 00:00:00 2001
-From: Heiner Kallweit <hkallweit1@gmail.com>
-Date: Fri, 28 Oct 2016 07:58:46 +0200
-Subject: [PATCH 1/8] mtd: m25p80: consider max message size in m25p80_read
-
-Consider a message size limit when calculating the maximum amount
-of data that can be read.
-
-The message size limit has been introduced with 4.9, so cc it
-to stable.
-
-Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
-Cc: <stable@vger.kernel.org> # 4.9.x
-Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
----
- drivers/mtd/devices/m25p80.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/drivers/mtd/devices/m25p80.c
-+++ b/drivers/mtd/devices/m25p80.c
-@@ -172,7 +172,8 @@ static ssize_t m25p80_read(struct spi_no
-       t[1].rx_buf = buf;
-       t[1].rx_nbits = m25p80_rx_nbits(nor);
--      t[1].len = min(len, spi_max_transfer_size(spi));
-+      t[1].len = min3(len, spi_max_transfer_size(spi),
-+                      spi_max_message_size(spi) - t[0].len);
-       spi_message_add_tail(&t[1], &m);
-       ret = spi_sync(spi, &m);
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.11-02-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch b/target/linux/brcm63xx/patches-4.4/001-4.11-02-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch
deleted file mode 100644 (file)
index 7c70d20..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-From bc0e151514d09cadb56e473a10c783e64e48ce0b Mon Sep 17 00:00:00 2001
-From: Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Date: Tue, 6 Dec 2016 18:14:24 +0100
-Subject: [PATCH] mtd: spi-nor: remove WARN_ONCE() message in spi_nor_write()
-
-This patch removes the WARN_ONCE() test in spi_nor_write().
-This macro triggers the display of a warning message almost every time we
-use a UBI file-system because a write operation is performed at offset 64,
-which is in the middle of the SPI NOR memory page. This is a valid
-operation for ubifs.
-
-Hence this warning is pretty annoying and useless so we just remove it.
-
-Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
-Suggested-by: Richard Weinberger <richard@nod.at>
-Suggested-by: Andras Szemzo <szemzo.andras@gmail.com>
-Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
----
- drivers/mtd/spi-nor/spi-nor.c | 3 ---
- 1 file changed, 3 deletions(-)
-
---- a/drivers/mtd/spi-nor/spi-nor.c
-+++ b/drivers/mtd/spi-nor/spi-nor.c
-@@ -1014,9 +1014,6 @@ static int spi_nor_write(struct mtd_info
-               ssize_t written;
-               page_offset = (to + i) & (nor->page_size - 1);
--              WARN_ONCE(page_offset,
--                        "Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.",
--                        page_offset);
-               /* the size of data remaining on the first page */
-               page_remain = min_t(size_t,
-                                   nor->page_size - page_offset, len - i);
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch
deleted file mode 100644 (file)
index d806290..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 3fcc36962c32ad0af2d5904103e2b2b824b6b1aa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sat, 4 Feb 2017 12:32:59 +0100
-Subject: [PATCH 2/8] spi/bcm63xx: make spi subsystem aware of message size
- limits
-
-The bcm63xx LS SPI controller does not allow manual control of the CS
-lines and will toggle it automatically before after sending data, so we
-are limited to messages that fit in the FIFO buffer. Since the CS lines
-aren't available as GPIOs either, we will need to make slave drivers
-aware of this limitation and handle it accordingly.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -429,6 +429,13 @@ static irqreturn_t bcm63xx_spi_interrupt
-       return IRQ_HANDLED;
- }
-+static size_t bcm63xx_spi_max_length(struct spi_device *spi)
-+{
-+      struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
-+
-+      return bs->fifo_size;
-+}
-+
- static const unsigned long bcm6348_spi_reg_offsets[] = {
-       [SPI_CMD]               = SPI_6348_CMD,
-       [SPI_INT_STATUS]        = SPI_6348_INT_STATUS,
-@@ -542,6 +549,8 @@ static int bcm63xx_spi_probe(struct plat
-       master->transfer_one_message = bcm63xx_spi_transfer_one;
-       master->mode_bits = MODEBITS;
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
-+      master->max_transfer_size = bcm63xx_spi_max_length;
-+      master->max_message_size = bcm63xx_spi_max_length;
-       master->auto_runtime_pm = true;
-       bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT];
-       bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH];
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch
deleted file mode 100644 (file)
index 524c50e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0a0c39044332a75eaf4a3c5654079df953b0d839 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jogo@openwrt.org>
-Date: Mon, 7 Sep 2015 21:00:38 +0200
-Subject: [PATCH 3/8] spi/bcm63xx: document device tree bindings
-
-Add documentation for the bindings of the low speed SPI controller found
-on most bcm63xx SoCs.
-
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- .../devicetree/bindings/spi/spi-bcm63xx.txt        | 33 ++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
-@@ -0,0 +1,33 @@
-+Binding for Broadcom BCM6348/BCM6358 SPI controller
-+
-+Required properties:
-+- compatible: must contain one of "brcm,bcm6348-spi", "brcm,bcm6358-spi".
-+- reg: Base address and size of the controllers memory area.
-+- interrupts: Interrupt for the SPI block.
-+- clocks: phandle of the SPI clock.
-+- clock-names: has to be "spi".
-+- #address-cells: <1>, as required by generic SPI binding.
-+- #size-cells: <0>, also as required by generic SPI binding.
-+
-+Optional properties:
-+- num-cs: some controllers have less than 8 cs signals. Defaults to 8
-+  if absent.
-+
-+Child nodes as per the generic SPI binding.
-+
-+Example:
-+
-+      spi@10000800 {
-+              compatible = "brcm,bcm6368-spi", "brcm,bcm6358-spi";
-+              reg = <0x10000800 0x70c>;
-+
-+              interrupts = <1>;
-+
-+              clocks = <&clkctl 9>;
-+              clock-names = "spi";
-+
-+              num-cs = <5>;
-+
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+      };
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch
deleted file mode 100644 (file)
index 5105462..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-From 3353228a04a004ec67073871f40cf58dc4e209aa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Mon, 7 Sep 2015 21:01:38 +0200
-Subject: [PATCH 4/8] spi/bcm63xx: add support for probing through devicetree
-
-Add required binding support to probe through device tree.
-
-Use the compatible instead of the resource size for identifiying the
-block type, and allow reducing the number of cs lines through OF.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx.c | 42 ++++++++++++++++++++++++++++++++++++------
- 1 file changed, 36 insertions(+), 6 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -26,6 +26,7 @@
- #include <linux/completion.h>
- #include <linux/err.h>
- #include <linux/pm_runtime.h>
-+#include <linux/of.h>
- /* BCM 6338/6348 SPI core */
- #define SPI_6348_RSET_SIZE            64
-@@ -485,21 +486,48 @@ static const struct platform_device_id b
-       },
- };
-+static const struct of_device_id bcm63xx_spi_of_match[] = {
-+      { .compatible = "brcm,bcm6348-spi", .data = &bcm6348_spi_reg_offsets },
-+      { .compatible = "brcm,bcm6358-spi", .data = &bcm6358_spi_reg_offsets },
-+      { },
-+};
-+
- static int bcm63xx_spi_probe(struct platform_device *pdev)
- {
-       struct resource *r;
-       const unsigned long *bcm63xx_spireg;
-       struct device *dev = &pdev->dev;
--      int irq;
-+      int irq, bus_num;
-       struct spi_master *master;
-       struct clk *clk;
-       struct bcm63xx_spi *bs;
-       int ret;
-+      u32 num_cs = BCM63XX_SPI_MAX_CS;
--      if (!pdev->id_entry->driver_data)
--              return -EINVAL;
-+      if (dev->of_node) {
-+              const struct of_device_id *match;
--      bcm63xx_spireg = (const unsigned long *)pdev->id_entry->driver_data;
-+              match = of_match_node(bcm63xx_spi_of_match, dev->of_node);
-+              if (!match)
-+                      return -EINVAL;
-+              bcm63xx_spireg = match->data;
-+
-+              of_property_read_u32(dev->of_node, "num-cs", &num_cs);
-+              if (num_cs > BCM63XX_SPI_MAX_CS) {
-+                      dev_warn(dev, "unsupported number of cs (%i), reducing to 8\n",
-+                               num_cs);
-+                      num_cs = BCM63XX_SPI_MAX_CS;
-+              }
-+
-+              bus_num = -1;
-+      } else if (pdev->id_entry->driver_data) {
-+              const struct platform_device_id *match = pdev->id_entry;
-+
-+              bcm63xx_spireg = (const unsigned long *)match->driver_data;
-+              bus_num = BCM63XX_SPI_BUS_NUM;
-+      } else {
-+              return -EINVAL;
-+      }
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-@@ -544,8 +572,9 @@ static int bcm63xx_spi_probe(struct plat
-               goto out_err;
-       }
--      master->bus_num = BCM63XX_SPI_BUS_NUM;
--      master->num_chipselect = BCM63XX_SPI_MAX_CS;
-+      master->dev.of_node = dev->of_node;
-+      master->bus_num = bus_num;
-+      master->num_chipselect = num_cs;
-       master->transfer_one_message = bcm63xx_spi_transfer_one;
-       master->mode_bits = MODEBITS;
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
-@@ -634,6 +663,7 @@ static struct platform_driver bcm63xx_sp
-       .driver = {
-               .name   = "bcm63xx-spi",
-               .pm     = &bcm63xx_spi_pm_ops,
-+              .of_match_table = bcm63xx_spi_of_match,
-       },
-       .id_table       = bcm63xx_spi_dev_match,
-       .probe          = bcm63xx_spi_probe,
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch
deleted file mode 100644 (file)
index 30e6734..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From d03f23df6ff47898d76f06b3aa5dadcfa1ec8f4f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 19 Feb 2017 23:40:22 +0100
-Subject: [PATCH 1/3] spi/bcm63xx-hsspi: allow providing clock rate through a
- second clock
-
-Instead of requiring the hsspi clock to have a rate, allow using a second
-clock for providing the Hz rate, which is probably more correct anyway.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx-hsspi.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx-hsspi.c
-+++ b/drivers/spi/spi-bcm63xx-hsspi.c
-@@ -351,8 +351,16 @@ static int bcm63xx_hsspi_probe(struct pl
-               return PTR_ERR(clk);
-       rate = clk_get_rate(clk);
--      if (!rate)
--              return -EINVAL;
-+      if (!rate) {
-+              struct clk *pll_clk = devm_clk_get(dev, "pll");
-+
-+              if (IS_ERR(pll_clk))
-+                      return PTR_ERR(pll_clk);
-+
-+              rate = clk_get_rate(pll_clk);
-+              if (!rate)
-+                      return -EINVAL;
-+      }
-       ret = clk_prepare_enable(clk);
-       if (ret)
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch
deleted file mode 100644 (file)
index 8f77f4e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From ff759cc25db31bbb3469abb16a0306f110c4c7fa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 10 Sep 2015 14:52:32 +0200
-Subject: [PATCH 2/3] dt-bindings: spi: document bcm63xx HS SPI devicetree
- bindings
-
-Add documentation for the bindings of the high speed SPI controller found
-on newer bcm63xx SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../devicetree/bindings/spi/spi-bcm63xx-hsspi.txt  | 33 ++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx-hsspi.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/spi/spi-bcm63xx-hsspi.txt
-@@ -0,0 +1,33 @@
-+Binding for Broadcom BCM6328 High Speed SPI controller
-+
-+Required properties:
-+- compatible: must contain of "brcm,bcm6328-hsspi".
-+- reg: Base address and size of the controllers memory area.
-+- interrupts: Interrupt for the SPI block.
-+- clocks: phandles of the SPI clock and the PLL clock.
-+- clock-names: must be "hsspi", "pll".
-+- #address-cells: <1>, as required by generic SPI binding.
-+- #size-cells: <0>, also as required by generic SPI binding.
-+
-+Optional properties:
-+- num-cs: some controllers have less than 8 cs signals. Defaults to 8
-+  if absent.
-+
-+Child nodes as per the generic SPI binding.
-+
-+Example:
-+
-+      spi@10001000 {
-+              compatible = "brcm,bcm6328-hsspi";
-+              reg = <0x10001000 0x600>;
-+
-+              interrupts = <29>;
-+
-+              clocks = <&clkctl 9>, <&hsspi_pll>;
-+              clock-names = "hsspi", "pll";
-+
-+              num-cs = <2>;
-+
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+      };
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch
deleted file mode 100644 (file)
index aaf4a59..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-From 776041498c2b285a7f745c924e10fc11ef720eae Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 10 Sep 2015 14:53:53 +0200
-Subject: [PATCH 3/3] spi/bcm63xx-hsspi: allow for probing through devicetree
-
-Add required binding support to probe through device tree.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx-hsspi.c | 23 ++++++++++++++++++++---
- 1 file changed, 20 insertions(+), 3 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx-hsspi.c
-+++ b/drivers/spi/spi-bcm63xx-hsspi.c
-@@ -19,6 +19,7 @@
- #include <linux/interrupt.h>
- #include <linux/spi/spi.h>
- #include <linux/mutex.h>
-+#include <linux/of.h>
- #define HSSPI_GLOBAL_CTRL_REG                 0x0
- #define GLOBAL_CTRL_CS_POLARITY_SHIFT         0
-@@ -91,6 +92,7 @@
- #define HSSPI_MAX_SYNC_CLOCK                  30000000
-+#define HSSPI_SPI_MAX_CS                      8
- #define HSSPI_BUS_NUM                         1 /* 0 is legacy SPI */
- struct bcm63xx_hsspi {
-@@ -332,7 +334,7 @@ static int bcm63xx_hsspi_probe(struct pl
-       struct device *dev = &pdev->dev;
-       struct clk *clk;
-       int irq, ret;
--      u32 reg, rate;
-+      u32 reg, rate, num_cs = HSSPI_SPI_MAX_CS;
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-@@ -382,8 +384,17 @@ static int bcm63xx_hsspi_probe(struct pl
-       mutex_init(&bs->bus_mutex);
-       init_completion(&bs->done);
--      master->bus_num = HSSPI_BUS_NUM;
--      master->num_chipselect = 8;
-+      master->dev.of_node = dev->of_node;
-+      if (!dev->of_node)
-+              master->bus_num = HSSPI_BUS_NUM;
-+
-+      of_property_read_u32(dev->of_node, "num-cs", &num_cs);
-+      if (num_cs > 8) {
-+              dev_warn(dev, "unsupported number of cs (%i), reducing to 8\n",
-+                       num_cs);
-+              num_cs = HSSPI_SPI_MAX_CS;
-+      }
-+      master->num_chipselect = num_cs;
-       master->setup = bcm63xx_hsspi_setup;
-       master->transfer_one_message = bcm63xx_hsspi_transfer_one;
-       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |
-@@ -469,10 +480,16 @@ static int bcm63xx_hsspi_resume(struct d
- static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
-                        bcm63xx_hsspi_resume);
-+static const struct of_device_id bcm63xx_hsspi_of_match[] = {
-+      { .compatible = "brcm,bcm6328-hsspi", },
-+      { },
-+};
-+
- static struct platform_driver bcm63xx_hsspi_driver = {
-       .driver = {
-               .name   = "bcm63xx-hsspi",
-               .pm     = &bcm63xx_hsspi_pm_ops,
-+              .of_match_table = bcm63xx_hsspi_of_match,
-       },
-       .probe          = bcm63xx_hsspi_probe,
-       .remove         = bcm63xx_hsspi_remove,
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch
deleted file mode 100644 (file)
index aa813f3..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-From 69226896ad636b94f6d2e55d75ff21a29c4de83b Mon Sep 17 00:00:00 2001
-From: Roger Quadros <rogerq@ti.com>
-Date: Fri, 21 Apr 2017 16:15:38 +0300
-Subject: [PATCH] mdio_bus: Issue GPIO RESET to PHYs.
-
-Some boards [1] leave the PHYs at an invalid state
-during system power-up or reset thus causing unreliability
-issues with the PHY which manifests as PHY not being detected
-or link not functional. To fix this, these PHYs need to be RESET
-via a GPIO connected to the PHY's RESET pin.
-
-Some boards have a single GPIO controlling the PHY RESET pin of all
-PHYs on the bus whereas some others have separate GPIOs controlling
-individual PHY RESETs.
-
-In both cases, the RESET de-assertion cannot be done in the PHY driver
-as the PHY will not probe till its reset is de-asserted.
-So do the RESET de-assertion in the MDIO bus driver.
-
-[1] - am572x-idk, am571x-idk, a437x-idk
-
-Signed-off-by: Roger Quadros <rogerq@ti.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- Documentation/devicetree/bindings/net/mdio.txt | 33 ++++++++++++++++++
- drivers/net/phy/mdio_bus.c                     | 47 ++++++++++++++++++++++++++
- drivers/of/of_mdio.c                           |  7 ++++
- include/linux/phy.h                            |  7 ++++
- 4 files changed, 94 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/net/mdio.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/net/mdio.txt
-@@ -0,0 +1,33 @@
-+Common MDIO bus properties.
-+
-+These are generic properties that can apply to any MDIO bus.
-+
-+Optional properties:
-+- reset-gpios: List of one or more GPIOs that control the RESET lines
-+  of the PHYs on that MDIO bus.
-+- reset-delay-us: RESET pulse width in microseconds as per PHY datasheet.
-+
-+A list of child nodes, one per device on the bus is expected. These
-+should follow the generic phy.txt, or a device specific binding document.
-+
-+Example :
-+This example shows these optional properties, plus other properties
-+required for the TI Davinci MDIO driver.
-+
-+      davinci_mdio: ethernet@0x5c030000 {
-+              compatible = "ti,davinci_mdio";
-+              reg = <0x5c030000 0x1000>;
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+
-+              reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
-+              reset-delay-us = <2>;   /* PHY datasheet states 1us min */
-+
-+              ethphy0: ethernet-phy@1 {
-+                      reg = <1>;
-+              };
-+
-+              ethphy1: ethernet-phy@3 {
-+                      reg = <3>;
-+              };
-+      };
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -22,8 +22,11 @@
- #include <linux/init.h>
- #include <linux/delay.h>
- #include <linux/device.h>
-+#include <linux/gpio.h>
-+#include <linux/gpio/consumer.h>
- #include <linux/of_device.h>
- #include <linux/of_mdio.h>
-+#include <linux/of_gpio.h>
- #include <linux/netdevice.h>
- #include <linux/etherdevice.h>
- #include <linux/skbuff.h>
-@@ -252,6 +255,7 @@ static inline void of_mdiobus_link_phyde
- int __mdiobus_register(struct mii_bus *bus, struct module *owner)
- {
-       int i, err;
-+      struct gpio_desc *gpiod;
-       if (NULL == bus || NULL == bus->name ||
-           NULL == bus->read || NULL == bus->write)
-@@ -278,6 +282,35 @@ int __mdiobus_register(struct mii_bus *b
-       if (bus->reset)
-               bus->reset(bus);
-+      /* de-assert bus level PHY GPIO resets */
-+      if (bus->num_reset_gpios > 0) {
-+              bus->reset_gpiod = devm_kcalloc(&bus->dev,
-+                                               bus->num_reset_gpios,
-+                                               sizeof(struct gpio_desc *),
-+                                               GFP_KERNEL);
-+              if (!bus->reset_gpiod)
-+                      return -ENOMEM;
-+      }
-+
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              gpiod = devm_gpiod_get_index(&bus->dev, "reset", i,
-+                                           GPIOD_OUT_LOW);
-+              if (IS_ERR(gpiod)) {
-+                      err = PTR_ERR(gpiod);
-+                      if (err != -ENOENT) {
-+                              dev_err(&bus->dev,
-+                                      "mii_bus %s couldn't get reset GPIO\n",
-+                                      bus->id);
-+                              return err;
-+                      }
-+              } else {
-+                      bus->reset_gpiod[i] = gpiod;
-+                      gpiod_set_value_cansleep(gpiod, 1);
-+                      udelay(bus->reset_delay_us);
-+                      gpiod_set_value_cansleep(gpiod, 0);
-+              }
-+      }
-+
-       for (i = 0; i < PHY_MAX_ADDR; i++) {
-               if ((bus->phy_mask & (1 << i)) == 0) {
-                       struct phy_device *phydev;
-@@ -302,6 +335,13 @@ error:
-                       phy_device_free(phydev);
-               }
-       }
-+
-+      /* Put PHYs in RESET to save power */
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              if (bus->reset_gpiod[i])
-+                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
-+      }
-+
-       device_del(&bus->dev);
-       return err;
- }
-@@ -321,6 +361,13 @@ void mdiobus_unregister(struct mii_bus *
-                       phy_device_free(phydev);
-               }
-       }
-+
-+      /* Put PHYs in RESET to save power */
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              if (bus->reset_gpiod[i])
-+                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
-+      }
-+
-       device_del(&bus->dev);
- }
- EXPORT_SYMBOL(mdiobus_unregister);
---- a/drivers/of/of_mdio.c
-+++ b/drivers/of/of_mdio.c
-@@ -21,6 +21,8 @@
- #include <linux/of_mdio.h>
- #include <linux/module.h>
-+#define DEFAULT_GPIO_RESET_DELAY      10      /* in microseconds */
-+
- MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
- MODULE_LICENSE("GPL");
-@@ -140,6 +142,11 @@ int of_mdiobus_register(struct mii_bus *
-       mdio->dev.of_node = np;
-+      /* Get bus level PHY reset GPIO details */
-+      mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY;
-+      of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us);
-+      mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios");
-+
-       /* Register the MDIO bus */
-       rc = mdiobus_register(mdio);
-       if (rc)
---- a/include/linux/phy.h
-+++ b/include/linux/phy.h
-@@ -187,6 +187,13 @@ struct mii_bus {
-        * interrupt at the index matching its address
-        */
-       int *irq;
-+
-+      /* GPIO reset pulse width in microseconds */
-+      int reset_delay_us;
-+      /* Number of reset GPIOs */
-+      int num_reset_gpios;
-+      /* Array of RESET GPIO descriptors */
-+      struct gpio_desc **reset_gpiod;
- };
- #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch
deleted file mode 100644 (file)
index 5788a37..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-From df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <f.fainelli@gmail.com>
-Date: Thu, 11 May 2017 11:24:16 -0700
-Subject: [PATCH] net: phy: Call bus->reset() after releasing PHYs from reset
-
-The API convention makes it that a given MDIO bus reset should be able
-to access PHY devices in its reset() callback and perform additional
-MDIO accesses in order to bring the bus and PHYs in a working state.
-
-Commit 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that
-contract by first calling bus->reset() and then release all PHYs from
-reset using their shared GPIO line, so restore the expected
-functionality here.
-
-Fixes: 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.")
-Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/phy/mdio_bus.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -279,9 +279,6 @@ int __mdiobus_register(struct mii_bus *b
-       mutex_init(&bus->mdio_lock);
--      if (bus->reset)
--              bus->reset(bus);
--
-       /* de-assert bus level PHY GPIO resets */
-       if (bus->num_reset_gpios > 0) {
-               bus->reset_gpiod = devm_kcalloc(&bus->dev,
-@@ -311,6 +308,9 @@ int __mdiobus_register(struct mii_bus *b
-               }
-       }
-+      if (bus->reset)
-+              bus->reset(bus);
-+
-       for (i = 0; i < PHY_MAX_ADDR; i++) {
-               if ((bus->phy_mask & (1 << i)) == 0) {
-                       struct phy_device *phydev;
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch
deleted file mode 100644 (file)
index d8a5a39..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From dc90895d776d7b8017bc3b14f588d569d8edbe1f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 11 May 2017 13:36:52 +0200
-Subject: [PATCH] leds: bcm6328: fix signal source assignment for high leds
-
-Each nibble represents 4 LEDs, and in case of the higher register, bit 0
-represents LED 4, so we need to use modulus for the LED number as well.
-
-Fixes: fd7b025a238d0a5440bfa26c585eb78097bf48dc ("leds: add BCM6328 LED driver")
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/leds/leds-bcm6328.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/leds/leds-bcm6328.c
-+++ b/drivers/leds/leds-bcm6328.c
-@@ -224,7 +224,7 @@ static int bcm6328_hwled(struct device *
-               spin_lock_irqsave(lock, flags);
-               val = bcm6328_led_read(addr);
--              val |= (BIT(reg) << (((sel % 4) * 4) + 16));
-+              val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16));
-               bcm6328_led_write(addr, val);
-               spin_unlock_irqrestore(lock, flags);
-       }
-@@ -251,7 +251,7 @@ static int bcm6328_hwled(struct device *
-               spin_lock_irqsave(lock, flags);
-               val = bcm6328_led_read(addr);
--              val |= (BIT(reg) << ((sel % 4) * 4));
-+              val |= (BIT(reg % 4) << ((sel % 4) * 4));
-               bcm6328_led_write(addr, val);
-               spin_unlock_irqrestore(lock, flags);
-       }
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch
deleted file mode 100644 (file)
index 7ce5eb5..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-From d396e84c56047b303cac378dde4b2e5cc430b336 Mon Sep 17 00:00:00 2001
-From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
-Date: Mon, 12 Jun 2017 23:55:38 +0300
-Subject: [PATCH] mdio_bus: handle only single PHY reset GPIO
-
-Commit 4c5e7a2c0501 ("dt-bindings: mdio: Clarify binding document")
-declared that a MDIO reset GPIO property should have only a single GPIO
-reference/specifier, however the supporting code was left intact, still
-burdening the kernel with now apparently useless loops -- get rid of them.
-
-Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/phy/mdio_bus.c | 53 +++++++++++++++++-----------------------------
- drivers/of/of_mdio.c       |  1 -
- include/linux/phy.h        |  6 ++----
- 3 files changed, 21 insertions(+), 39 deletions(-)
-
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -279,33 +279,22 @@ int __mdiobus_register(struct mii_bus *b
-       mutex_init(&bus->mdio_lock);
--      /* de-assert bus level PHY GPIO resets */
--      if (bus->num_reset_gpios > 0) {
--              bus->reset_gpiod = devm_kcalloc(&bus->dev,
--                                               bus->num_reset_gpios,
--                                               sizeof(struct gpio_desc *),
--                                               GFP_KERNEL);
--              if (!bus->reset_gpiod)
--                      return -ENOMEM;
--      }
--
--      for (i = 0; i < bus->num_reset_gpios; i++) {
--              gpiod = devm_gpiod_get_index(&bus->dev, "reset", i,
--                                           GPIOD_OUT_LOW);
--              if (IS_ERR(gpiod)) {
--                      err = PTR_ERR(gpiod);
--                      if (err != -ENOENT) {
--                              dev_err(&bus->dev,
--                                      "mii_bus %s couldn't get reset GPIO\n",
--                                      bus->id);
--                              return err;
--                      }
--              } else {
--                      bus->reset_gpiod[i] = gpiod;
--                      gpiod_set_value_cansleep(gpiod, 1);
--                      udelay(bus->reset_delay_us);
--                      gpiod_set_value_cansleep(gpiod, 0);
-+      /* de-assert bus level PHY GPIO reset */
-+      gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW);
-+      if (IS_ERR(gpiod)) {
-+              err = PTR_ERR(gpiod);
-+              if (err != -ENOENT) {
-+                      dev_err(&bus->dev,
-+                              "mii_bus %s couldn't get reset GPIO\n",
-+                              bus->id);
-+                      return err;
-               }
-+      } else  {
-+              bus->reset_gpiod = gpiod;
-+
-+              gpiod_set_value_cansleep(gpiod, 1);
-+              udelay(bus->reset_delay_us);
-+              gpiod_set_value_cansleep(gpiod, 0);
-       }
-       if (bus->reset)
-@@ -337,10 +326,8 @@ error:
-       }
-       /* Put PHYs in RESET to save power */
--      for (i = 0; i < bus->num_reset_gpios; i++) {
--              if (bus->reset_gpiod[i])
--                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
--      }
-+      if (bus->reset_gpiod)
-+              gpiod_set_value_cansleep(bus->reset_gpiod, 1);
-       device_del(&bus->dev);
-       return err;
-@@ -363,10 +350,8 @@ void mdiobus_unregister(struct mii_bus *
-       }
-       /* Put PHYs in RESET to save power */
--      for (i = 0; i < bus->num_reset_gpios; i++) {
--              if (bus->reset_gpiod[i])
--                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
--      }
-+      if (bus->reset_gpiod)
-+              gpiod_set_value_cansleep(bus->reset_gpiod, 1);
-       device_del(&bus->dev);
- }
---- a/drivers/of/of_mdio.c
-+++ b/drivers/of/of_mdio.c
-@@ -145,7 +145,6 @@ int of_mdiobus_register(struct mii_bus *
-       /* Get bus level PHY reset GPIO details */
-       mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY;
-       of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us);
--      mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios");
-       /* Register the MDIO bus */
-       rc = mdiobus_register(mdio);
---- a/include/linux/phy.h
-+++ b/include/linux/phy.h
-@@ -190,10 +190,8 @@ struct mii_bus {
-       /* GPIO reset pulse width in microseconds */
-       int reset_delay_us;
--      /* Number of reset GPIOs */
--      int num_reset_gpios;
--      /* Array of RESET GPIO descriptors */
--      struct gpio_desc **reset_gpiod;
-+      /* RESET GPIO descriptor pointer */
-+      struct gpio_desc *reset_gpiod;
- };
- #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch
deleted file mode 100644 (file)
index d7ac623..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From fe0e4052fb11d5c713961ab7e136520be40052a3 Mon Sep 17 00:00:00 2001
-From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
-Date: Mon, 12 Jun 2017 23:55:39 +0300
-Subject: [PATCH] mdio_bus: use devm_gpiod_get_optional()
-
-The MDIO reset GPIO is really a classical optional GPIO property case,
-so devm_gpiod_get_optional() should have been used, not devm_gpiod_get().
-Doing this  saves several LoCs...
-
-Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/phy/mdio_bus.c | 14 +++++---------
- 1 file changed, 5 insertions(+), 9 deletions(-)
-
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -280,16 +280,12 @@ int __mdiobus_register(struct mii_bus *b
-       mutex_init(&bus->mdio_lock);
-       /* de-assert bus level PHY GPIO reset */
--      gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW);
-+      gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW);
-       if (IS_ERR(gpiod)) {
--              err = PTR_ERR(gpiod);
--              if (err != -ENOENT) {
--                      dev_err(&bus->dev,
--                              "mii_bus %s couldn't get reset GPIO\n",
--                              bus->id);
--                      return err;
--              }
--      } else  {
-+              dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n",
-+                      bus->id);
-+              return PTR_ERR(gpiod);
-+      } else  if (gpiod) {
-               bus->reset_gpiod = gpiod;
-               gpiod_set_value_cansleep(gpiod, 1);
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch
deleted file mode 100644 (file)
index 08511d6..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-From e74caf41aec5338b8cbbd0a1483650848f16f532 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:23:47 +0200
-Subject: [PATCH V2 1/8] MIPS: BCM63XX: add clkdev lookup support
-
-Enable clkdev lookup support to allow us providing clocks under
-different names to devices more easily, so we don't need to care
-about clock name clashes anymore.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/Kconfig       |   1 +
- arch/mips/bcm63xx/clk.c | 150 +++++++++++++++++++++++++++++++++++++-----------
- 2 files changed, 116 insertions(+), 35 deletions(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -214,6 +214,7 @@ config BCM63XX
-       select ARCH_REQUIRE_GPIOLIB
-       select HAVE_CLK
-       select MIPS_L1_CACHE_SHIFT_4
-+      select CLKDEV_LOOKUP
-       help
-        Support for BCM63XX based boards
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -10,6 +10,7 @@
- #include <linux/mutex.h>
- #include <linux/err.h>
- #include <linux/clk.h>
-+#include <linux/clkdev.h>
- #include <linux/delay.h>
- #include <bcm63xx_cpu.h>
- #include <bcm63xx_io.h>
-@@ -352,44 +353,103 @@ long clk_round_rate(struct clk *clk, uns
- }
- EXPORT_SYMBOL_GPL(clk_round_rate);
--struct clk *clk_get(struct device *dev, const char *id)
--{
--      if (!strcmp(id, "enet0"))
--              return &clk_enet0;
--      if (!strcmp(id, "enet1"))
--              return &clk_enet1;
--      if (!strcmp(id, "enetsw"))
--              return &clk_enetsw;
--      if (!strcmp(id, "ephy"))
--              return &clk_ephy;
--      if (!strcmp(id, "usbh"))
--              return &clk_usbh;
--      if (!strcmp(id, "usbd"))
--              return &clk_usbd;
--      if (!strcmp(id, "spi"))
--              return &clk_spi;
--      if (!strcmp(id, "hsspi"))
--              return &clk_hsspi;
--      if (!strcmp(id, "xtm"))
--              return &clk_xtm;
--      if (!strcmp(id, "periph"))
--              return &clk_periph;
--      if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
--              return &clk_pcm;
--      if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
--              return &clk_ipsec;
--      if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
--              return &clk_pcie;
--      return ERR_PTR(-ENOENT);
--}
--
--EXPORT_SYMBOL(clk_get);
--
--void clk_put(struct clk *clk)
--{
--}
--
--EXPORT_SYMBOL(clk_put);
-+static struct clk_lookup bcm3368_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+};
-+
-+static struct clk_lookup bcm6328_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
-+      CLKDEV_INIT(NULL, "pcie", &clk_pcie),
-+};
-+
-+static struct clk_lookup bcm6338_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6345_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6348_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6358_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+};
-+
-+static struct clk_lookup bcm6362_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
-+      CLKDEV_INIT(NULL, "pcie", &clk_pcie),
-+      CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
-+};
-+
-+static struct clk_lookup bcm6368_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "xtm", &clk_xtm),
-+      CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
-+};
- #define HSSPI_PLL_HZ_6328     133333333
- #define HSSPI_PLL_HZ_6362     400000000
-@@ -397,11 +457,31 @@ EXPORT_SYMBOL(clk_put);
- static int __init bcm63xx_clk_init(void)
- {
-       switch (bcm63xx_get_cpu_id()) {
-+      case BCM3368_CPU_ID:
-+              clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
-+              break;
-       case BCM6328_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6328;
-+              clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
-+              break;
-+      case BCM6338_CPU_ID:
-+              clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks));
-+              break;
-+      case BCM6345_CPU_ID:
-+              clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks));
-+              break;
-+      case BCM6348_CPU_ID:
-+              clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks));
-+              break;
-+      case BCM6358_CPU_ID:
-+              clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
-               break;
-       case BCM6362_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6362;
-+              clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
-+              break;
-+      case BCM6368_CPU_ID:
-+              clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks));
-               break;
-       }
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch
deleted file mode 100644 (file)
index 2b3ca16..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-From d0322bf7bebe87012b4f95c85be6b5ba0cb6f344 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:31:44 +0200
-Subject: [PATCH V2 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart
-
-Add a lookup as "refclk" to describe its function for the uarts.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -356,6 +356,8 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
- static struct clk_lookup bcm3368_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -369,6 +371,8 @@ static struct clk_lookup bcm3368_clks[]
- static struct clk_lookup bcm6328_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -380,6 +384,7 @@ static struct clk_lookup bcm6328_clks[]
- static struct clk_lookup bcm6338_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -392,6 +397,7 @@ static struct clk_lookup bcm6338_clks[]
- static struct clk_lookup bcm6345_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -404,6 +410,7 @@ static struct clk_lookup bcm6345_clks[]
- static struct clk_lookup bcm6348_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -416,6 +423,8 @@ static struct clk_lookup bcm6348_clks[]
- static struct clk_lookup bcm6358_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -429,6 +438,8 @@ static struct clk_lookup bcm6358_clks[]
- static struct clk_lookup bcm6362_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -442,6 +453,8 @@ static struct clk_lookup bcm6362_clks[]
- static struct clk_lookup bcm6368_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch
deleted file mode 100644 (file)
index 5152fbe..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 8124706e6040b1cf0d2dd3a05759df6cec4bddfb Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:32:37 +0200
-Subject: [PATCH V2 3/8] tty/bcm63xx_uart: use refclk for the expected clock
- name
-
-We now have the clock available under refclk, so use that.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/tty/serial/bcm63xx_uart.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/tty/serial/bcm63xx_uart.c
-+++ b/drivers/tty/serial/bcm63xx_uart.c
-@@ -842,7 +842,7 @@ static int bcm_uart_probe(struct platfor
-               return -ENODEV;
-