17 #define SENSOR_NAME_UUID "822ace8f-2814-4174-a56b-5f029fe079ee"
18 #define SENSOR_TYPE_UUID "26257549-9271-4ca4-bb43-c4899d5a4881"
19 #define DEFAULT_ENDPOINT 0
20 #define DEFAULT_REMOTE_NAME "\\_SB.PCI0.CIO2"
21 #define CIO2_PCI_DEV 0x14
22 #define CIO2_PCI_FN 0x3
23 #define POWER_RESOURCE_NAME "PRIC"
24 #define GUARD_VARIABLE_FORMAT "RES%1d"
25 #define ENABLE_METHOD_FORMAT "ENB%1d"
26 #define DISABLE_METHOD_FORMAT "DSB%1d"
27 #define UNKNOWN_METHOD_FORMAT "UNK%1d"
28 #define CLK_ENABLE_METHOD "MCON"
29 #define CLK_DISABLE_METHOD "MCOF"
37 res_config->
action = action;
114 if (
config->cio2_lanes_used[i] > 0) {
117 for (j = 1; j <=
config->cio2_lanes_used[i] &&
123 if (
config->cio2_lane_endpoint[i]) {
139 if (
CONFIG(ACPI_ADL_IPU_ES_SUPPORT)) {
153 for (i = 0; i <
config->cio2_num_ports; ++i) {
154 free(ep_table_name[i]);
155 free(port_table_name[i]);
162 if (!
config->pld.ignore_color)
163 config->pld.ignore_color = 1;
168 if (!
config->pld.vertical_offset)
169 config->pld.vertical_offset = 0xffff;
171 if (!
config->pld.horizontal_offset)
172 config->pld.horizontal_offset = 0xffff;
186 if (!
config->pld.horizontal_position)
201 if (!
config->disable_pld_defaults)
219 i2c_addr =
config->vcm_address;
222 i2c_addr =
config->rom_address;
234 int local1_ret = 1 + (
config->ssdb.vcm_type ? 1 : 0) + (
config->ssdb.rom_type ? 1 : 0);
268 if (
config->ssdb.vcm_type) {
275 if (
config->ssdb.rom_type) {
295 if (
config->disable_ssdb_defaults)
298 if (!
config->ssdb.bdf_value)
301 if (!
config->ssdb.platform)
304 if (!
config->ssdb.flash_support)
307 if (!
config->ssdb.privacy_led)
310 if (!
config->ssdb.mipi_define)
313 if (!
config->ssdb.mclk_speed)
316 if (!
config->ssdb.lanes_used) {
361 const char *vcm_name =
NULL;
363 const char *remote_name;
377 if (
config->ssdb.lanes_used > 0) {
380 for (i = 1; i <=
config->ssdb.lanes_used; ++i)
385 if (
config->num_freq_entries) {
395 if (
config->remote_name) {
396 remote_name =
config->remote_name;
420 if (
config->ssdb.vcm_type) {
422 vcm_name =
config->vcm_name;
426 .i2c.device =
config->vcm_address,
447 if (
config->low_power_probe)
458 if (
config->num_pwdb_entries > 0) {
462 config->num_pwdb_entries);
478 if (!
config->disable_nvm_defaults && !
config->nvm_pagesize)
481 if (!
config->disable_nvm_defaults && !
config->nvm_readonly)
498 if (
config->low_power_probe)
515 if (
config->low_power_probe)
540 "OS camera driver will likely not work",
type);
575 if (res_config ==
NULL)
610 "OS camera driver will likely not work", action);
629 "OS camera driver will likely not work\n", action);
640 if (res_config ==
NULL)
654 "OS camera driver will likely not work\n",
type);
725 res_id =
config->clk_panel.clks[index].clknum;
729 res_id =
config->gpio_panel.gpio[index].gpio_num;
734 "OS camera driver will likely not work\n",
741 if (res_index == -1) {
744 "OS camera driver will likely not work\n");
779 "OS camera driver will likely not work\n",
816 if (
config->has_power_resource) {
914 switch (
config->device_type) {
935 const char *scope =
NULL;
936 const struct device *pdev;
938 if (
config->has_power_resource) {
973 "OS camera driver will likely not work\n", dev->
path.
type);
993 const char *prefix =
NULL;
1000 switch (
config->device_type) {
struct acpi_dp * acpi_dp_add_child(struct acpi_dp *dp, const char *name, struct acpi_dp *child)
struct acpi_dp * acpi_dp_add_array(struct acpi_dp *dp, struct acpi_dp *array)
const char * acpi_device_path(const struct device *dev)
struct acpi_dp * acpi_dp_add_string(struct acpi_dp *dp, const char *name, const char *string)
struct acpi_dp * acpi_dp_add_integer(struct acpi_dp *dp, const char *name, uint64_t value)
struct acpi_dp * acpi_dp_add_reference(struct acpi_dp *dp, const char *name, const char *reference)
void acpi_device_write_i2c(const struct acpi_i2c *i2c)
void acpi_dp_write(struct acpi_dp *table)
int acpi_device_status(const struct device *dev)
const char * acpi_device_name(const struct device *dev)
struct acpi_dp * acpi_dp_new_table(const char *name)
const char * acpi_device_scope(const struct device *dev)
#define ACPI_DT_NAMESPACE_HID
@ PLD_HORIZONTAL_POSITION_CENTER
void acpigen_write_if(void)
void acpigen_emit_namestring(const char *namepath)
void acpigen_write_return_integer(uint64_t arg)
void acpigen_write_integer(uint64_t data)
void acpigen_write_uuid(const char *uuid)
void acpigen_pop_len(void)
void acpigen_write_scope(const char *name)
void acpigen_write_if_lequal_op_int(uint8_t op, uint64_t val)
void acpigen_write_sleep(uint64_t sleep_ms)
void acpigen_write_resourcetemplate_footer(void)
void acpigen_write_method_serialized(const char *name, int nargs)
void acpigen_write_power_res(const char *name, uint8_t level, uint16_t order, const char *const dev_states[], size_t dev_states_count)
char * acpigen_write_package(int nr_el)
void acpigen_write_name_integer(const char *name, uint64_t val)
void acpigen_write_STA(uint8_t status)
void acpigen_emit_byte(unsigned char b)
void acpigen_write_resourcetemplate_header(void)
void acpigen_emit_string(const char *string)
void acpigen_write_to_integer(uint8_t src, uint8_t dst)
void acpigen_emit_ext_op(uint8_t op)
void acpigen_write_return_byte_buffer(uint8_t *arr, size_t size)
void acpigen_write_STA_ext(const char *namestring)
void acpigen_write_store_op_to_namestr(uint8_t src, const char *dst)
void acpigen_write_device(const char *name)
void acpigen_write_to_buffer(uint8_t src, uint8_t dst)
void acpigen_write_method(const char *name, int nargs)
void acpigen_write_return_singleton_buffer(uint8_t arg)
void acpigen_write_debug_string(const char *str)
void acpigen_write_name(const char *name)
void acpigen_write_return_string(const char *arg)
void acpigen_write_name_string(const char *name, const char *string)
void acpigen_write_pld(const struct acpi_pld *pld)
void acpigen_write_if_lequal_namestr_int(const char *namestr, uint64_t val)
void acpigen_write_ADR_pci_device(const struct device *dev)
static void call_guarded_method(struct resource_config *res_config)
static void camera_generate_pld(const struct device *dev)
#define DEFAULT_REMOTE_NAME
static enum action_type resource_get_action_type(const struct resource_config *res_config)
static void resource_set_action_type(struct resource_config *res_config, enum action_type action)
static void camera_fill_vcm(const struct device *dev)
static void add_gpio_op(const struct gpio_config *gpio_config, enum action_type action)
static void add_guarded_method_namestring(struct resource_config *res_config, int res_index)
static void write_i2c_camera_device(const struct device *dev, const char *scope)
static void add_power_operation(const struct resource_config *res_config)
#define UNKNOWN_METHOD_FORMAT
static const struct gpio_config * resource_gpio_config(const struct resource_config *res_config)
static void camera_fill_cio2(const struct device *dev)
static void camera_fill_nvm(const struct device *dev)
static void camera_enable(struct device *dev)
#define ENABLE_METHOD_FORMAT
struct chip_operations drivers_intel_mipi_camera_ops
static void write_enable_method(struct resource_config *res_config, uint8_t res_index)
static void add_guarded_operations(const struct drivers_intel_mipi_camera_config *config, const struct operation_seq *seq)
static void fill_power_res_sequence(struct drivers_intel_mipi_camera_config *config, struct operation_seq *seq)
static enum ctrl_type resource_get_ctrl_type(const struct resource_config *res_config)
#define CLK_ENABLE_METHOD
#define POWER_RESOURCE_NAME
static void write_guard_variable(uint8_t res_index)
static void camera_fill_sensor(const struct device *dev)
static const struct clk_config * resource_clk_config(const struct resource_config *res_config)
static void add_clk_op(const struct clk_config *clk_config, enum action_type action)
static void write_pci_camera_device(const struct device *dev)
static void resource_set_clk_config(struct resource_config *res_config, const struct clk_config *clk_conf)
#define DISABLE_METHOD_FORMAT
#define CLK_DISABLE_METHOD
static void apply_pld_defaults(struct drivers_intel_mipi_camera_config *config)
static void write_camera_device_common(const struct device *dev)
static void camera_fill_ssdt(const struct device *dev)
static void camera_generate_dsm(const struct device *dev)
static const char * camera_acpi_name(const struct device *dev)
static void camera_fill_ssdb_defaults(struct drivers_intel_mipi_camera_config *config)
static uint32_t address_for_dev_type(const struct device *dev, uint8_t dev_type)
static void resource_set_gpio_config(struct resource_config *res_config, const struct gpio_config *gpio_conf)
static struct camera_resource_manager res_mgr
static int get_resource_index(const struct resource_config *res_config)
#define GUARD_VARIABLE_FORMAT
static void write_disable_method(struct resource_config *res_config, uint8_t res_index)
static struct device_operations camera_ops
#define printk(level,...)
uint32_t cpu_get_cpuid(void)
#define CPUID_ALDERLAKE_J0
#define CPUID_ALDERLAKE_N_A0
#define CPUID_ALDERLAKE_Q0
DEVTREE_CONST struct device * find_dev_path(const struct bus *parent, const struct device_path *path)
See if a device structure exists for path.
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
#define MAX_GUARDED_RESOURCES
#define MAX_LINK_FREQ_ENTRIES
@ INTEL_ACPI_CAMERA_SENSOR
#define ACPI_NAME_BUFFER_SIZE
int acpigen_soc_clear_tx_gpio(unsigned int gpio_num)
int acpigen_soc_set_tx_gpio(unsigned int gpio_num)
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
static void noop_set_resources(struct device *dev)
#define BIOS_INFO
BIOS_INFO - Expected events.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
static struct soc_gpio_config gpio_config
#define PCI_DEVFN(slot, func)
char * strdup(const char *s)
DEVTREE_CONST struct device * dev
struct camera_resource resource[MAX_GUARDED_RESOURCES]
void(* read_resources)(struct device *dev)
enum device_path_type type
struct chip_operations * chip_ops
struct device_operations * ops
DEVTREE_CONST struct bus * bus
DEVTREE_CONST void * chip_info
uint32_t cio2_lanes_used[MAX_PORT_ENTRIES]
enum intel_camera_device_type device_type
struct operation_type ops[MAX_PWR_OPS]
const struct clk_config * clk_conf
const struct gpio_config * gpio_conf
int snprintf(char *buf, size_t size, const char *fmt,...)
Note: This file is only for POSIX compatibility, and is meant to be chain-included via string....