drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
Source file repositories/reference/linux-study-clean/drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/imu/inv_icm45600/inv_icm45600_i2c.c- Extension
.c- Size
- 2736 bytes
- Lines
- 99
- Domain
- Driver Families
- Bucket
- drivers/iio
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/err.hlinux/i2c.hlinux/module.hlinux/mod_devicetable.hlinux/regmap.hinv_icm45600.h
Detected Declarations
function inv_icm45600_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/* Copyright (C) 2025 InvenSense, Inc. */
#include <linux/device.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/regmap.h>
#include "inv_icm45600.h"
static const struct regmap_config inv_icm45600_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
};
static int inv_icm45600_probe(struct i2c_client *client)
{
const struct inv_icm45600_chip_info *chip_info;
struct regmap *regmap;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
return -ENODEV;
chip_info = device_get_match_data(&client->dev);
if (!chip_info)
return -ENODEV;
regmap = devm_regmap_init_i2c(client, &inv_icm45600_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return inv_icm45600_core_probe(regmap, chip_info, true, NULL);
}
/*
* The device id table is used to identify which device is
* supported by this driver.
*/
static const struct i2c_device_id inv_icm45600_id[] = {
{ "icm45605", (kernel_ulong_t)&inv_icm45605_chip_info },
{ "icm45606", (kernel_ulong_t)&inv_icm45606_chip_info },
{ "icm45608", (kernel_ulong_t)&inv_icm45608_chip_info },
{ "icm45634", (kernel_ulong_t)&inv_icm45634_chip_info },
{ "icm45686", (kernel_ulong_t)&inv_icm45686_chip_info },
{ "icm45687", (kernel_ulong_t)&inv_icm45687_chip_info },
{ "icm45688p", (kernel_ulong_t)&inv_icm45688p_chip_info },
{ "icm45689", (kernel_ulong_t)&inv_icm45689_chip_info },
{ }
};
MODULE_DEVICE_TABLE(i2c, inv_icm45600_id);
static const struct of_device_id inv_icm45600_of_matches[] = {
{
.compatible = "invensense,icm45605",
.data = &inv_icm45605_chip_info,
}, {
.compatible = "invensense,icm45606",
.data = &inv_icm45606_chip_info,
}, {
.compatible = "invensense,icm45608",
.data = &inv_icm45608_chip_info,
}, {
.compatible = "invensense,icm45634",
.data = &inv_icm45634_chip_info,
}, {
.compatible = "invensense,icm45686",
.data = &inv_icm45686_chip_info,
}, {
.compatible = "invensense,icm45687",
.data = &inv_icm45687_chip_info,
}, {
.compatible = "invensense,icm45688p",
.data = &inv_icm45688p_chip_info,
}, {
.compatible = "invensense,icm45689",
.data = &inv_icm45689_chip_info,
},
{ }
};
MODULE_DEVICE_TABLE(of, inv_icm45600_of_matches);
static struct i2c_driver inv_icm45600_driver = {
.driver = {
.name = "inv-icm45600-i2c",
.of_match_table = inv_icm45600_of_matches,
.pm = pm_ptr(&inv_icm45600_pm_ops),
},
.id_table = inv_icm45600_id,
Annotation
- Immediate include surface: `linux/device.h`, `linux/err.h`, `linux/i2c.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/regmap.h`, `inv_icm45600.h`.
- Detected declarations: `function inv_icm45600_probe`.
- Atlas domain: Driver Families / drivers/iio.
- 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.