#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/dmi.h>
#include <linux/efi.h>
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <media/v4l2-subdev.h>
#include <linux/mfd/intel_soc_pmic.h>
#include <linux/regulator/consumer.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include "../../include/linux/atomisp_platform.h"
#include "../../include/linux/atomisp_gmin_platform.h"
#define MAX_SUBDEVS …
enum clock_rate { … };
#define CLK_RATE_19_2MHZ …
#define CLK_RATE_25_0MHZ …
#define MAX_CLK_COUNT …
#define ALDO1_SEL_REG …
#define ALDO1_CTRL3_REG …
#define ALDO1_2P8V …
#define ALDO1_CTRL3_SHIFT …
#define ELDO_CTRL_REG …
#define ELDO1_SEL_REG …
#define ELDO1_1P6V …
#define ELDO1_CTRL_SHIFT …
#define ELDO2_SEL_REG …
#define ELDO2_1P8V …
#define ELDO2_CTRL_SHIFT …
#define LDO9_REG …
#define LDO10_REG …
#define LDO11_REG …
#define LDO_2P8V_ON …
#define LDO_2P8V_OFF …
#define LDO_1P8V_ON …
#define LDO_1P8V_OFF …
#define CRYSTAL_BYT_1P8V_REG …
#define CRYSTAL_BYT_2P8V_REG …
#define CRYSTAL_CHT_1P8V_REG …
#define CRYSTAL_CHT_2P8V_REG …
#define CRYSTAL_ON …
#define CRYSTAL_OFF …
struct gmin_subdev { … };
static struct gmin_subdev gmin_subdevs[MAX_SUBDEVS];
#define PMIC_ACPI_AXP …
#define PMIC_ACPI_TI …
#define PMIC_ACPI_CRYSTALCOVE …
#define PMIC_PLATFORM_TI …
static enum { … } pmic_id;
static const char *pmic_name[] = …;
static DEFINE_MUTEX(gmin_regulator_mutex);
static int gmin_v1p8_enable_count;
static int gmin_v2p8_enable_count;
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)
{ … }
EXPORT_SYMBOL_GPL(…);
int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data)
{ … }
EXPORT_SYMBOL_GPL(…);
int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd)
{ … }
EXPORT_SYMBOL_GPL(…);
struct gmin_cfg_var { … };
static struct gmin_cfg_var ffrd8_vars[] = …;
static struct gmin_cfg_var t100_vars[] = …;
static struct gmin_cfg_var mrd7_vars[] = …;
static struct gmin_cfg_var ecs7_vars[] = …;
static struct gmin_cfg_var i8880_vars[] = …;
static struct gmin_cfg_var surface3_vars[] = …;
static struct gmin_cfg_var lenovo_ideapad_miix_310_vars[] = …;
static const struct dmi_system_id gmin_vars[] = …;
#define GMIN_CFG_VAR_EFI_GUID …
static const guid_t atomisp_dsm_guid = …;
#define CFG_VAR_NAME_MAX …
#define GMIN_PMC_CLK_NAME …
static char gmin_pmc_clk_name[GMIN_PMC_CLK_NAME];
static struct i2c_client *gmin_i2c_dev_exists(struct device *dev, char *name,
struct i2c_client **client)
{ … }
static int gmin_i2c_write(struct device *dev, u16 i2c_addr, u8 reg,
u32 value, u32 mask)
{ … }
static int atomisp_get_acpi_power(struct device *dev)
{ … }
static u8 gmin_get_pmic_id_and_addr(struct device *dev)
{ … }
static int gmin_detect_pmic(struct v4l2_subdev *subdev)
{ … }
static int gmin_subdev_add(struct gmin_subdev *gs)
{ … }
static struct gmin_subdev *find_gmin_subdev(struct v4l2_subdev *subdev)
{ … }
static struct gmin_subdev *find_free_gmin_subdev_slot(void)
{ … }
static int axp_regulator_set(struct device *dev, struct gmin_subdev *gs,
int sel_reg, u8 setting,
int ctrl_reg, int shift, bool on)
{ … }
static const struct dmi_system_id axp_leave_eldo2_on_ids[] = …;
static int axp_v1p8_on(struct device *dev, struct gmin_subdev *gs)
{ … }
static int axp_v1p8_off(struct device *dev, struct gmin_subdev *gs)
{ … }
static int gmin_gpio0_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_gpio1_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_v1p2_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int gmin_flisclk_ctrl(struct v4l2_subdev *subdev, int on)
{ … }
static int camera_sensor_csi_alloc(struct v4l2_subdev *sd, u32 port, u32 lanes,
u32 format, u32 bayer_order)
{ … }
static void camera_sensor_csi_free(struct v4l2_subdev *sd)
{ … }
static int gmin_csi_cfg(struct v4l2_subdev *sd, int flag)
{ … }
int atomisp_register_sensor_no_gmin(struct v4l2_subdev *subdev, u32 lanes,
enum atomisp_input_format format,
enum atomisp_bayer_order bayer_order)
{ … }
EXPORT_SYMBOL_GPL(…);
void atomisp_unregister_subdev(struct v4l2_subdev *subdev)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct camera_sensor_platform_data pmic_gmin_plat = …;
static struct camera_sensor_platform_data acpi_gmin_plat = …;
struct camera_sensor_platform_data *
gmin_camera_platform_data(struct v4l2_subdev *subdev,
enum atomisp_input_format csi_format,
enum atomisp_bayer_order csi_bayer)
{ … }
EXPORT_SYMBOL_GPL(…);
static int gmin_get_hardcoded_var(struct device *dev,
struct gmin_cfg_var *varlist,
const char *var8, char *out, size_t *out_len)
{ … }
static int gmin_get_config_dsm_var(struct device *dev,
const char *var,
char *out, size_t *out_len)
{ … }
static int gmin_get_config_var(struct device *maindev,
bool is_gmin,
const char *var,
char *out, size_t *out_len)
{ … }
int gmin_get_var_int(struct device *dev, bool is_gmin, const char *var, int def)
{ … }
EXPORT_SYMBOL_GPL(…);
static void isp_pm_cap_fixup(struct pci_dev *pdev)
{ … }
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0f38, isp_pm_cap_fixup);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;