From patchwork Thu Jun 11 19:45:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pratyush Yadav X-Patchwork-Id: 242146 List-Id: U-Boot discussion From: p.yadav at ti.com (Pratyush Yadav) Date: Fri, 12 Jun 2020 01:15:00 +0530 Subject: [PATCH v3 0/6] drivers: Add a framework for MUX drivers Message-ID: <20200611194506.7263-1-p.yadav@ti.com> Hi, This series is a re-roll of Jean-Jacques' earlier effort. It adds a new minimalistic subsystem that handles multiplexer controllers. It provides the same API as Linux and mux drivers should be portable with a minimum effort. This series also includes a port of the Linux's mmio-mux driver. This series relies on a series that extends the regmap [0]. [0] https://patchwork.ozlabs.org/project/uboot/list/?series=181623 Changes in v3: - Add a new command called 'mux' that allows listing, selecting, and deselecting muxes on the fly. - Move call to dm_mux_init() to initr_dm_devices(). - Enable mmio operations in sandbox on board_init() to dm_mux_init() can initialize muxes to their idle state and allow the tests to pass. - Add help for CONFIG_MULTIPLEXER. - Change dev_err() in mmio_mux_probe() to log_msg_ret() or log_err(). - Add comments on static functions in mux-class.c - Make mux_uclass_post_probe() static. - Make dm_mux_init() return an integer to signal failure. - Change ifdef of mux-internal.h to _HUX_INTERNAL_H. - Remove unused include from mux-internal.h - Remove comments for non-existent members in struct mux_chip. - Add missing comments for some members in struct mux_control. - Add missing comments for some functions in mux.h - Split up the mux_mmio test into two parts. More would lead to a lot of boilerplate. - Change ut_assertok(IS_ERR(ptr)) to ut_assertok_ptr(ptr). - Fix mis-spellings and capitalize comments. - Rebase on latest master. Changes in v2: - Fixed warning in mux_of_xlate_default() - Improved documentation - Fixed SPL build - insert the mux initialization in init_sequence_r[], just before the console is initialized as its serial port may be muxed - moved the definition of dm_mux_init() in this commit - Call sandbox_set_enable_memio(true) before running the test Jean-Jacques Hiblot (4): drivers: Add a new framework for multiplexer devices dm: board: complete the initialization of the muxes in initr_dm() drivers: mux: mmio-based syscon mux controller test: Add tests for the multiplexer framework Pratyush Yadav (2): cmd: Add a mux command sandbox: Enable memio operations in board_init arch/sandbox/dts/test.dts | 25 +++ board/sandbox/sandbox.c | 2 + cmd/Kconfig | 6 + cmd/Makefile | 1 + cmd/mux.c | 161 ++++++++++++++++ common/board_r.c | 12 ++ configs/sandbox_defconfig | 2 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/mux/Kconfig | 25 +++ drivers/mux/Makefile | 7 + drivers/mux/mmio.c | 143 +++++++++++++++ drivers/mux/mux-uclass.c | 334 ++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/dt-bindings/mux/mux.h | 17 ++ include/mux-internal.h | 109 +++++++++++ include/mux.h | 159 ++++++++++++++++ test/dm/Makefile | 1 + test/dm/mux-mmio.c | 168 +++++++++++++++++ 19 files changed, 1176 insertions(+) create mode 100644 cmd/mux.c create mode 100644 drivers/mux/Kconfig create mode 100644 drivers/mux/Makefile create mode 100644 drivers/mux/mmio.c create mode 100644 drivers/mux/mux-uclass.c create mode 100644 include/dt-bindings/mux/mux.h create mode 100644 include/mux-internal.h create mode 100644 include/mux.h create mode 100644 test/dm/mux-mmio.c --- 2.27.0