[PATCH net-next v2 0/3] add support for RGMII on GMAC0 through TRGMII hardware module

2016-09-21 Thread sean.wang
From: Sean Wang By default, GMAC0 is connected to built-in switch called MT7530 through the proprietary interface called Turbo RGMII (TRGMII). TRGMII also supports well for RGMII as generic external PHY uses but requires some slight changes to the setup of TRGMII and doesn't have well support on

[PATCH net-next v2 1/3] net: ethernet: mediatek: add extension of phy-mode for TRGMII

2016-09-21 Thread sean.wang
From: Sean Wang adds PHY-mode "trgmii" as an extension for the operation mode of the PHY interface for PHY_INTERFACE_MODE_TRGMII. and adds a variable trgmii inside mtk_mac as the indication to make the difference between the MAC connected to internal switch or connected to external PHY by the giv

[PATCH net-next v2 3/3] net: ethernet: mediatek: add the dts property to set if TRGMII supported on GMAC0

2016-09-21 Thread sean.wang
From: Sean Wang Add the dts property for the capability if TRGMII supported on GAMC0 Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/mediatek-net.tx

[PATCH net-next v2 2/3] net: ethernet: mediatek: add support for GMAC0 connecting with external PHY through TRGMII

2016-09-21 Thread sean.wang
From: Sean Wang Changing dynamically source clock, TX/RX delay and interface mode used by TRGMII hardware module inside PHY capability polling routine for adapting to the various speed of RGMII used by external PHY for GMAC0. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_s

[PATCH net-next] net: ethernet: mediatek: use phydev from struct net_device

2016-09-22 Thread sean.wang
From: Sean Wang reuse phydev already in struct net_device instead of creating another new one in private structure. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 73 ++--- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 - 2 files changed,

[PATCH net-next] net: ethernet: mediatek: remove superfluous local variable for phy address

2016-09-22 Thread sean.wang
From: Sean Wang remove the unused variable for parsing PHY address and the related logic for sanity test which would be all already handled done when of_mdiobus_register was called Reported-by: Nelson Chang Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 10 +---

[PATCH net-next] net: ethernet: mediatek: use [get|set]_link_ksettings

2016-09-22 Thread sean.wang
From: Sean Wang 1) use new api [get|set]_link_ksettings instead of [get|set]_settings old ones. 2) dev->phydev is sure being ready before calling these callbacks, so removing all the sanity check if it is existing. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 33

[PATCH net-next] net: ethernet: mediatek: get out of potential invalid pointer access

2016-09-22 Thread sean.wang
From: Sean Wang Potential dangerous invalid pointer might be accessed if the error happens when couple phy_device to net_device so cleanup the error path. Signed-off-by: Sean Wang --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH net-next] Documentation: devicetree: revise ethernet device-tree binding about TRGMII

2016-09-22 Thread sean.wang
From: Sean Wang fix typo in mediatek-net.txt and add phy-mode "trgmii" to ethernet.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/ethernet.txt | 4 ++-- Documentation/devicetree/bindings/net/mediatek-net.t

[PATCH net-next v2] Documentation: devicetree: revise ethernet device-tree binding about TRGMII

2016-09-22 Thread sean.wang
From: Sean Wang add phy-mode "trgmii" to Documentation/devicetree/bindings/net/ethernet.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/ethernet.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) di

[PATCH net-next] Documentation: devicetree: fix typo in MediaTek ethernet device-tree binding

2016-09-22 Thread sean.wang
From: Sean Wang fix typo in Documentation/devicetree/bindings/net/mediatek-net.txt Cc: devicet...@vger.kernel.org Reported-by: Sergei Shtylyov Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/net/mediatek-net.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 2/2] arm: dts: mt7623: fixup binding violation missing reset in ethernet node

2017-06-21 Thread sean.wang
From: Sean Wang fix up binding violation where the reset property is required additionally. Cc: John Crispin Signed-off-by: Sean Wang --- arch/arm/boot/dts/mt7623.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi index 2

[PATCH 1/2] dt-bindings: net: mediatek: update documentation for reset signals

2017-06-21 Thread sean.wang
From: Sean Wang Since there's no user for the property reset inside the ethernet node for current supported MediaTek SoCs and boards, so it should be safe to update reset property in the bindings to introduce more reset signals as corresponding that commit 7c2adaf11036 ("reset: mediatek: Add MT27

[PATCH 0/2] fixed ethernet binding violation for reset signal

2017-06-21 Thread sean.wang
From: Sean Wang Fixed binding violation and also updated related binding documentation to reflect the reset signals the MediaTek Ethernet requires. Sean Wang (2): dt-bindings: net: mediatek: update documentation for reset signals arm: dts: mt7623: fixup binding violation missing reset in eth

[PATCH v5 0/7] Add PMIC support to MediaTek MT7622 SoC

