drivers/media/i2c/mt9m114.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/mt9m114.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/mt9m114.c- Extension
.c- Size
- 83756 bytes
- Lines
- 2698
- Domain
- Driver Families
- Bucket
- drivers/media
- 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/clk.hlinux/delay.hlinux/errno.hlinux/gpio/consumer.hlinux/i2c.hlinux/mod_devicetable.hlinux/module.hlinux/mutex.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/regulator/consumer.hlinux/types.hlinux/videodev2.hmedia/v4l2-async.hmedia/v4l2-cci.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fwnode.hmedia/v4l2-mediabus.hmedia/v4l2-subdev.haptina-pll.h
Detected Declarations
struct mt9m114_model_infostruct mt9m114_format_infostruct mt9m114enum mt9m114_format_flagfunction mt9m114_default_format_infofunction mt9m114_format_infofunction mt9m114_poll_commandfunction mt9m114_poll_statefunction mt9m114_set_statefunction mt9m114_initializefunction mt9m114_configure_pafunction mt9m114_ifp_get_borderfunction mt9m114_configure_ifpfunction mt9m114_set_frame_ratefunction mt9m114_start_streamingfunction mt9m114_stop_streamingfunction mt9m114_pa_g_ctrlfunction mt9m114_pa_s_ctrlfunction mt9m114_pa_ctrl_update_exposurefunction mt9m114_pa_ctrl_update_blankingfunction mt9m114_pa_init_statefunction mt9m114_pa_enum_mbus_codefunction mt9m114_pa_enum_framesizesfunction mt9m114_pa_set_fmtfunction mt9m114_pa_get_selectionfunction mt9m114_pa_set_selectionfunction mt9m114_pa_initfunction mt9m114_pa_cleanupfunction mt9m114_ifp_s_ctrlfunction mt9m114_ifp_s_streamfunction mt9m114_ifp_get_frame_intervalfunction mt9m114_ifp_set_frame_intervalfunction mt9m114_ifp_init_statefunction mt9m114_ifp_enum_mbus_codefunction mt9m114_ifp_enum_framesizesfunction mt9m114_ifp_enum_frameintervalsfunction mt9m114_ifp_update_sel_and_src_fmtfunction mt9m114_ifp_set_fmtfunction mt9m114_ifp_get_selectionfunction mt9m114_ifp_set_selectionfunction mt9m114_ifp_unregisteredfunction mt9m114_ifp_registeredfunction mt9m114_ifp_initfunction mt9m114_ifp_cleanupfunction mt9m114_power_onfunction modefunction mt9m114_power_offfunction mt9m114_runtime_resume
Annotated Snippet
struct mt9m114_model_info {
bool state_standby_polling;
};
enum mt9m114_format_flag {
MT9M114_FMT_FLAG_PARALLEL = BIT(0),
MT9M114_FMT_FLAG_CSI2 = BIT(1),
};
struct mt9m114_format_info {
u32 code;
u32 output_format;
u32 flags;
};
struct mt9m114 {
struct i2c_client *client;
struct regmap *regmap;
struct clk *clk;
struct gpio_desc *reset;
struct regulator_bulk_data supplies[3];
struct v4l2_fwnode_endpoint bus_cfg;
bool bypass_pll;
struct aptina_pll pll;
unsigned int pixrate;
bool streaming;
u32 pad_slew_rate;
/* Pixel Array */
struct {
struct v4l2_subdev sd;
struct media_pad pad;
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *gain;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *vblank;
} pa;
/* Image Flow Processor */
struct {
struct v4l2_subdev sd;
struct media_pad pads[2];
struct v4l2_ctrl_handler hdl;
unsigned int frame_rate;
struct v4l2_ctrl *tpg[4];
} ifp;
const struct mt9m114_model_info *info;
};
/* -----------------------------------------------------------------------------
* Formats
*/
static const struct mt9m114_format_info mt9m114_format_infos[] = {
{
/*
* The first two entries are used as defaults, for parallel and
* CSI-2 buses respectively. Keep them in that order.
*/
.code = MEDIA_BUS_FMT_UYVY8_2X8,
.flags = MT9M114_FMT_FLAG_PARALLEL,
.output_format = MT9M114_CAM_OUTPUT_FORMAT_FORMAT_YUV,
}, {
.code = MEDIA_BUS_FMT_UYVY8_1X16,
.flags = MT9M114_FMT_FLAG_CSI2,
.output_format = MT9M114_CAM_OUTPUT_FORMAT_FORMAT_YUV,
}, {
.code = MEDIA_BUS_FMT_YUYV8_2X8,
.flags = MT9M114_FMT_FLAG_PARALLEL,
.output_format = MT9M114_CAM_OUTPUT_FORMAT_FORMAT_YUV
| MT9M114_CAM_OUTPUT_FORMAT_SWAP_BYTES,
}, {
.code = MEDIA_BUS_FMT_YUYV8_1X16,
.flags = MT9M114_FMT_FLAG_CSI2,
.output_format = MT9M114_CAM_OUTPUT_FORMAT_FORMAT_YUV
| MT9M114_CAM_OUTPUT_FORMAT_SWAP_BYTES,
}, {
.code = MEDIA_BUS_FMT_RGB565_2X8_LE,
.flags = MT9M114_FMT_FLAG_PARALLEL,
.output_format = MT9M114_CAM_OUTPUT_FORMAT_RGB_FORMAT_565RGB
| MT9M114_CAM_OUTPUT_FORMAT_FORMAT_RGB
| MT9M114_CAM_OUTPUT_FORMAT_SWAP_BYTES,
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/errno.h`, `linux/gpio/consumer.h`, `linux/i2c.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct mt9m114_model_info`, `struct mt9m114_format_info`, `struct mt9m114`, `enum mt9m114_format_flag`, `function mt9m114_default_format_info`, `function mt9m114_format_info`, `function mt9m114_poll_command`, `function mt9m114_poll_state`, `function mt9m114_set_state`, `function mt9m114_initialize`.
- Atlas domain: Driver Families / drivers/media.
- 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.