[PATCH v2 00/17] Add support to MT6323 RTC and its power device

2018-04-25 Thread sean.wang
From: Sean Wang v2: - The changes must be relative to the below tree since one critial patch for the rtc-mt6397.c the series depends on was being applied into the tree. Otherwise, for example, if the series are applied on the top of [1], a build error must happen due to an implicit declara

[PATCH v2 17/17] MAINTAINERS: add an entry for MediaTek board level shutdown driver

2018-04-25 Thread sean.wang
From: Sean Wang Add an entry for the MediaTek board level shutdown driver. Signed-off-by: Sean Wang --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a7ef37f..816554b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8912,6 +8912,13 @@ S:

[PATCH v2 10/17] rtc: mt6397: remove unnecessary irq_dispose_mapping

2018-04-25 Thread sean.wang
From: Sean Wang With the patch [1], the job irq_create_mapping had been moved from the rtc driver to mfd core, so it should be unnecessary to keep irq_dispose_mapping in all paths of the leaf driver. [1] http://lists.infradead.org/pipermail/linux-mediatek/2017-September/010455.html Signed-off-

[PATCH v2 12/17] rtc: mt6397: move the declaration into a globally visible header file

2018-04-25 Thread sean.wang
From: Sean Wang This is in preparation for allowing other drivers can share the declaration, so move the declaration into a globally visible header file. Signed-off-by: Sean Wang --- drivers/rtc/rtc-mt6397.c | 53 +--- include/linux/mfd/mt6397/rtc.h | 70 +

[PATCH v2 08/17] rtc: mt6397: add MT6323 support to RTC driver

2018-04-25 Thread sean.wang
From: Sean Wang Just to add MT6323 support to existing RTC driver Signed-off-by: Sean Wang --- drivers/rtc/rtc-mt6397.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-mt6397.c b/drivers/rtc/rtc-mt6397.c index 385f830..0df7ccd 100644 --- a/drivers/rtc/rtc-mt6397.c +++ b/dri

[PATCH v2 13/17] rtc: mt6397: cleanup header files to include

2018-04-25 Thread sean.wang
From: Sean Wang Clean up those included header files by removing unreferenced ones, add missing ones the driver explicitly depends on and finally list all #includes in alphabetical order. Signed-off-by: Sean Wang --- drivers/rtc/rtc-mt6397.c | 11 --- 1 file changed, 4 insertions(+), 7

[PATCH v2 07/17] mfd: mt6397: reuse DEFINE_RES_* helpers

2018-04-25 Thread sean.wang
From: Sean Wang Reuse DEFINE_RES_* helpers instead of an open-coded handling. Signed-off-by: Sean Wang --- drivers/mfd/mt6397-core.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index c4ad5c3..e0012e2 10

[PATCH v2 03/17] dt-bindings: mfd: mt6397: add a description for MT6323 RTC

2018-04-25 Thread sean.wang
From: Sean Wang Add a description for MT6323 RTC and link it to the detailed binding documentation. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang Reviewed-by: Rob Herring Acked-by: Lee Jones --- Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++- 1 file changed, 3 insertions

[PATCH v2 11/17] rtc: mt6397: convert to use device managed functions

2018-04-25 Thread sean.wang
From: Sean Wang Use device managed operation to simplify error handling, reduce source code size, and reduce the likelyhood of bugs, and remove our removal callback which contains anything already done by device managed functions. v1 -> v2: - Use devm_rtc_allocate_device() and rtc_register_devi

[PATCH v2 04/17] dt-bindings: mfd: mt6397: add a description for MT6323 power controller

2018-04-25 Thread sean.wang
From: Sean Wang Add a description for MT6323 power controller on MT6323 and link it to the detailed binding documentation. Cc: devicet...@vger.kernel.org Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/mfd/mt6397.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Docu

[PATCH v2 09/17] rtc: mt6397: replace a poll with regmap_read_poll_timeout

2018-04-25 Thread sean.wang
From: Sean Wang Reuse the helper regmap_read_poll_timeout instead of an open-coding handling to simpify the logic. Furthermore, the time for a wait in each iteration changed from cpu_relax to 20us is for matching the usage of the helper, but it wouldn't acctually break any the existent functiona