2017-10-16 Thread sean.wang
From: Sean Wang Changes since v4: - for patch 1/7 and 5/7, add the description about how to bind pmic wrapper with MT6380. - for patch 3/7, add more comments explaining why additional pwrap_read is required in the pwrap_write32. - for patch 4/7 and 5/7, refactoring pwrap_init would help the dri

[PATCH v5 7/7] soc: mediatek: pwrap: fixup warnings from coding style

2017-10-16 Thread sean.wang
From: Sean Wang fixup those warnings such as lines over 80 words and parenthesis alignment which would be complained by checkpatch.pl. Signed-off-by: Sean Wang --- drivers/soc/mediatek/mtk-pmic-wrap.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dri

[PATCH v5 5/7] soc: mediatek: pwrap: add MediaTek MT6380 as one slave of pwrap

2017-10-16 Thread sean.wang
From: Sean Wang Add MediaTek MT6380 regulator becoming one of PMIC wrapper slave and also add extra new regmap_config of 32-bit mode for MT6380 since old regmap_config of 16-bit mode can't be fit into the need. Signed-off-by: Chenglin Xu Signed-off-by: Chen Zhong Signed-off-by: Sean Wang ---

[PATCH v5 6/7] soc: mediatek: pwrap: add support for MT7622 SoC

2017-10-16 Thread sean.wang
From: Chenglin Xu Add the registers, callbacks and data structures required to make the PMIC wrapper work on MT7622. Signed-off-by: Chenglin Xu Signed-off-by: Chen Zhong Signed-off-by: Sean Wang --- drivers/soc/mediatek/mtk-pmic-wrap.c | 180 +++ 1 file change

[PATCH v5 2/7] soc: mediatek: pwrap: add pwrap_read32 for reading in 32-bit mode

2017-10-16 Thread sean.wang
From: Sean Wang Some regulators such as MediaTek MT6380 has to be read in 32-bit mode. So the patch adds pwrap_read32, rename old pwrap_read into pwrap_read16 and one function pointer is introduced for increasing flexibility allowing the determination which mode is used by the pwrap slave detecti

[PATCH v5 4/7] soc: mediatek: pwrap: refactor pwrap_init for the various PMIC types

2017-10-16 Thread sean.wang
From: Sean Wang pwrap initialization is highly associated with the base SoC and the target PMICs, so slight refactorization is made here for allowing pwrap_init to run on those PMICs with different capability from the previous MediaTek PMICs and the determination for the enablement of the pwrap c

[PATCH v5 3/7] soc: mediatek: pwrap: add pwrap_write32 for writing in 32-bit mode

2017-10-16 Thread sean.wang
From: Sean Wang Some regulators such as MediaTek MT6380 also has to be written in 32-bit mode. So the patch adds pwrap_write32, rename old pwrap_write into pwrap_write16 and one additional function pointer is introduced for increasing flexibility allowing the determination which mode is used by t

[PATCH v5 1/7] dt-bindings: arm: mediatek: add MT7622 string to the PMIC wrapper doc

2017-10-16 Thread sean.wang
From: Sean Wang Signed-off-by: Chenglin Xu Signed-off-by: Sean Wang Acked-by: Rob Herring --- Documentation/devicetree/bindings/soc/mediatek/pwrap.txt | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt b/Documenta

[PATCH v2 0/4] rtc: mediatek: add support for SoC based RTC on MT7622

2017-10-17 Thread sean.wang
From: Sean Wang Changes since v1: - Rename to rtc-mt7622.c from rtc-mediatek.c - Use [readl,writel]_relaxed instead of __raw_* version - Remove redundant register reading in mtk_rtc_get_alarm_or_time() - Stop alarm when alarm is really expired in mtk_rtc_alarmirq() - Extend the maximum year the R

[PATCH v2 4/4] rtc: mediatek: update MAINTAINERS entry with MediaTek RTC driver

2017-10-17 Thread sean.wang
From: Sean Wang I work for MediaTek on maintaining the MediaTek SoC based RTC driver for the existing SoCs and keep adding support for the following SoCs in the future. Cc: Eddie Huang Signed-off-by: Sean Wang --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS

[PATCH v2 1/4] dt-bindings: rtc: mediatek: add bindings for MediaTek SoC based RTC

2017-10-17 Thread sean.wang
From: Sean Wang Add device-tree binding for MediaTek SoC based RTC Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Acked-by: Rob Herring --- .../devicetree/bindings/rtc/rtc-mediatek.txt| 21 + 1 file changed, 21 insertions(+) create mode 100644 Documentati

[PATCH v2 2/4] rtc: mediatek: add driver for RTC on MT7622 SoC

2017-10-17 Thread sean.wang
From: Sean Wang This patch introduces the driver for the RTC on MT7622 SoC. Signed-off-by: Sean Wang --- drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-mt7622.c | 418 +++ 3 files changed, 429 insertions(+) crea

