drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c- Extension
.c- Size
- 33588 bytes
- Lines
- 1319
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/i2c.hlinux/dmi.hlinux/efi.hlinux/pci.hlinux/acpi.hlinux/clk.hlinux/delay.hmedia/v4l2-subdev.hlinux/mfd/intel_soc_pmic.hlinux/regulator/consumer.hlinux/gpio/consumer.hlinux/platform_device.hlinux/string_choices.h../../include/linux/atomisp_platform.h../../include/linux/atomisp_gmin_platform.h
Detected Declarations
struct gmin_subdevstruct gmin_cfg_varenum clock_ratefunction atomisp_register_i2c_modulefunction atomisp_gmin_remove_subdevfunction gmin_i2c_writefunction atomisp_get_acpi_powerfunction gmin_get_pmic_id_and_addrfunction gmin_detect_pmicfunction gmin_subdev_addfunction D0function axp_regulator_setfunction axp_v1p8_onfunction axp_v1p8_offfunction gmin_gpio0_ctrlfunction gmin_gpio1_ctrlfunction gmin_v1p2_ctrlfunction gmin_v1p8_ctrlfunction gmin_v2p8_ctrlfunction gmin_acpi_pm_ctrlfunction gmin_flisclk_ctrlfunction camera_sensor_csi_allocfunction camera_sensor_csi_freefunction gmin_csi_cfgfunction atomisp_register_sensor_no_gminfunction atomisp_unregister_subdevfunction gmin_camera_platform_datafunction gmin_get_hardcoded_varfunction gmin_get_config_dsm_varfunction gmin_get_config_varfunction gmin_get_var_intfunction isp_pm_cap_fixupexport atomisp_platform_get_subdevsexport atomisp_register_i2c_moduleexport atomisp_gmin_remove_subdevexport atomisp_register_sensor_no_gminexport atomisp_unregister_subdevexport gmin_camera_platform_dataexport gmin_get_var_int
Annotated Snippet
struct gmin_subdev {
struct v4l2_subdev *subdev;
enum clock_rate clock_src;
struct clk *pmc_clk;
struct gpio_desc *gpio0;
struct gpio_desc *gpio1;
struct regulator *v1p8_reg;
struct regulator *v2p8_reg;
struct regulator *v1p2_reg;
enum atomisp_camera_port csi_port;
unsigned int csi_lanes;
enum atomisp_input_format csi_fmt;
enum atomisp_bayer_order csi_bayer;
bool clock_on;
bool v1p8_on;
bool v2p8_on;
bool v1p2_on;
u8 pwm_i2c_addr;
/* For PMIC AXP */
int eldo1_sel_reg, eldo1_1p6v, eldo1_ctrl_shift;
int eldo2_sel_reg, eldo2_1p8v, eldo2_ctrl_shift;
};
static struct gmin_subdev gmin_subdevs[MAX_SUBDEVS];
/* ACPI HIDs for the PMICs that could be used by this driver */
#define PMIC_ACPI_AXP "INT33F4" /* XPower AXP288 PMIC */
#define PMIC_ACPI_TI "INT33F5" /* Dollar Cove TI PMIC */
#define PMIC_ACPI_CRYSTALCOVE "INT33FD" /* Crystal Cove PMIC */
#define PMIC_PLATFORM_TI "intel_soc_pmic_chtdc_ti"
static enum {
PMIC_UNSET = 0,
PMIC_REGULATOR,
PMIC_AXP,
PMIC_TI,
PMIC_CRYSTALCOVE
} pmic_id;
static const char *pmic_name[] = {
[PMIC_UNSET] = "ACPI device PM",
[PMIC_REGULATOR] = "regulator driver",
[PMIC_AXP] = "XPower AXP288 PMIC",
[PMIC_TI] = "Dollar Cove TI PMIC",
[PMIC_CRYSTALCOVE] = "Crystal Cove PMIC",
};
static DEFINE_MUTEX(gmin_regulator_mutex);
static int gmin_v1p8_enable_count;
static int gmin_v2p8_enable_count;
/* The atomisp uses subdev==NULL for the end-of-list marker, so leave space. */
static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1];
static struct gmin_subdev *find_gmin_subdev(struct v4l2_subdev *subdev);
const struct intel_v4l2_subdev_table *atomisp_platform_get_subdevs(void)
{
return pdata_subdevs;
}
EXPORT_SYMBOL_GPL(atomisp_platform_get_subdevs);
int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data)
{
int i;
struct gmin_subdev *gs;
struct i2c_client *client = v4l2_get_subdevdata(subdev);
struct acpi_device *adev = ACPI_COMPANION(&client->dev);
/* The windows driver model (and thus most BIOSes by default)
* uses ACPI runtime power management for camera devices, but
* we don't. Disable it, or else the rails will be needlessly
* tickled during suspend/resume. This has caused power and
* performance issues on multiple devices.
*/
/*
* Turn off the device before disabling ACPI power resources
* (the sensor driver has already probed it at this point).
* This avoids leaking the reference count of the (possibly shared)
* ACPI power resources which were enabled/referenced before probe().
*/
acpi_device_set_power(adev, ACPI_STATE_D3_COLD);
adev->power.flags.power_resources = 0;
Annotation
- Immediate include surface: `linux/module.h`, `linux/i2c.h`, `linux/dmi.h`, `linux/efi.h`, `linux/pci.h`, `linux/acpi.h`, `linux/clk.h`, `linux/delay.h`.
- Detected declarations: `struct gmin_subdev`, `struct gmin_cfg_var`, `enum clock_rate`, `function atomisp_register_i2c_module`, `function atomisp_gmin_remove_subdev`, `function gmin_i2c_write`, `function atomisp_get_acpi_power`, `function gmin_get_pmic_id_and_addr`, `function gmin_detect_pmic`, `function gmin_subdev_add`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.