drivers/iio/accel/fxls8962af-core.c
Source file repositories/reference/linux-study-clean/drivers/iio/accel/fxls8962af-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/accel/fxls8962af-core.c- Extension
.c- Size
- 33372 bytes
- Lines
- 1318
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bits.hlinux/bitfield.hlinux/i2c.hlinux/irq.hlinux/module.hlinux/mod_devicetable.hlinux/pm_runtime.hlinux/property.hlinux/regulator/consumer.hlinux/regmap.hlinux/types.hlinux/units.hlinux/iio/buffer.hlinux/iio/events.hlinux/iio/iio.hlinux/iio/kfifo_buf.hlinux/iio/sysfs.hfxls8962af.h
Detected Declarations
struct fxls8962af_chip_infostruct fxls8962af_dataenum fxls8962af_int_pinfunction fxls8962af_power_onfunction fxls8962af_power_offfunction fxls8962af_standbyfunction fxls8962af_activefunction fxls8962af_is_activefunction fxls8962af_get_outfunction fxls8962af_read_availfunction fxls8962af_write_raw_get_fmtfunction fxls8962af_update_configfunction fxls8962af_set_full_scalefunction fxls8962af_read_full_scalefunction fxls8962af_set_samp_freqfunction fxls8962af_read_samp_freqfunction fxls8962af_read_rawfunction fxls8962af_write_rawfunction fxls8962af_event_setupfunction fxls8962af_set_watermarkfunction __fxls8962af_set_thresholdsfunction fxls8962af_read_eventfunction fxls8962af_write_eventfunction fxls8962af_read_event_configfunction fxls8962af_write_event_configfunction fxls8962af_resetfunction __fxls8962af_fifo_set_modefunction fxls8962af_buffer_preenablefunction fxls8962af_buffer_postenablefunction fxls8962af_buffer_predisablefunction fxls8962af_buffer_postdisablefunction fxls8962af_i2c_raw_read_errata3function fxls8962af_fifo_transferfunction fxls8962af_fifo_flushfunction iio_for_each_active_channelfunction fxls8962af_event_interruptfunction fxls8962af_interruptfunction fxls8962af_pm_disablefunction fxls8962af_get_irqfunction fxls8962af_irq_setupfunction fxls8962af_core_probefunction fxls8962af_runtime_suspendfunction fxls8962af_runtime_resumefunction fxls8962af_suspendfunction fxls8962af_resume
Annotated Snippet
struct fxls8962af_chip_info {
const char *name;
const struct iio_chan_spec *channels;
int num_channels;
u8 chip_id;
};
struct fxls8962af_data {
struct regmap *regmap;
const struct fxls8962af_chip_info *chip_info;
struct {
__le16 channels[3];
aligned_s64 ts;
} scan;
int64_t timestamp, old_timestamp; /* Only used in hw fifo mode. */
struct iio_mount_matrix orientation;
int irq;
u8 watermark;
u8 enable_event;
u16 lower_thres;
u16 upper_thres;
};
const struct regmap_config fxls8962af_i2c_regmap_conf = {
.reg_bits = 8,
.val_bits = 8,
.max_register = FXLS8962AF_MAX_REG,
};
EXPORT_SYMBOL_NS_GPL(fxls8962af_i2c_regmap_conf, "IIO_FXLS8962AF");
const struct regmap_config fxls8962af_spi_regmap_conf = {
.reg_bits = 8,
.pad_bits = 8,
.val_bits = 8,
.max_register = FXLS8962AF_MAX_REG,
};
EXPORT_SYMBOL_NS_GPL(fxls8962af_spi_regmap_conf, "IIO_FXLS8962AF");
enum {
fxls8962af_idx_x,
fxls8962af_idx_y,
fxls8962af_idx_z,
fxls8962af_idx_ts,
};
enum fxls8962af_int_pin {
FXLS8962AF_PIN_INT1,
FXLS8962AF_PIN_INT2,
};
static int fxls8962af_power_on(struct fxls8962af_data *data)
{
struct device *dev = regmap_get_device(data->regmap);
int ret;
ret = pm_runtime_resume_and_get(dev);
if (ret)
dev_err(dev, "failed to power on\n");
return ret;
}
static int fxls8962af_power_off(struct fxls8962af_data *data)
{
struct device *dev = regmap_get_device(data->regmap);
int ret;
ret = pm_runtime_put_autosuspend(dev);
if (ret)
dev_err(dev, "failed to power off\n");
return ret;
}
static int fxls8962af_standby(struct fxls8962af_data *data)
{
return regmap_clear_bits(data->regmap, FXLS8962AF_SENS_CONFIG1,
FXLS8962AF_SENS_CONFIG1_ACTIVE);
}
static int fxls8962af_active(struct fxls8962af_data *data)
{
return regmap_update_bits(data->regmap, FXLS8962AF_SENS_CONFIG1,
FXLS8962AF_SENS_CONFIG1_ACTIVE, 1);
}
static int fxls8962af_is_active(struct fxls8962af_data *data)
{
unsigned int reg;
int ret;
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/i2c.h`, `linux/irq.h`, `linux/module.h`, `linux/mod_devicetable.h`, `linux/pm_runtime.h`, `linux/property.h`.
- Detected declarations: `struct fxls8962af_chip_info`, `struct fxls8962af_data`, `enum fxls8962af_int_pin`, `function fxls8962af_power_on`, `function fxls8962af_power_off`, `function fxls8962af_standby`, `function fxls8962af_active`, `function fxls8962af_is_active`, `function fxls8962af_get_out`, `function fxls8962af_read_avail`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.