[PATCH v2 3/4] rtc: mediatek: enhance the description for MediaTek PMIC based RTC

2017-10-17 Thread sean.wang
From: Sean Wang Give a better description for original MediaTek RTC driver as PMIC based RTC in order to distinguish SoC based RTC. Also turning all words with Mediatek to MediaTek here. Cc: Eddie Huang Signed-off-by: Sean Wang Acked-by: Eddie Huang --- drivers/rtc/Kconfig | 8 1 fi

[PATCH v2 1/4] dt-bindings: mediatek: add bindings for MediaTek MT7622 SoC

2017-05-29 Thread sean.wang
From: Sean Wang This adds dt-binding documentation for MediaTek MT7622 SoC which currently only includes basic items such as ARM CPU, MediaTek SYSIRQ and UART. Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/arm/mediatek.txt| 4 .../devicetree/bindings/i

[PATCH v2 2/4] arm64: dts: mt7622: add basic nodes to the mt7622.dtsi file

2017-05-29 Thread sean.wang
From: Sean Wang add basic nodes into the mt7622.dtsi for the system bring-up which includes ARM CPU, GIC, timer, MediaTek UART, SYSIRQ and one reserved memory region for ATF. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 97 1 file cha

[PATCH v2 4/4] arm64: dts: mt7622: group clock DT nodes into separate DT file

2017-05-29 Thread sean.wang
From: Sean Wang For more readability and maintenance, all the clock related DT nodes for mt7622 SoC are grouped into a separate DT file. And currently mt7622-clock.dtsi only includes the fixed clock for uart0 and the oscillator which would be extended after MT7622 clock driver is introduced. Sig

[PATCH v2 0/4] Add Basic SoC support for MT7622

2017-05-29 Thread sean.wang
From: Sean Wang Changes since v1: - update SPDX-License-Identifier - remove next-level-cache property since cache geometry detection was removed since 4.12 This patch set adds basic SoC support for MediaTek MT7622 SoC based on 4.12-rc1. Sean Wang (4): dt-bindings: mediatek: add bindings for

[PATCH v2 3/4] arm64: dts: mt7622: add dts file for MT7622 reference board variant 1

2017-05-29 Thread sean.wang
From: Sean Wang Add the support for the MT7622 reference board variant 1 from MediaTek. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/Makefile| 1 + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 27 +++ 2 files changed, 28 insertions(+) create mod

[PATCH v6 3/7] soc: mediatek: pwrap: add pwrap_write32 for writing in 32-bit mode

2017-10-18 Thread sean.wang
From: Sean Wang Some regulators such as MediaTek MT6380 also has to be written in 32-bit mode. So the patch adds pwrap_write32, rename old pwrap_write into pwrap_write16 and one additional function pointer is introduced for increasing flexibility allowing the determination which mode is used by t

[PATCH v6 6/7] soc: mediatek: pwrap: add common way for setup CS timing extenstion

2017-10-18 Thread sean.wang
From: Sean Wang Multiple platforms would always use their own way handling CS timing extension on the bus which leads to a little bit code duplication. Therefore, the patch groups the similar logic to handle CS timing extension into the common function which allows the following SoCs have more re

[PATCH v6 7/7] soc: mediatek: pwrap: add support for MT7622 SoC

2017-10-18 Thread sean.wang
From: Chenglin Xu Add the registers, callbacks and data structures required to make the PMIC wrapper work on MT7622. Signed-off-by: Chenglin Xu Signed-off-by: Chen Zhong Signed-off-by: Sean Wang --- drivers/soc/mediatek/mtk-pmic-wrap.c | 170 +++ 1 file change

[PATCH v6 0/7] Add PMIC support to MediaTek MT7622 SoC

2017-10-18 Thread sean.wang
From: Sean Wang Changes since v5: - drop the merged patch - add a patch for common way handling for setup CS timing extension - unify the comment style Changes since v4: - for patch 1/7 and 5/7, add the description about how to bind pmic wrapper with MT6380. - for patch 3/7, add more comments e

[PATCH v6 5/7] soc: mediatek: pwrap: add MediaTek MT6380 as one slave of pwrap

2017-10-18 Thread sean.wang
From: Sean Wang Add MediaTek MT6380 regulator becoming one of PMIC wrapper slave and also add extra new regmap_config of 32-bit mode for MT6380 since old regmap_config of 16-bit mode can't be fit into the need. Signed-off-by: Chenglin Xu Signed-off-by: Chen Zhong Signed-off-by: Sean Wang ---

[PATCH v6 4/7] soc: mediatek: pwrap: refactor pwrap_init for the various PMIC types

