mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-07-06 11:16:15 +09:00
d024236e5a
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
41 lines
810 B
C
41 lines
810 B
C
/*
|
|
* SPMI bus uclass driver
|
|
*
|
|
* (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#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,
|
|
};
|