[PATCH v2 05/17] mfd: mt6397: add MT6323 RTC support into MT6397 driver

2018-04-25 Thread sean.wang
From: Sean Wang Add compatible string as "mt6323-rtc" that will make the OF core spawn child devices for the RTC subnode of that MT6323 MFD device. Signed-off-by: Sean Wang --- drivers/mfd/mt6397-core.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/driver

[PATCH v2 15/17] power: reset: mt6323: add a driver for MT6323 power controller

2018-04-25 Thread sean.wang
From: Sean Wang The power device is responsible for externally down or up the power of the remote MediaTek SoC through the tiny circuit BBPU inside PMIC RTC. Though it's a part of RTC device, it would be better to be a standalone driver than to be a part of existent RTC driver so as to let us ma

[PATCH v2 0/2] Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-28 Thread sean.wang
From: Sean Wang v2: changes since v1 - add Rob's review tag - removed these merged patches This adds the support of enabling MT7668U and MT7663U UART based Bluetooth function running on the top of btmtkuart driver. We are through several patches to reach the goal and also wish applied the same

[PATCH v2 2/2] Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-28 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U and MT7668U Bluetooth function running on the top of btmtkuart driver. There are a few differences between MT766[3,8]U and MT7622 where MT766[3,8]U are standalone devices based on UART transport while MT7622 bluetooth is a built-in device

[PATCH v2 1/2] dt-bindings: net: bluetooth: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-28 Thread sean.wang
From: Sean Wang Update binding document with adding support of MT7663U and MT7668U UART devices to mediatek-bluetooth. Reviewed-by: Rob Herring Signed-off-by: Sean Wang --- .../bindings/net/mediatek-bluetooth.txt | 64 +++ 1 file changed, 64 insertions(+) diff --git a/D

[PATCH RESEND v2] Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices

2019-03-02 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U and MT7668U Bluetooth function running on the top of btmtkuart driver. There are a few differences between MT766[3,8]U and MT7622 where MT766[3,8]U are standalone devices based on UART transport while MT7622 bluetooth is a built-in device

[PATCH v1 3/4] Bluetooth: btmtksdio: Fix hdev->stat.byte_rx accumulation

2019-04-18 Thread sean.wang
From: Sean Wang Accumulate hdev->stat.byte_rx only for valid packets as btmtkuart doing. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 9c123a

[PATCH v1 4/4] Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth

2019-04-18 Thread sean.wang
From: Sean Wang Add runtime PM support to btmtksdio. With this way, there will be the benefit of the device entering the more power saving state once it is been a while data traffic is idle. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 144 ++ 1

[PATCH v1 0/4] Add a couple of enhancements to btmtksdio

2019-04-18 Thread sean.wang
From: Sean Wang First three are all minor changes and the final one adds a runtime pm support to enter a lower power state for decreasing power dissipation when there is idle traffic in SDIO transport for a while. Sean Wang (4): Bluetooth: btmtksdio: Drop newline with bt_dev logging macros B

[PATCH v1 1/4] Bluetooth: btmtksdio: Drop newline with bt_dev logging macros

2019-04-18 Thread sean.wang
From: Sean Wang bt_dev logging macros already include a newline at each output so drop these unnecessary additional newlines in the driver. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/btm

[PATCH v1 2/4] Bluetooth: btmtksdio: Add a bit definition for CHLPCR

2019-04-18 Thread sean.wang
From: Sean Wang Add a register bit definition about CHLPCR bit 8 because the bit is quite different in the meaning between reading and writing that bit. The patch adds a definition particularly for the bit read to avoid the confusion about using write definition to read the bit. Signed-off-by:

[PATCH] Bluetooth: mediatek: fix uninitialized symbol errors in btmtksdio_rx_packet