2017-10-18 Thread sean.wang
From: Sean Wang pwrap initialization is highly associated with the base SoC and the target PMICs, so slight refactorization is made here for allowing pwrap_init to run on those PMICs with different capability from the previous MediaTek PMICs and the determination for the enablement of the pwrap c

[PATCH v6 1/7] dt-bindings: arm: mediatek: add MT7622 string to the PMIC wrapper doc

2017-10-18 Thread sean.wang
From: Sean Wang Signed-off-by: Chenglin Xu Signed-off-by: Sean Wang Acked-by: Rob Herring --- Documentation/devicetree/bindings/soc/mediatek/pwrap.txt | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/mediatek/pwrap.txt b/Documenta

[PATCH v6 2/7] soc: mediatek: pwrap: add pwrap_read32 for reading in 32-bit mode

2017-10-18 Thread sean.wang
From: Sean Wang Some regulators such as MediaTek MT6380 has to be read in 32-bit mode. So the patch adds pwrap_read32, rename old pwrap_read into pwrap_read16 and one function pointer is introduced for increasing flexibility allowing the determination which mode is used by the pwrap slave detecti

[PATCH] arm64: mediatek: cleanup message for platform selection

2017-10-19 Thread sean.wang
From: Sean Wang The latest kernel tree already can support more MediaTek platforms such as MT2712 and MT7622, so additional descriptions for those platforms are added and certain cleanups are also being made here. Signed-off-by: Sean Wang --- arch/arm64/Kconfig.platforms | 5 +++-- 1 file chan

[PATCH v8 0/3] add support for Bluetooth on MT7622 SoC

2018-08-02 Thread sean.wang
From: Sean Wang v8 and changes since v7: - add updates per these suggestions mentioned in [1][2] - remove the hack atomic_inc(&hdev->cmd_cnt) mentioned in [2] because it should be better to be considered in the core [1] http://lists.infradead.org/pipermail/linux-mediatek/2018-August/014516.

[PATCH v8 3/3] MAINTAINERS: add an entry for MediaTek Bluetooth driver

2018-08-02 Thread sean.wang
From: Sean Wang Add an entry for the MediaTek Bluetooth driver. Signed-off-by: Sean Wang --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0f2cce4..e983d9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9144,6 +9144,14 @@ F: inclu

[PATCH v8 1/3] dt-bindings: net: bluetooth: Add mediatek-bluetooth

2018-08-02 Thread sean.wang
From: Sean Wang Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs. Signed-off-by: Sean Wang Reviewed-by: Rob Herring --- .../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++ 1 fi

[PATCH v8 2/3] Bluetooth: mediatek: Add protocol support for MediaTek serial devices

2018-08-02 Thread sean.wang
From: Sean Wang This adds a driver based on serdev driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang --- drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/Makefile| 2 + drivers/

[PATCH v10 0/3] add support for Bluetooth on MT7622 SoC

2018-08-07 Thread sean.wang
From: Sean Wang v10 and changes since v9: - Add a fixup that is __be16 is required instead of dlen1 + dlen2 in STP header. - Align a few one-line comments style as they're made in v9 - Fix two warnings catched by checkpatch.pl WARNING:TYPO_SPELLING: 'specifc' may be misspelled - perh

[PATCH v10 1/3] dt-bindings: net: bluetooth: Add mediatek-bluetooth

2018-08-07 Thread sean.wang
From: Sean Wang Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs. Signed-off-by: Sean Wang Reviewed-by: Rob Herring Signed-off-by: Marcel Holtmann --- .../devicetree/bindings/net/mediatek-bluetooth.txt |

[PATCH v10 2/3] Bluetooth: mediatek: Add protocol support for MediaTek serial devices

2018-08-07 Thread sean.wang
From: Sean Wang This adds a driver based on serdev driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann --- drivers/bluetooth/Kconfig | 11 + drivers/bluetoo

[PATCH v10 3/3] MAINTAINERS: add an entry for MediaTek Bluetooth driver

2018-08-07 Thread sean.wang
From: Sean Wang Add an entry for the MediaTek Bluetooth driver. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0f2cce4..e983d9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9

[PATCH 2/7] pinctrl: mt7622: fix initialization sequence between eint and gpiochip

2018-06-21 Thread sean.wang
From: Sean Wang Because gpichip applied in the driver must depend on mtk eint to implement the input data debouncing and the translation between gpio and irq, it's better to keep logic consistent with mtk eint being built prior to gpiochip being added. Cc: sta...@vger.kernel.org Fixes: e6dabd38d

[PATCH 5/7] pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied

2018-06-21 Thread sean.wang
From: Sean Wang When we are explicitly using GPIO hogging mechanism in the pinctrl node, such as: &pio { line_input { gpio-hog; gpios = <95 0>, <96 0>, <97 0>; input; }; }; A

