[PATCH 1/2] power: pmic: Support pmic pf0900

Tom Rini trini at konsulko.com
Thu Oct 10 20:25:28 CEST 2024


On Mon, Sep 30, 2024 at 11:22:42AM +0800, Peng Fan (OSS) wrote:

> From: Joy Zou <joy.zou at nxp.com>
> 
> Support NXP pmic pf0900
> 
> Reviewed-by: Ye Li <ye.li at nxp.com>
> Signed-off-by: Joy Zou <joy.zou at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
> ---
>  drivers/power/pmic/Kconfig  |  15 ++
>  drivers/power/pmic/Makefile |   1 +
>  drivers/power/pmic/pf0900.c | 174 +++++++++++++++++++++++
>  include/power/pf0900.h      | 269 ++++++++++++++++++++++++++++++++++++
>  4 files changed, 459 insertions(+)
>  create mode 100644 drivers/power/pmic/pf0900.c
>  create mode 100644 include/power/pf0900.h

No MAINTAINERS update for this file. And 

[snip]
> +static u8 crc8_j1850(u8 *data, u8 length)
> +{
> +	u8 t_crc;
> +	u8 i, j;
> +
> +	t_crc = 0xFF;
> +	for (i = 0; i < length; i++) {
> +		t_crc ^= data[i];
> +		for (j = 0; j < 8; j++) {
> +			if ((t_crc & 0x80) != 0) {
> +				t_crc <<= 1;
> +				t_crc ^= 0x1D;
> +			} else {
> +				t_crc <<= 1;
> +			}
> +		}
> +	}
> +	return t_crc;
> +}

This gets repeated in other drivers and I gather this is "CRC8 SAE
J1850" algorithm? This should get put in lib/crc8.c and re-used as
needed.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20241010/a5ef1bcc/attachment.sig>


More information about the U-Boot mailing list