2019-03-13 Thread sean.wang
From: Sean Wang Fixed all the below warnings. They would probably cause the following error handling path would use the uninitialized value and then produce unexpected behavior. drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_len’ may be used uninitialized in this function [-Wmaybe-uninitiali

[PATCH v1 2/3] Bluetooth: mediatek: Use module_sdio_driver helper

2019-03-13 Thread sean.wang
From: Sean Wang Macro module_sdio_driver is used for drivers whose init and exit paths only register and unregister to SDIO API. So remove boilerplate code to make code simpler by using module_sdio_driver. Cc: Ulf Hansson Suggested-by: Marcel Holtmann Signed-off-by: Sean Wang --- drivers/blu

[PATCH v1 3/3] Bluetooth: btsdio: Use module_sdio_driver helper

2019-03-13 Thread sean.wang
From: Sean Wang Macro module_sdio_driver is used for drivers whose init and exit paths only register and unregister to SDIO API. So remove boilerplate code to make code simpler by using module_sdio_driver. Cc: Marcel Holtmann Cc: Ulf Hansson Signed-off-by: Sean Wang --- drivers/bluetooth/bts

[PATCH v1 1/3] mmc: sdio: Add helper macro for sdio_driver boilerplate

2019-03-13 Thread sean.wang
From: Sean Wang This patch introduces the module_sdio_driver macro which is a convenience macro for SDIO driver modules similar to module_usb_driver. It is intended to be used by drivers which init/exit section does nothing but register/ unregister the SDIO driver. By using this macro it is possi

[PATCH v1 0/3] add module_sdio_driver and enable a few users

2019-03-13 Thread sean.wang
From: Sean Wang Add module_sdio_driver exactly like the function module_usb_drivear offers to and enable a few users to eliminate a few lines of boilerplate code per SDIO driver. Sean Wang (3): mmc: sdio: Add helper macro for sdio_driver boilerplate Bluetooth: mediatek: Use module_sdio_drive

Re:[PATCH 1/1] [Add support Mediatek mt7921U]

2021-01-23 Thread sean.wang
From: Sean Wang Hi Mark >From: "mark-yw.chen" > Please use the appropirate version and prefix for the subject such as [PATCH v4] Bluetooth: btusb: Add protocol support for MediaTek MT7921U USB devices > >This patch adds the support of enableing MT7921U, it's USB-based Bluetooth >function. >

[PATCH v2] Bluetooth: btmtksdio: fix uninitialized symbol errors in btmtksdio_rx_packet

2019-03-18 Thread sean.wang
From: Sean Wang Fixed all the below warnings. They would probably cause the following error handling path would use the uninitialized value and then produce unexpected behavior. drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_len’ may be used uninitialized in this function [-Wmaybe-uninitiali

[PATCH net-next] net: Update address for MediaTek ethernet driver in MAINTAINERS

2019-10-16 Thread sean.wang
From: Sean Wang Update maintainers for MediaTek ethernet driver with Mark Lee. He is familiar with MediaTek mt762x series ethernet devices and will keep following maintenance from the vendor side. Signed-off-by: Sean Wang Signed-off-by: Mark Lee --- MAINTAINERS | 2 +- 1 file changed, 1 inser

[PATCH 3/6] Bluetooth: mediatek: fix up an error path to restore bdev->tx_state

2019-02-14 Thread sean.wang
From: Sean Wang Restore bdev->tx_state with clearing bit BTMTKUART_TX_WAIT_VND_EVT when there is an error on waiting for the corresponding event. Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Sean Wang --- drivers/bluetooth/btmtku

[PATCH 5/6] Bluetooth: mediatek: update the common setup between MT7622 and other devices

2019-02-14 Thread sean.wang
From: Sean Wang Update the setup sequence on MT7622 to apply the same flow with MT7663U and MT7668U USB [1] as much as possible. These additional commands are required to parse the corresponding event to determine what current state the Bluetooth device is on and thus it's necessary to extend mtk

[PATCH 1/6] dt-bindings: net: bluetooth: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-14 Thread sean.wang
From: Sean Wang Update binding document with adding support of MT7663U and MT7668U UART devices to mediatek-bluetooth. Signed-off-by: Sean Wang --- .../bindings/net/mediatek-bluetooth.txt | 64 +++ 1 file changed, 64 insertions(+) diff --git a/Documentation/devicetree/bi

[PATCH 2/6] Bluetooth: mediatek: trivial typo fix

2019-02-14 Thread sean.wang
From: Sean Wang add a trivial typo fix from speicfic to specific Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices") Signed-off-by: Sean Wang --- drivers/bluetooth/btmtkuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 4/6] Bluetooth: mediatek: pass a pointer to mtk_hci_wmt_sync

2019-02-14 Thread sean.wang
From: Sean Wang Pass a structure pointer to mtk_hci_wmt_sync rather than several arguments to avoid take up additional stack area and be better to read the code. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtkuart.c | 63 ++- 1 file changed, 48 insertions(+

[PATCH 0/6]Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-14 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U and MT7663U UART based Bluetooth function running on the top of btmtkuart driver. We are through several patches to reach the goal and also wish applied the same flow in MediaTek btusb [1] for the transport independence. Once [1] and the

[PATCH 6/6] Bluetooth: mediatek: add support for MediaTek MT7663U and MT7668U UART devices

2019-02-14 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U and MT7668U Bluetooth function running on the top of btmtkuart driver. There are a few differences between MT766[3,8]U and MT7622 where MT766[3,8]U are standalone devices based on UART transport while MT7622 bluetooth is a built-in device

[PATCH v5 0/2] Bluetooth: btusb: Add protocol support for MediaTek USB devices

2019-01-18 Thread sean.wang
From: Sean Wang v5: * rebase to the latest code base. * change the subject prefix. * change the place the firmware located at. v4: * use new BTUSB_TX_WAIT_VND_EVT instead of BTMTKUSB_TX_WAIT_VND_EVT to avoid definition conflict and to fix bulk data transfer fails. * use the bluetooth-next as t

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

2019-01-18 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 C

[PATCH v5 2/2] Bluetooth: btusb: Add protocol support for MediaTek MT7663U USB devices

2019-01-18 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 C

[PATCH v6 2/2] Bluetooth: btusb: Add protocol support for MediaTek MT7663U USB devices

2019-01-24 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 C

[PATCH v6 0/2] Bluetooth: btusb: Add protocol support for MediaTek USB devices

2019-01-24 Thread sean.wang
From: Sean Wang v6: * fix drivers/bluetooth/btusb.c:2683:2-3: Unneeded semicolon based reported by [1] * update power-on sequence with adding neccesary tci sleep comand to set up low-power environmnet and a delay to wait the device to be stable. * sort variables declarations in reverse xmas or

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

2019-01-24 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 C

[PATCH] Bluetooth: mediatek: Fixed incorrect type in assignment

2019-03-04 Thread sean.wang
From: Sean Wang Fixed warning: incorrect type in assignment reported by kbuild test robot. The detailed warning is shown as below. make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' All warnings (new ones prefixed by >>): btmtkuart.c:671:18: sparse:warning:

[PATCH v1 1/2] mmc: add SDIO identifiers for MediaTek Bluetooth devices

2019-03-07 Thread sean.wang
From: Sean Wang The SDIO identifier for MediaTek Bluetooth devices were defined in the MediaTek Bluetooth driver. Moving the definitions in MMC header file seems common sense. Signed-off-by: Sean Wang --- include/linux/mmc/sdio_ids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includ

[PATCH v1 0/2] Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices

2019-03-07 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663S and MT7668S SDIO-based Bluetooth function. patch 1: add MediaTek SDIO identifiers patch 2: add support for MediaTek MT7663S and MT7668S SDIO devices Sean Wang (2): mmc: add SDIO identifiers for MediaTek Bluetooth devices Bluetooth:

[PATCH v1 2/2] Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices

2019-03-07 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663S and MT7668S SDIO-based Bluetooth function. There are quite many differences between MT766[3,8]S and standard Bluetooth SDIO devices such as Type-A and Type-B devices. For example, MT766[3,8]S have its own SDIO registers layout, definition

[PATCH 4/4] pinctrl: mediatek: add eint support to MT6765 pinctrl driver

2018-09-20 Thread sean.wang
From: Mars Cheng Just add eint support to MT6765 pinctrl driver as usual as happens on the other SoCs. Signed-off-by: Mars Cheng Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt6765.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl-

[PATCH 1/4] pinctrl: mediatek: fix static checker warning caused by EINT_NA

2018-09-20 Thread sean.wang
From: Sean Wang EINT_NA is an u16 number, so it should be U16_MAX instead of -1 to fix up drivers/pinctrl/mediatek/pinctrl-paris.c:732 mtk_gpio_to_irq() warn: impossible condition (desc->eint.eint_n == -1) => (0-u16max == (-1)) Also happens in drivers/pinctrl/mediatek/pinctrl-paris.c:749 mtk_gpi

[PATCH 3/4] pinctrl: mediatek: add MT6765 pinctrl driver

2018-09-20 Thread sean.wang
From: ZH Chen Add MT6765 pinctrl driver based on MediaTek pinctrl-paris core. Signed-off-by: Mars Cheng Signed-off-by: ZH Chen Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/Kconfig |7 + drivers/pinctrl/mediatek/Makefile |1 + drivers/pinctrl/mediatek

[PATCH 2/4] pinctrl: mediatek: add no eint function for pin define

2018-09-20 Thread sean.wang
From: Mars Cheng Add NO_EINT_SUPPORT back to pinctrl-mtk-common-v2.h as the alias of EINT_NA to indicate that some pin not capable of being controlled as eint and that is required by pinctrl-paris based driver as old pinctrl-mtk-common.h already had. Signed-off-by: Mars Cheng Signed-off-by: Sea

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

2018-09-08 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 v2 21/22] pinctrl: mediatek: extend eint build to pinctrl-mtk-common-v2.c

2018-09-08 Thread sean.wang
From: Sean Wang Almost all MediaTek SoCs apply the exact same logic to build eint, so move the common functions into pinctrl-mtk-common-v2.c to allow each new pinctrl driver to reuse them. Also, add a protection checker on hw->soc->eint_hw to avoid invalid memory access when there's certain SoC n

[PATCH v2 19/22] pinctrl: mediatek: extend advanced pull support in pinctrl-mtk-common-v2.c

2018-09-08 Thread sean.wang
From: Sean Wang Extend the advanced pull based on the legacy bias plus additional r0 and r1 to tweak the resistor level. Signed-off-by: Zhiyong Tao Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 37 1 file changed, 32 insertions(+), 5

[PATCH v2 20/22] pintcrl: mediatek: add pull tweaks for I2C related pins on MT8183

2018-09-08 Thread sean.wang
From: Zhiyong Tao This patch provides the advanced pull for I2C used pins on MT8183. Signed-off-by: Zhiyong Tao Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt8183.c | 24 1 file changed, 24 insertions(+) diff --git a/drivers/pinctrl/mediatek/pinctrl

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

2018-09-08 Thread sean.wang
From: Sean Wang v2 and changes since v1: add new patches * Add additional patch 17 to 22 to support MT8183 SoC update the existing patches * Patch 2: Removed unnecessary blank line and headers included. * Patch 4: Extended the size eint number can hold since it's possible more than 254 pins in

[PATCH v2 17/22] pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings

2018-09-08 Thread sean.wang
From: Zhiyong Tao Add pinctrl-paris core that implements vendor dt-binding which MediaTek tablet, box and smartphone-based SoCs such as MT81xx, MT27xx, and MT67xx SoCs really want to depend on. The driver is just completely rewritten according to pinctrl-mtk-common.c but uses the new logic from p

[PATCH v2 18/22] pinctrl: mediatek: add MT8183 pinctrl driver

2018-09-08 Thread sean.wang
From: Zhiyong Tao Add MT8183 pinctrl driver based on MediaTek pinctrl-paris core. Signed-off-by: Zhiyong Tao Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/Kconfig |7 + drivers/pinctrl/mediatek/Makefile |1 + drivers/pinctrl/mediatek/pinctrl-mt8183.c

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

2018-09-08 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 v2 16/22] pinctrl: mediatek: extend struct mtk_pin_desc which per-pin driver depends on

2018-09-08 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 v2 03/22] pinctrl: mediatek: extend struct mtk_pin_field_calc to pinctrl-mtk-common-v2.c