[PATCH 1/7] pinctrl: mt7622: fix error path on failing at groups building

2018-06-21 Thread sean.wang
From: Sean Wang It should be to return an error code when failing at groups building. Cc: sta...@vger.kernel.org Fixes: d6ed93551320 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC") Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 2 +- 1 file changed, 1 inserti

[PATCH 7/7] arm64: dts: mt7622: add earlycon to mt7622-rfb1 board

2018-06-21 Thread sean.wang
From: Sean Wang Add earlycon to mt7622-rfb1 as to know what was going on when a certain fault is happening at the early initialization stage. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64

[PATCH 6/7] arm64: dts: mt7622: use gpio-ranges to pinctrl device

2018-06-21 Thread sean.wang
From: Sean Wang Using gpio-ranges property represent which GPIOs correspond to which pins on MT7622 pin controllers. For details, we can see section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt to know how to bind pinctrl and gpio drivers via the "gpio-ranges" property. Signed-off-by:

[PATCH 4/7] pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range

2018-06-21 Thread sean.wang
From: Sean Wang If the pinctrl node has the gpio-ranges property, the range will be added by the gpio core and doesn't need to be added by the pinctrl driver. But for keeping backward compatibility, an explicit pinctrl_add_gpio_range is still needed to be called when there is a missing gpio-rang

[PATCH 3/7] pinctrl: mt7622: fix that pinctrl_claim_hogs cannot work

2018-06-21 Thread sean.wang
From: Sean Wang To allow claiming hogs by pinctrl, we cannot enable pinctrl until all groups and functions are being added done. Also, it's necessary that the corresponding gpiochip is being added when the pinctrl device is enabled. Cc: sta...@vger.kernel.org Fixes: d6ed93551320 ("pinctrl: media

[PATCH 03/16] pinctrl: mediatek: extend struct mtk_pin_field_calc to pinctrl-mtk-common-v2.c

2018-08-27 Thread sean.wang
From: Sean Wang This patch adds members sz_reg fixed in struct mtk_pin_field_calc - The 'fixed' is used to represent the consecutive pins share the same bits within the same register with the 1st pin so that it can largely reduce the entry size a bit. - The 'sz_reg' is used to indicate the rang

[PATCH 00/16] Unify MediaTek pinctrl in preparation for MT8183 and MT6765

2018-08-27 Thread sean.wang
From: Sean Wang Irregular register arrangement and their logic access from various MediaTek SoCs being introduced already causes pinctrl-mtk-common to bloat and became really hard to maintain so that the patch creates pinctrl-mtk-common-v2 based on the core of mt7622 pinctrl to try make the regis

[PATCH 12/16] pinctrl: mediatek: add MT7623 pinctrl driver based on generic pinctrl binding

2018-08-27 Thread sean.wang
From: Sean Wang Adding MT7623 pinctrl driver based on generic pinctrl binding, that is good example and demonstrates how to port any other MediaTek SoCs pinctrl-moore core when people really would like to use the generic pinctrl binding to support these MediaTek SoCs. Signed-off-by: Ryder Lee S

[PATCH 15/16] pinctrl: mediatek: adjust error code and message when some register not supported is found

2018-08-27 Thread sean.wang
From: Sean Wang It's usual and not an error for there's some register not supported by a certain SoC or a pin so that in the case we have to adjust the message to print and the error code to get rid of unnecessary false alarm. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mtk-c

[PATCH 16/16] pinctrl: mediatek: extend struct mtk_pin_desc which per-pin driver depends on

2018-08-27 Thread sean.wang
From: Sean Wang Because the pincrl-mtk-common.c is an implementation for per-pin binding, its pin descriptor includes more information than pinctrl-mtk-common-v2 so far can support. So, we complement these data before writing a driver using pincrl-mtk-common-v2.c for per-pin binding. By the way,

[PATCH 13/16] pinctrl: mediatek: use pin descriptor all in pinctrl-mtk-common-v2.c

2018-08-27 Thread sean.wang
From: Sean Wang all use pin descriptor instead in pinctrl-mtk-common-v2.c for the consistency and extensibility. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-moore.c | 66 +--- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 76 +-

[PATCH 14/16] pinctrl: mediatek: add multiple register bases support to pinctrl-mtk-common-v2.c

2018-08-27 Thread sean.wang
From: Sean Wang Certain SoC own multiple register base for accessing each pin groups, it's easy to be done with extend struct mtk_pin_field_calc to support the kind of SoC such as MT8183. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-moore.c | 30 +++- d

[PATCH v1 0/2] Bluetooth: mediatek: Add protocol support for MediaTek USB devices

2018-08-12 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U and MT7663U Bluetooth function running on the top of btusb driver. The patch also adds a newly created file mtkbt.c able to be reused independently from the transport type such as UART, USB and SDIO. Sean Wang (2): Bluetooth: mediatek:

[PATCH v1 2/2] Bluetooth: mediatek: Add protocol support for MediaTek MT7663U USB devices

2018-08-12 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtk.c | 1 + drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btusb.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/driv

[PATCH v1 1/2] Bluetooth: mediatek: Add protocol support for MediaTek MT7668U USB devices

2018-08-12 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver. The patch also adds a newly created file mtkbt.c able to be reused independently from the transport type such as UART, USB and SDIO. Signed-off-by: Sean Wang --- drivers/bluetooth/K

[PATCH] ARM: defconfig: add mediatek_v7_defconfig

2018-07-19 Thread sean.wang
From: Sean Wang Adding one defconfig of our own for the MediaTek ARMv7 SoCs to have one a bit more tailor-made and stripped-down version of defconfig that just supports the superset of existing DT based MediaTek platform and drivers. Which also can help to extend new MediaTek plaforms and drivers

[PATCH v6 0/4] add support for Bluetooth on MT7622 SoC

2018-07-19 Thread sean.wang
From: Sean Wang v6 and changes since v5: - make btmtkuart become a separate driver. - drop already applied patches and the patch for btuart driver - refine comments in driver allowing people know that mtk extra header + length doesn't indicate a full H:4 frame, things can fragment. - enhan

[PATCH v6 3/4] Bluetooth: mediatek: Add protocol support for MediaTek serial devices

2018-07-19 Thread sean.wang
From: Sean Wang This adds a driver to run on the top of btuart driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang --- drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/Makefile| 2

[PATCH v6 2/4] Bluetooth: Add new quirk for non-persistent setup settings

2018-07-19 Thread sean.wang
From: Sean Wang Add a new quirk HCI_QUIRK_NON_PERSISTENT_SETUP allowing that a quirk that runs setup() after every open() and not just after the first open(). Signed-off-by: Sean Wang --- include/net/bluetooth/hci.h | 9 + net/bluetooth/hci_core.c| 3 ++- 2 files changed, 11 insert

[PATCH v6 4/4] MAINTAINERS: add an entry for MediaTek Bluetooth driver

2018-07-19 Thread sean.wang
From: Sean Wang Add an entry for the MediaTek Bluetooth driver. Signed-off-by: Sean Wang --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 20de9a5..5d81cc1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8780,6 +8780,14 @@ F: inclu

[PATCH v6 1/4] dt-bindings: net: bluetooth: Add mediatek-bluetooth

2018-07-19 Thread sean.wang
From: Sean Wang Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs. Signed-off-by: Sean Wang Reviewed-by: Rob Herring --- .../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++ 1 fi

[PATCH v7 2/3] Bluetooth: mediatek: Add protocol support for MediaTek serial devices

2018-07-31 Thread sean.wang
From: Sean Wang This adds a driver based on serdev driver for the MediaTek serial protocol based on running H:4, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang --- drivers/bluetooth/Kconfig | 11 + drivers/bluetooth/Makefile| 2 + drivers/

[PATCH v7 0/3] add support for Bluetooth on MT7622 SoC

2018-07-31 Thread sean.wang
From: Sean Wang v7 and changes since v6: - drop already applied patches - move clk_* and pm_* operation to ->open and ->close - label this driver as BT_MTKUART - make code style aligned with the other drivers and code better to read as these suggestions and fixes are mentioned in [1] [1]

[PATCH v7 1/3] dt-bindings: net: bluetooth: Add mediatek-bluetooth

2018-07-31 Thread sean.wang
From: Sean Wang Add binding document for a SoC built-in device using MediaTek protocol. Which could be found on MT7622 SoC or other similar MediaTek SoCs. Signed-off-by: Sean Wang Reviewed-by: Rob Herring --- .../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++ 1 fi

[PATCH v7 3/3] MAINTAINERS: add an entry for MediaTek Bluetooth driver

2018-07-31 Thread sean.wang
From: Sean Wang Add an entry for the MediaTek Bluetooth driver. Signed-off-by: Sean Wang --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0f2cce4..e983d9e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9144,6 +9144,14 @@ F: inclu

[PATCH] pinctrl: mt7622: fix probe fail by misuse the selector

2018-07-11 Thread sean.wang
From: Sean Wang After the commit acf137951367 ("pinctrl: core: Return selector to the pinctrl driver") and the commit 47f1242d19c3 ("pinctrl: pinmux: Return selector to the pinctrl driver"), it's necessary to add the fixes needed for the pin controller drivers to use the appropriate returned sele

[PATCH v3 4/9] dt-bindings: arm: mediatek: add bindings for mediatek MT7623a SoC Platform

2017-05-12 Thread sean.wang
From: Sean Wang This adds DT binding documentation for Mediatek MT7623a Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/arm/mediatek.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/mediatek.txt b/Documentation/devicetree/bindings/ar

