All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxkernel@fbautosys.co.uk
To: linux-kernel@vger.kernel.org
Cc: broonie@kernel.org
Subject: [RFC PATCH 0/5] regmap: Add Parity bit Calculation to regmaps
Date: Fri, 17 Dec 2021 22:40:59 +0000	[thread overview]
Message-ID: <20211217224104.1747758-1-linuxkernel@fbautosys.co.uk> (raw)

From: Christopher Tyerman <c.tyerman@firebladeautomationsystems.co.uk>

this patch set adds parity bit calculation to regmaps

this allow support for devices that require parity bits in their
communications.

e.g. the texas instruments TPS92518-Q1 which requires a parity bit in the
7th bit of a 16 bit spi frame 
or the TPS92518-Q1 which requires a parity bit in the 1st bit of a 16 bit 
spi frame

parity aimed to work devices where parity in reg block
e.g. TPS65311-Q1 and TPS92518-Q1

TPS65311-Q1 frame format	[PWRRRRRRDDDDDDDD]
TPS92518-Q1	frame format	[WRRRRRPDDDDDDDDD]
P - parity bit, W - Read/Write bit, R - register, D -register data

TPS65311-Q1 parity mask 0x8000 (1000000000000000)
TPS92518-Q1	parity mask	0x0200 (0000001000000000)


calculates parity bit based up parity function defined by
regmap_config->parity_calc

regmap_config->parity_calc defaults to regmap_parity_calc_even()

adds alternate parity function regmap_parity_calc_odd()

calculates parity bit for writes if regmap_config->parity_write_mask is > 0
calculates parity bit for reads if regmap_config->parity_read_mask is > 0

parity is not calculated when bus implements reg_update_bits()


Altered the regmap_format_X_X_write functions to account for padding bits
allowing masks to write to either end of register address for formatted 
writes

Altered formatted_write to apply write and parity masks

Added parsers for 9 bit data format which are written by formatted write

Christopher Tyerman (5):
  Add Parity bit Calculation to regmaps
  Altered regmap_X_X_write functions to account for padding bits
  Added setting of writemap to formatted write
  Add Parity Calculation to formatted write
  Add parser for X_9 formats

 drivers/base/regmap/internal.h |   6 +
 drivers/base/regmap/regmap.c   | 250 +++++++++++++++++++++++++++++++--
 include/linux/regmap.h         |  32 +++++
 3 files changed, 280 insertions(+), 8 deletions(-)


base-commit: 02d6fdecb9c38de19065f6bed8d5214556fd061d
-- 
2.25.1


             reply	other threads:[~2021-12-17 22:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 22:40 linuxkernel [this message]
2021-12-17 22:41 ` [RFC PATCH 1/5] regmap: Add Parity bit Calculation to regmaps linuxkernel
2021-12-20 14:05   ` Mark Brown
2021-12-17 22:41 ` [RFC PATCH 2/5] regmap: Altered regmap_X_X_write functions to account for padding bits linuxkernel
2021-12-17 22:41 ` [RFC PATCH 3/5] regmap: Added setting of writemap to formatted write linuxkernel
2021-12-17 22:41 ` [RFC PATCH 4/5] regmap: Add Parity Calculation " linuxkernel
2021-12-17 22:41 ` [RFC PATCH 5/5] regmap: Add parser for X_9 formats linuxkernel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217224104.1747758-1-linuxkernel@fbautosys.co.uk \
    --to=linuxkernel@fbautosys.co.uk \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.