2018-09-08 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 v2 22/22] pinctrl: mediatek: add eint support to MT8183 pinctrl driver

2018-09-08 Thread sean.wang
From: Sean Wang Just add eint support to MT8183 pinctrl driver as usual as happens on the other SoCs. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/pinctrl-mt8183.c | 8 drivers/pinctrl/mediatek/pinctrl-paris.c | 22 ++ 2 files changed, 30 insertions(+)

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

2018-09-08 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 v2 15/22] pinctrl: mediatek: adjust error code and message when some register not supported is found

2018-09-08 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 v3 1/2] Bluetooth: mediatek: Add protocol support for MediaTek MT7668U USB devices

2018-09-03 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 C

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

2018-09-03 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 C

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

2018-09-03 Thread sean.wang
From: Sean Wang v3: add fixes and enhancements based on [1] * reuse flags and evt_skb btusb already had * add ctrl_anchor and the corresponding handling * apply mtk specific recv function * add more comments explaining wmt ctrl urbs behavior. [1] http://lists.infradead.org/pipermail/linux-mediat

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

2018-09-03 Thread sean.wang
From: Sean Wang v4: * use new BTUSB_TX_WAIT_VND_EVT instead of BTMTKUSB_TX_WAIT_VND_EVT to avoid definition conflict and to fix bulk data transfer fails. * use the bluetooth-next as the base v3: add fixes and enhancements based on [1] * reuse flags and evt_skb btusb already had * add ctrl_anch

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