[PATCH v3 0/9] arm: dts: extend mt7623 support

2017-05-12 Thread sean.wang
From: Sean Wang Changes since v2: - exclude those patches already queued into v4.11-next/dts32 - exclude those patches already sent in separation - add mt7623a SoC basic support - update binding SoC for mt7623n and relevant boards Changes since v1: Continue the upstream journey based on the prev

[PATCH v3 1/9] arm: dts: mt7623: add mt7623-mt6323.dtsi file

2017-05-12 Thread sean.wang
From: John Crispin MediaTek produces various PMICs. Which one is used depends on the actual circuit design. Instead of adding the correct PMIC node to every dts file we instead add a new intermediate dtsi file which adds the PMIC node. Additionally we also add the phandles for the regulators to v

[PATCH v3 3/9] dt-bindings: arm: mediatek: update for MT7623n SoC and relevant boards

2017-05-12 Thread sean.wang
From: Sean Wang Because there are two versions of MT7623 SoC that is MT7623a and MT7623n respectively. So update the part of MT7623n bindings to allow that people tend to differentiate which MT7623 SoC the boards applies. Signed-off-by: John Crispin Signed-off-by: Sean Wang --- Documentation/

[PATCH v3 8/9] arm: dts: mt7623: enable the nand device on the mt7623n nand rfb

2017-05-12 Thread sean.wang
From: John Crispin Enable the nand device and setup pinmux on the mt7632m rfb with nand support. Signed-off-by: John Crispin Signed-off-by: Sean Wang --- arch/arm/boot/dts/mt7623n-rfb-nand.dts | 88 ++ 1 file changed, 88 insertions(+) diff --git a/arch/arm/boo

[PATCH v3 2/9] arm: dts: mt7623: rename mt7623-evb.dts to arch/arm/boot/dts/mt7623n-rfb.dtsi

2017-05-12 Thread sean.wang
From: Sean Wang There are 2 versions of the MT7623 SoC, the one is MT7623n and the other is MT7623a. MT7623n is almost identical to MT7623a but has some additional multimedia features. The reference boards are available as NAND or MMC and might have a different ethernet setup. In order to reduce

[PATCH v3 9/9] arm: dts: mt7623: add dts file for Bananapi R2 (BPI-R2) board

2017-05-12 Thread sean.wang
From: Sean Wang Add support for the Bananapi R2 (BPI-R2) development board from BIPAI KEJI. Detailed hardware information for BPI-R2 which could be found on http://www.banana-pi.org/r2.html The patch currently only adds Mediatek GMAC, MT7530 Switch, the crypto engine, USB, IR, I2S, I2C, UART, SP

[PATCH v3 6/9] arm: dts: mt7623: cleanup the mt7623n rfb uart nodes

2017-05-12 Thread sean.wang
From: John Crispin This patch does a cleanup of the uart nodes in the dts file of the RFB. It adds aliases, enables 2 more uarts and explicitly sets the uart mode of the console. Signed-off-by: John Crispin Signed-off-by: Sean Wang --- arch/arm/boot/dts/mt7623n-rfb.dtsi | 16 +++-

[PATCH v3 5/9] ARM: mediatek: add MT7623a smp bringup code

2017-05-12 Thread sean.wang
From: Sean Wang Add support for booting secondary CPUs on MT7623a. Signed-off-by: Sean Wang --- arch/arm/mach-mediatek/mediatek.c | 2 ++ arch/arm/mach-mediatek/platsmp.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/mach-mediatek/mediatek.c b/arch/arm/mach-mediatek/mediatek

[PATCH v3 7/9] arm: dts: mt7623: enable the usb device on the mt7623n rfb

2017-05-12 Thread sean.wang
From: John Crispin All versions of the mt7623n RFB have an USB port so enable the device. There is a gpio that gets used to power up the port supply. Add support for this gpio using the fixed-regulator driver. Signed-off-by: John Crispin Signed-off-by: Sean Wang --- arch/arm/boot/dts/mt7623n-

[PATCH 0/2] dmaengine: mtk-hsdma: add support for Mediatek High-Speed DMA controller on MT7623 SoC

2017-05-14 Thread sean.wang
From: Sean Wang This patchset introduces support for Mediatek High-Speed DMA controller (MTK-HSDMA) Currently, the driver is already tested successfully with dmatest module on MT7623 SoC. MTK-HSDMA on MT7623 SoC has the single channel which is dedicated to memory-to-memory transfer through ring

[PATCH 1/2] dt-bindings: dmaengine: Add Mediatek High-Speed DMA controller bindings

