drivers/reset/reset-rzv2h-usb2phy.c
Source file repositories/reference/linux-study-clean/drivers/reset/reset-rzv2h-usb2phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/reset/reset-rzv2h-usb2phy.c- Extension
.c- Size
- 6763 bytes
- Lines
- 244
- Domain
- Driver Families
- Bucket
- drivers/reset
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/auxiliary_bus.hlinux/delay.hlinux/idr.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/reset.hlinux/reset-controller.h
Detected Declarations
struct rzv2h_usb2phy_reset_of_datastruct rzv2h_usb2phy_reset_privfunction rzv2h_usbphy_reset_assertfunction rzv2h_usbphy_reset_deassertfunction rzv2h_usbphy_reset_statusfunction rzv2h_usb2phy_reset_of_xlatefunction rzv2h_usb2phy_reset_ida_freefunction rzv2h_usb2phy_reset_mux_registerfunction rzv2h_usb2phy_reset_pm_runtime_putfunction rzv2h_usb2phy_reset_probe
Annotated Snippet
struct rzv2h_usb2phy_reset_of_data {
const struct reg_sequence *init_seq;
unsigned int init_nseq;
const struct reg_sequence *assert_seq;
unsigned int assert_nseq;
const struct reg_sequence *deassert_seq;
unsigned int deassert_nseq;
u16 reset_reg;
u16 reset_status_bits;
};
struct rzv2h_usb2phy_reset_priv {
const struct rzv2h_usb2phy_reset_of_data *data;
struct regmap *regmap;
struct device *dev;
struct reset_controller_dev rcdev;
};
static inline struct rzv2h_usb2phy_reset_priv
*rzv2h_usbphy_rcdev_to_priv(struct reset_controller_dev *rcdev)
{
return container_of(rcdev, struct rzv2h_usb2phy_reset_priv, rcdev);
}
static int rzv2h_usbphy_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
return regmap_multi_reg_write(priv->regmap, priv->data->assert_seq,
priv->data->assert_nseq);
}
static int rzv2h_usbphy_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
return regmap_multi_reg_write(priv->regmap, priv->data->deassert_seq,
priv->data->deassert_nseq);
}
static int rzv2h_usbphy_reset_status(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct rzv2h_usb2phy_reset_priv *priv = rzv2h_usbphy_rcdev_to_priv(rcdev);
u32 reg;
regmap_read(priv->regmap, priv->data->reset_reg, ®);
return (reg & priv->data->reset_status_bits) == priv->data->reset_status_bits;
}
static const struct reset_control_ops rzv2h_usbphy_reset_ops = {
.assert = rzv2h_usbphy_reset_assert,
.deassert = rzv2h_usbphy_reset_deassert,
.status = rzv2h_usbphy_reset_status,
};
static int rzv2h_usb2phy_reset_of_xlate(struct reset_controller_dev *rcdev,
const struct of_phandle_args *reset_spec)
{
/* No special handling needed, we have only one reset line per device */
return 0;
}
static void rzv2h_usb2phy_reset_ida_free(void *data)
{
struct auxiliary_device *adev = data;
ida_free(&auxiliary_ids, adev->id);
}
static int rzv2h_usb2phy_reset_mux_register(struct device *dev,
const char *mux_name)
{
struct auxiliary_device *adev;
int id;
id = ida_alloc(&auxiliary_ids, GFP_KERNEL);
if (id < 0)
return id;
adev = __devm_auxiliary_device_create(dev, dev->driver->name,
mux_name, NULL, id);
if (!adev) {
ida_free(&auxiliary_ids, id);
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/delay.h`, `linux/idr.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct rzv2h_usb2phy_reset_of_data`, `struct rzv2h_usb2phy_reset_priv`, `function rzv2h_usbphy_reset_assert`, `function rzv2h_usbphy_reset_deassert`, `function rzv2h_usbphy_reset_status`, `function rzv2h_usb2phy_reset_of_xlate`, `function rzv2h_usb2phy_reset_ida_free`, `function rzv2h_usb2phy_reset_mux_register`, `function rzv2h_usb2phy_reset_pm_runtime_put`, `function rzv2h_usb2phy_reset_probe`.
- Atlas domain: Driver Families / drivers/reset.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.