2018-09-03 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7668U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0 D: Ver= 3.00 C

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

2018-09-03 Thread sean.wang
From: Sean Wang This adds the support of enabling MT7663U Bluetooth function running on the top of btusb driver. The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below. T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.00 C

[PATCH v1 5/7] pinctrl: mediatek: remove unused fields in struct mtk_eint_hw

2018-05-20 Thread sean.wang
From: Sean Wang The .name field has been not being used in existent code logic, so it's better that we remove them all. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/mtk-eint.h | 1 - drivers/pinctrl/mediatek/pinctrl-mt2701.c | 1 - drivers/pinctrl/mediatek/pinctrl-mt2712.c | 1 -

[PATCH v1 2/7] pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit

2018-05-20 Thread sean.wang
From: Sean Wang This patch is in preparation for adding EINT support to MT7622 pinctrl, and the refactoring doesn't alter any existent logic. A reason we have to refactor EINT code pieces into a generic way is that currently, they're tightly coupled with a certain type of MediaTek pinctrl would

[PATCH v1 4/7] pinctrl: mediatek: use generic EINT register maps for each SoC

2018-05-20 Thread sean.wang
From: Sean Wang So far, EINT on each SoC all used exactly identical register map and thus it's better that we apply generic register map already supported in EINT library and stop copy-n-pasting the same data block and filling into its platform data. Signed-off-by: Sean Wang --- drivers/pinctr