2017-05-15 Thread sean.wang
From: Sean Wang Document the devicetree bindings for Mediatek High-Speed DMA controller which could be found on MT7623 SoC or other similar Mediatek SoCs. Signed-off-by: Sean Wang --- .../devicetree/bindings/dma/mtk-hsdma.txt | 30 ++ 1 file changed, 30 insertions(

[PATCH 2/2] dmaengine: mtk-hsdma: Add Mediatek High-Speed DMA controller on MT7623 SoC

2017-05-15 Thread sean.wang
From: Sean Wang Add dmaengine driver for Mediatek High-Speed DMA based on the feature DMA_VIRTUAL_CHANNELS. Mediatek High-Speed DMA controller (HSDMA) on MT7623 SoC has the single channel which is dedicated to memory-to-memory transfer through ring-based descriptor management. Even though there

[PATCH v3 2/3] dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC

2018-01-31 Thread sean.wang
From: Sean Wang MediaTek High-Speed DMA controller (HSDMA) on MT7622 and MT7623 SoC has a single ring is dedicated to memory-to-memory transfer through ring based descriptor management. Even though there is only one physical ring available inside HSDMA, the driver can be easily extended to the s

[PATCH v3 0/3] add support for Mediatek High-Speed DMA controller on MT7622 and MT7623 SoC

2018-01-31 Thread sean.wang
From: Sean Wang Changes since v2: - remove extra tasklets and refactor driver for letting descriptors being processed ASAP. - add more comments stating the relevant logic - remove unused macro and variables - change to use the disclaimer with SPDX identifier - add mt7622 support - refine hardwar

[PATCH v3 3/3] dmaengine: mediatek: update MAINTAINERS entry with MediaTek DMA driver

2018-01-31 Thread sean.wang
From: Sean Wang I work for MediaTek and maintain SoC targeting to home gateway and also will keep extending and testing the function. Signed-off-by: Sean Wang --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index c90687e..48f85f4 100644 --

[PATCH v3 1/3] dt-bindings: dmaengine: Add MediaTek High-Speed DMA controller bindings

2018-01-31 Thread sean.wang
From: Sean Wang Document the devicetree bindings for MediaTek High-Speed DMA controller which could be found on MT7623 SoC or other similar Mediatek SoCs. Signed-off-by: Sean Wang --- .../devicetree/bindings/dma/mtk-hsdma.txt | 33 ++ 1 file changed, 33 insertions(

[PATCH 1/2] dt-bindings: soc: add SCPSYS binding for MT7623 and MT7623A SoC

2018-02-01 Thread sean.wang
From: Sean Wang document the binding for enabling SCPSYS on MediaTek MT7623 and MT7623A SoC. Where MT7623 SoC has the same definition about power domains with MT2701, so it's fine to using MT2701 ones as MT7623's fallback. Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/soc/medi

[PATCH 2/2] soc: mediatek: add SCPSYS power domain driver for MediaTek MT7623A SoC

2018-02-01 Thread sean.wang
From: Sean Wang Add SCPSYS power domain driver for MT7623A SoC. The MT7623A's power domains are the subset of MT7623 SoC's ones. As MT7623 SoC has full features whereas MT7623A is being designed just for router applications. Thus, MT7623A doesn't include those power domains multimedia function be

[PATCH] cpufreq: mediatek: Add mediatek related projects into blacklist

2018-01-23 Thread sean.wang
From: Sean Wang commit 6066998cbd2b1012a8d5bc9a2957cfd0ad53150e upstream. commit edeec420de24 ("cpufreq: dt-platdev: Automatically create cpufreq device with OPP v2") not added MediaTek SoCs to the blacklist that would lead to cause an occasional hang or unexpected behaviors on related boards as

[PATCH v2] clk: mediatek: adjust dependency of reset.c to avoid unexpectedly being built

2018-01-05 Thread sean.wang
From: Sean Wang Changes from v1->v2: Add 'select RESET_CONTROLLER' under COMMON_CLK_MEDIATEK and enable reset.c to be built when COMMON_CLK_MEDIATEK is selected. That should be quite reasonable because the reset controller is tightly embedded inside and exported from these clock subsystems. At le

[PATCH 1/2] pinctrl: mediatek: mt7622: fix potential uninitialized value being returned

2018-01-09 Thread sean.wang
From: Sean Wang commit d6ed93551320 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC") leads to the following static checker warning: drivers/pinctrl/mediatek/pinctrl-mt7622.c:1419 mtk_gpio_get() error: uninitialized symbol 'value'. 1412 static int mtk_gpio_get(struct gpio_chip *chip, uns

[PATCH 2/2] pinctrl: mediatek: mt7622: align error handling of mtk_hw_get_value call

2018-01-09 Thread sean.wang
From: Sean Wang Make consistent error handling of all mtk_hw_get_value occurrences using propagating error code from the internal instead of creating a new one. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 8 1 file changed, 4 insertions(+), 4 deletions(-)

  1   2   3   4   5   6   7   8   >