Re: [PATCH v1 30/31] serial: 8250_mxpcie: Add sysfs to control pull state via CPLD

From: Andy Shevchenko

Date: Sun Nov 30 2025 - 21:43:05 EST


On Sun, Nov 30, 2025 at 12:46 PM Crescent Hsieh
<crescentcy.hsieh@xxxxxxxx> wrote:
>
> Some Moxa PCIe boards provide a CPLD-controlled pull/bias state.
> Expose a per-port sysfs attribute to read and set the pull state from
> userspace.
>
> This patch:
> - Defines MOXA_CPLD_PULL_STATE_FLAG and {ENABLE,DISABLE} values.
> - Implements mxpcie8250_cpld_{set,get}_pull_state() with board_lock
> to serialize CPLD access.
> - Exports "mxpcie8250_pull_state" in the driver's attr group.
> - Restricts support to CPLD-based models (CP118E-A-I, CP138E-A,
> CP134EL-A, CP116E-A-A, CP116E-A-B); return -ENODEV on others.
>
> Example:
> # Enable pull state on ttyS*
> echo 1 > /sys/class/tty/ttyS*/mxpcie8250_pull_state
>
> # Query pull state
> cat /sys/class/tty/ttyS*/mxpcie8250_pull_state
> enabled

Okay, this all reminds me of the pin control subsystem. It has already
established an interface to do things, why do we need this custom one
here?

--
With Best Regards,
Andy Shevchenko