[PATCH v1 6/7] MAINTAINERS: update entry for PIN CONTROLLER - MEDIATEK

2018-05-20 Thread sean.wang
From: Sean Wang Add new files for the entry Signed-off-by: Sean Wang --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 9051a9c..7f3cced 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11193,6 +11193,7 @@ L: linux-media...@lists.infradead.or

[PATCH v1 3/7] pinctrl: mediatek: add EINT support to MT7622 SoC

2018-05-20 Thread sean.wang
From: Sean Wang Add EINT support to MT7622 SoC and the support is made as just an option to MT7622 pinctrl. Signed-off-by: Sean Wang --- drivers/pinctrl/mediatek/Kconfig | 2 +- drivers/pinctrl/mediatek/pinctrl-mt7622.c | 143 ++ 2 files changed, 144 inse

[PATCH v1 7/7] arm64: dts: mt7622: add EINT support to pinctrl

2018-05-20 Thread sean.wang
From: Sean Wang Add EINT support to pinctrl and set those GPIO keys as interrupt-driven keys. Signed-off-by: Sean Wang --- arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 2 +- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 8 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --gi

[PATCH v1 1/7] dt-bindings: pinctrl: add external interrupt support to MT7622 pinctrl

2018-05-20 Thread sean.wang
From: Sean Wang Extend the capability of MT7622 pinctrl with adding EINT so that each GPIO can be used to notify CPU when a signal state is changing on the line as an external interrupt. Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/pinctrl/pinctrl-mt7622.txt | 10 ++

