[PATCH v4 0/2] iio: adc: mcp320x: bitfield refactoring
Gustavo Pagnotta Faria
gustavo.pagnotta em ime.usp.br
Qua Abr 22 18:23:03 -03 2026
This patch series refactors the mcp320x driver to use the standard
Linux bitfield API and sorts the headers alphabetically as requested.
Changes in v4:
- Separated the patch into a series (Patch 1: sort headers,
Patch 2: bitfield refactor).
- Fixed style of MCP3550 comment
- Avoided variable reassignments (foo = bar(foo)) and used explicit
temporary variables.
- Replaced boolean casting (!differential) with ternary operator.
- Fixed line length limit warning in the mcp3301 case by introducing
temporary variables.
- Fixed placement of RX data extraction in the MCP3550 block to
strictly follow the descriptive comment, as requested.
- Link to v3: https://lore.kernel.org/linux-iio/20260422030846.45317-1-gustavo.pagnotta@ime.usp.br/
Changes in v3:
- Removed wildcard 'X' from all macros (including MCP355X -> MCP3550),
using lowest part number instead.
- Separated Tx channel masks for 4-channel (MCP3004) and
8-channel (MCP3008).
- Added comment explaining MCP3550 Data and Status bits usage.
- Replaced be16_to_cpup() and be32_to_cpup() with get_unaligned_be16()
and get_unaligned_be32(), moving them inside the relevant switch cases.
- Fixed accidental removal of '~' operator in MCP3550 overrange clearing.
- Link to v2: https://lore.kernel.org/linux-iio/20260420215021.14112-1-gustavo.pagnotta@ime.usp.br/
Changes in v2:
- Sent previously as an unversioned reply to the v1 thread.
- Fixed typo in author's email address.
- Link to v1: https://lore.kernel.org/linux-iio/20260420212405.11789-1-gustavo.pagnotta@ime.usp.br/
Gustavo Pagnotta Faria (2):
iio: adc: mcp320x: sort headers alphabetically
iio: adc: mcp320x: refactor driver to use bitfield API
drivers/iio/adc/mcp320x.c | 89 ++++++++++++++++++++++++++++-----------
1 file changed, 65 insertions(+), 24 deletions(-)
--
2.43.0
Mais detalhes sobre a lista de discussão kernel