mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
Pull i3c updates from Alexandre Belloni: "HDR support has finally been added. mipi-i3c-hci has been reworked and Intel Nova Lake-S support has been added. Subsystem: - Add HDR transfer support Drivers: - dw: fix bus hang on Agilex5 - mipi-i3c-hci: Intel Nova Lake-S support, IOMMU support - svc: HDR support" * tag 'i3c/for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: (28 commits) regmap: i3c: switch to use i3c_xfer from i3c_priv_xfer net: mctp i3c: switch to use i3c_xfer from i3c_priv_xfer hwmon: (lm75): switch to use i3c_xfer from i3c_priv_xfer i3c: document i3c_xfers i3c: fix I3C_SDR bit number i3c: master: svc: Add basic HDR mode support i3c: master: svc: Replace bool rnw with union for HDR support i3c: Switch to use new i3c_xfer from i3c_priv_xfer i3c: Add HDR API support i3c: master: add WQ_PERCPU to alloc_workqueue users i3c: master: Remove i3c_device_free_ibi from i3c_device_remove i3c: mipi-i3c-hci-pci: Set d3cold_delay to 0 for Intel controllers i3c: mipi-i3c-hci-pci: Add LTR support for Intel controllers i3c: mipi-i3c-hci-pci: Add exit callback i3c: mipi-i3c-hci-pci: Change callback parameter i3c: mipi-i3c-hci-pci: Allocate a structure for mipi_i3c_hci_pci device information i3c: mipi-i3c-hci-pci: Factor out intel_reset() i3c: mipi-i3c-hci-pci: Factor out private registers ioremapping i3c: mipi-i3c-hci-pci: Constify driver data i3c: mipi-i3c-hci-pci: Use readl_poll_timeout() ...
62 lines
1.5 KiB
C
62 lines
1.5 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
// Copyright (c) 2018 Synopsys, Inc. and/or its affiliates.
|
|
|
|
#include <linux/array_size.h>
|
|
#include <linux/regmap.h>
|
|
#include <linux/i3c/device.h>
|
|
#include <linux/i3c/master.h>
|
|
#include <linux/module.h>
|
|
|
|
static int regmap_i3c_write(void *context, const void *data, size_t count)
|
|
{
|
|
struct device *dev = context;
|
|
struct i3c_device *i3c = dev_to_i3cdev(dev);
|
|
struct i3c_xfer xfers[] = {
|
|
{
|
|
.rnw = false,
|
|
.len = count,
|
|
.data.out = data,
|
|
},
|
|
};
|
|
|
|
return i3c_device_do_xfers(i3c, xfers, ARRAY_SIZE(xfers), I3C_SDR);
|
|
}
|
|
|
|
static int regmap_i3c_read(void *context,
|
|
const void *reg, size_t reg_size,
|
|
void *val, size_t val_size)
|
|
{
|
|
struct device *dev = context;
|
|
struct i3c_device *i3c = dev_to_i3cdev(dev);
|
|
struct i3c_xfer xfers[2];
|
|
|
|
xfers[0].rnw = false;
|
|
xfers[0].len = reg_size;
|
|
xfers[0].data.out = reg;
|
|
|
|
xfers[1].rnw = true;
|
|
xfers[1].len = val_size;
|
|
xfers[1].data.in = val;
|
|
|
|
return i3c_device_do_xfers(i3c, xfers, ARRAY_SIZE(xfers), I3C_SDR);
|
|
}
|
|
|
|
static const struct regmap_bus regmap_i3c = {
|
|
.write = regmap_i3c_write,
|
|
.read = regmap_i3c_read,
|
|
};
|
|
|
|
struct regmap *__devm_regmap_init_i3c(struct i3c_device *i3c,
|
|
const struct regmap_config *config,
|
|
struct lock_class_key *lock_key,
|
|
const char *lock_name)
|
|
{
|
|
return __devm_regmap_init(&i3c->dev, ®map_i3c, &i3c->dev, config,
|
|
lock_key, lock_name);
|
|
}
|
|
EXPORT_SYMBOL_GPL(__devm_regmap_init_i3c);
|
|
|
|
MODULE_AUTHOR("Vitor Soares <vitor.soares@synopsys.com>");
|
|
MODULE_DESCRIPTION("regmap I3C Module");
|
|
MODULE_LICENSE("GPL v2");
|