[PATCH v1 0/7] add external interrupt support to MT7622 pinctrl

2018-05-20 Thread sean.wang
From: Sean Wang The series is to add external interrupt support to MT7622 pinctrl. Before we can freely do that in pinctrl-mt7622.c with patch 3, a refactor work has to be done with patch 2 to split EINT-related code from a specific driver and then allows pintrl-mt7622.c to reuse it. patch 1, 3

[PATCH v1 0/7] add support for Bluetooth on MT7622 SoC

2018-04-03 Thread sean.wang
From: Sean Wang Hi, This patchset introduces built-in Bluetooth support on MT7622 SoC. And, it should be simple to make an extension to support other MediaTek SoCs with adjusting a few of changes on the initialization sequence of the device. Before the main driver is being introduced, a few of

[PATCH v1 5/7] soc: mediatek: add a fixed wait for SRAM stable

2018-04-03 Thread sean.wang
From: Sean Wang MT7622_POWER_DOMAIN_WB doesn't send an ACK when its managed SRAM becomes stable, which is not like the behavior the other power domains should have. Therefore, it's necessary for such a power domain to have a fixed and well-predefined duration to wait until its managed SRAM can be

[PATCH v1 7/7] MAINTAINERS: add an entry for MediaTek Bluetooth driver

2018-04-03 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 4923621..ea2cd52 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8832,6 +8832,14 @@ F: inclu

[PATCH v1 1/7] dt-bindings: net: bluetooth: Add mediatek-bluetooth

