mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-05 02:51:00 +00:00
b953ec2bca
Define LOG_CATEGORY for all uclass to allow filtering with log command. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
41 lines
841 B
C
41 lines
841 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* SPMI bus uclass driver
|
|
*
|
|
* (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
|
|
*/
|
|
|
|
#define LOG_CATEGORY UCLASS_SPMI
|
|
|
|
#include <common.h>
|
|
#include <dm.h>
|
|
#include <errno.h>
|
|
#include <spmi/spmi.h>
|
|
#include <linux/ctype.h>
|
|
|
|
int spmi_reg_read(struct udevice *dev, int usid, int pid, int reg)
|
|
{
|
|
const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
|
|
|
|
if (!ops || !ops->read)
|
|
return -ENOSYS;
|
|
|
|
return ops->read(dev, usid, pid, reg);
|
|
}
|
|
|
|
int spmi_reg_write(struct udevice *dev, int usid, int pid, int reg,
|
|
uint8_t value)
|
|
{
|
|
const struct dm_spmi_ops *ops = dev_get_driver_ops(dev);
|
|
|
|
if (!ops || !ops->write)
|
|
return -ENOSYS;
|
|
|
|
return ops->write(dev, usid, pid, reg, value);
|
|
}
|
|
|
|
UCLASS_DRIVER(spmi) = {
|
|
.id = UCLASS_SPMI,
|
|
.name = "spmi",
|
|
.post_bind = dm_scan_fdt_dev,
|
|
};
|