2018-04-03 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 --- .../devicetree/bindings/net/mediatek-bluetooth.txt | 35 ++ 1 file changed, 35 insertions(

[PATCH v1 6/7] Bluetooth: hci_mediatek: Add protocol support for MediaTek serial devices

2018-04-03 Thread sean.wang
From: Sean Wang This adds a driver for the MediaTek serial protocol based on H4 protocol, which can enable the built-in Bluetooth device inside MT7622 SoC. Signed-off-by: Sean Wang --- drivers/bluetooth/Kconfig| 12 + drivers/bluetooth/Makefile | 1 + drivers/bluetooth/hci_med

[PATCH v1 4/7] soc: mediatek: reuse regmap_read_poll_timeout helpers

2018-04-03 Thread sean.wang
From: Sean Wang Reuse the common helpers regmap_read_poll_timeout provided by Linux core instead of an open-coded handling. Signed-off-by: Sean Wang Cc: Matthias Brugger Cc: Ulf Hansson Cc: Weiyi Lu --- drivers/soc/mediatek/mtk-infracfg.c | 45 + 1 file c

[PATCH v1 3/7] soc: mediatek: reuse read[l,x]_poll_timeout helpers

2018-04-03 Thread sean.wang
From: Sean Wang Reuse the common helpers read[l,x]_poll_timeout provided by Linux core instead of an open-coded handling. The name of the local variable sram_pdn_ack in scpsys_power_on is renamed to pdn_ack in order to be consistent with the one used in scpsys_power_off. Signed-off-by: Sean Wang

[PATCH v1 2/7] serdev: add dev_pm_domain_attach|detach()

2018-04-03 Thread sean.wang
From: Sean Wang In order to open up the required power gate before any operation can be effectively performed over the serial bus between CPU and serdev, it's clearly essential to add common attach functions for PM domains to serdev at the probe phase. Similarly, the relevant dettach function fo

[PATCH v1] pwm: mediatek: improve precision in rate calculation

2018-03-02 Thread sean.wang
From: Sean Wang Add a way that turning resolution from in nanosecond into in picosecond to improve noticeably almost 4.5% precision. It's necessary to hold the new resolution with type u64 and thus related operations on u64 are applied instead in those rate calculations. And the patch has a dep

[PATCH 2/2] mmc: mediatek: add support for MT7622 SoC

2018-03-04 Thread sean.wang
From: Sean Wang Just applying the existing logic and adding its own characteristics into the space pointed by an extra entry of struct of_device_id to have support of MT7622 SoC. Signed-off-by: Chaotian Jing Signed-off-by: Sean Wang Tested-by: Jumin Li --- drivers/mmc/host/mtk-sd.c | 12

[PATCH 1/2] mmc: dt-bindings: add support for MT7622 SoC

2018-03-04 Thread sean.wang
From: Sean Wang Add the devicetree binding for MT7622 SoC Signed-off-by: Sean Wang --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documentation/devicetree/bindings/mmc/mtk-sd.txt index

[PATCH v2 2/2] soc: mediatek: reuse regmap_read_poll_timeout helpers

2018-04-22 Thread sean.wang
From: Sean Wang Reuse the common helpers regmap_read_poll_timeout provided by Linux core instead of an open-coded handling. v1 -> v2: - use macro definitions MTK_POLL_DELAY_US and MTK_POLL_TIMEOUT for arguments sleep_us and timeout_us passing in regmap_read_poll_timeout. - remove unnecessar

[PATCH v2 1/2] regmap: include from include/linux/regmap.h

2018-04-22 Thread sean.wang
From: Sean Wang Similar to the readx_poll_timeout() macro calling ktime_* and using ktime_t type, which is declared in . So, make include/linux/regmap.h explicitly include , like include/linux/iopoll.h does. Otherwise, users of the macro will see below errors. error: implicit declaration of fun

[PATCH v2 1/2] soc: mediatek: introduce a CAPS flag for scp_domain_data

2018-04-23 Thread sean.wang
From: Sean Wang Instead of adding more and more fields to scp_domain_data which get checked in the code flow, add a caps field used for an indication the characteristics for each SCP domain. At present, type u8 for the caps field is selected which can satisfy the current situation and doesn't ta

[PATCH v2 2/2] soc: mediatek: add a fixed wait for SRAM stable

2018-04-23 Thread sean.wang
From: Sean Wang MT7622_POWER_DOMAIN_WB doesn't send an ACK when its managed SRAM becomes stable, which is not like the behavior the other power domains should have. Therefore, it's necessary for such a power domain to have a fixed and well-predefined duration to wait until its managed SRAM can be

[PATCH] arm64: defconfig: Enable CONFIG_PINCTRL_MT7622 by default

2018-04-20 Thread sean.wang
From: Sean Wang Recently kernelCI reported the board mt7622-rfb1 has a fail test with kernel: ERROR: did not start booting whose details could be seen at [1]. The cause is that UART0 can't output anything when it's missing a proper pin setup with current DTS, so the essential driver is always ge

[PATCH] soc: mediatek: remove unneeded semicolon

2018-05-09 Thread sean.wang
From: Sean Wang Fix up drivers/soc/mediatek/mtk-scpsys.c:255:2-3: Unneeded semicolon accidently being added in commit f9e2f65dd561 ("soc: mediatek: add a fixed wait for SRAM stable"). Fixes: f9e2f65dd561 ("soc: mediatek: add a fixed wait for SRAM stable") Reported-by: kbuild test robot Signed-o

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

2018-03-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 Reviewed-by: Rob Herring --- .../devicetree/bindings/dma/mtk-hsdma.txt | 33 ++ 1 fi

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

2018-03-15 Thread sean.wang
From: Sean Wang Changes since v6: - add Reviewed-by tag from Rob to patch 1 Changes since v5: - use C99 style comments at the first two lines - remove unused header includes - use directly KBUILD_MODNAME as a driver name - use DMA_SLAVE_BUSWIDTH_4_BYTES to reflect the real bus width - refine com

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

2018-03-15 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 v7 3/3] dmaengine: mediatek: update MAINTAINERS entry with MediaTek DMA driver

2018-03-15 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 3bdc260..d3c33d7 100644 --

[PATCH v1 0/4] add Mali-450 support to MT7623 SoC

2018-04-18 Thread sean.wang
From: Sean Wang Hi, The series adds a required resource setup to allow Mali-450 to work on MT7623. This also can benefits other MediaTek SoCs having Mali-450 device. In order to prove the setup is proper, I also have added mediatek port to linux-lima at [1] and make a few of tests along with of

<    1   2   3   4   5   6   7   8   >