Loading Documentation/devicetree/bindings/media/video/msm-eeprom.txt +122 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ the sensor itself. As a result, the power, clock and GPIOs may be the same as the camera sensor. The following describes the page block map, power supply, clock, GPIO and power on sequence properties of the EEPROM device. Required properties: Required properties if probe happens from camera daemon: - cell-index: eeprom hardware core index - compatible : - "qcom,eeprom" Loading Loading @@ -39,6 +39,8 @@ Required properties: Optional properties: - cam_vdig-supply : should contain regulator to be used for the digital vdd. Example: eeprom0: qcom,eeprom@60 { Loading Loading @@ -74,3 +76,122 @@ Example: qcom,cam-power-seq-cfg-val = <1 1 24000000 1 1>; qcom,cam-power-seq-delay = <1 1 5 5 10>; }; Required properties if eeprom probe is kernel probe: - cell-index: eeprom hardware core index - compatible : - "qcom,eeprom" - reg : offset of eeprom device registers. - qcom,eeprom-name : should specify relevant names of the eeprom module library. - qcom,slave-addr : should specify the slave address of the eeprom. - qcom,cci-master : should specify the cci core index that eeprom use. - qcom,num-blocks : should specify the total block number that eeprom contains, every block should contains page poll and mem. - qcom,page%d : number %d page size, start address, address type, data, data type, delay in ms. size 0 stand for non-paged. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - qcom,poll%d : number %d poll size, poll reg address, address type, data, data type, delay in ms. size 0 stand for not used. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - qcom,mem%d : number %d memory size, start address, address type, data, data type, delay in ms. size 0 stand for not used. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - cam_vio-supply : should contain regulator to be used for the IO vdd. - qcom,cam-vreg-name : should specify the regulator name to be used for this eeprom. - qcom,cam-vreg-type : should specify the regulator type to be used for this eeprom. - qcom,cam-vreg-min-voltage : should specify minimum voltage level for eeprom in uV. - qcom,cam-vreg-max-voltage : should specify maximum voltage level for eeprom in uV. - qcom,cam-vreg-op-mode : should specify current level for eeprom in uA. - qcom,gpio-no-mux : should specify the gpio mux type. - gpios : should specify the gpios to be used for the eeprom. - qcom,gpio-reset : should specify the reset gpio index. - qcom,gpio-standby : should specify the standby gpio index. - qcom,gpio-req-tbl-num : should specify the gpio table index. - qcom,gpio-req-tbl-flags : should specify the gpio functions. - qcom,gpio-req-tbl-label : should specify the gpio labels. - qcom,cam-power-seq-type : should specify the power on sequence types. - qcom,cam-power-seq-val : should specify the power on sequence values. - qcom,cam-power-seq-cfg-val : should specify the power on sequence config values. - qcom,cam-power-seq-delay : should specify the power on sequence delay time in ms. Optional properties: - qcom,pageen%d : number %d page enable reg size, start address, address type, data, data type, delay in ms. size 0 stand for not used. - cam_vdig-supply : should contain regulator to be used for the digital vdd. - qcom,saddr%d : property should specify the slave address for block (%d). - qcom,i2c-freq-mode : property should specify the I2C speed mode. Optional properties -EEPROM Camera Multimodule - qcom,cmm-data-support - Camera MultiModule data capability flag. - qcom,cmm-data-compressed - Camera MultiModule data compression flag. - qcom,cmm-data-offset - Camera MultiModule data start offset. - qcom,cmm-data-size - Camera MultiModule data size. Example: eeprom0: qcom,eeprom@60 { cell-index = <0>; reg = <0x60 0x0>; qcom,eeprom-name = "msm_eeprom"; compatible = "qcom,eeprom"; qcom,slave-addr = <0x60>; qcom,cci-master = <0>; qcom,num-blocks = <2>; qcom,page0 = <1 0x0100 2 0x01 1 1>; qcom,poll0 = <0 0x0 2 0 1 1>; qcom,mem0 = <0 0x0 2 0 1 0>; qcom,page1 = <1 0x0200 2 0x8 1 1>; qcom,pageen1 = <1 0x0202 2 0x01 1 10>; qcom,poll1 = <0 0x0 2 0 1 1>; qcom,mem1 = <32 0x3000 2 0 1 0>; qcom,saddr1 = <0x62>; qcom,cmm-data-support; qcom,cmm-data-compressed; qcom,cmm-data-offset = <0>; qcom,cmm-data-size = <0>; cam_vdig-supply = <&pm8226_l5>; cam_vio-supply = <&pm8226_lvs1>; qcom,cam-vreg-name = "cam_vdig", "cam_vio"; qcom,cam-vreg-type = <0 1>; qcom,cam-vreg-min-voltage = <1200000 0>; qcom,cam-vreg-max-voltage = <1200000 0>; qcom,cam-vreg-op-mode = <200000 0>; qcom,gpio-no-mux = <0>; gpios = <&msmgpio 26 0>, <&msmgpio 37 0>, <&msmgpio 36 0>; qcom,gpio-reset = <1>; qcom,gpio-standby = <2>; qcom,gpio-req-tbl-num = <0 1 2>; qcom,gpio-req-tbl-flags = <1 0 0>; qcom,gpio-req-tbl-label = "CAMIF_MCLK", "CAM_RESET1", "CAM_STANDBY"; qcom,cam-power-seq-type = "sensor_vreg", "sensor_vreg", "sensor_clk", "sensor_gpio", "sensor_gpio"; qcom,cam-power-seq-val = "cam_vdig", "cam_vio", "sensor_cam_mclk", "sensor_gpio_reset", "sensor_gpio_standby"; qcom,cam-power-seq-cfg-val = <1 1 24000000 1 1>; qcom,cam-power-seq-delay = <1 1 5 5 10>; }; drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c +564 −63 File changed.Preview size limit exceeded, changes collapsed. Show changes drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.h +3 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,9 @@ struct msm_eeprom_ctrl_t { struct msm_camera_i2c_client i2c_client; struct msm_eeprom_board_info *eboard_info; uint32_t subdev_id; uint8_t *read_mem; int32_t read_data_size; int32_t userspace_probe; struct msm_eeprom_memory_block_t cal_data; uint8_t is_supported; }; #endif drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c +48 −17 Original line number Diff line number Diff line Loading @@ -158,11 +158,14 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( struct msm_sensor_ctrl_t *s_ctrl) { int32_t rc = 0; const char *eeprom_name; struct device_node *src_node = NULL; uint32_t val = 0, eeprom_name_len; int32_t *eeprom_subdev_id; int32_t *eeprom_subdev_id, i, userspace_probe = 0; int32_t count = 0; struct msm_sensor_info_t *sensor_info; struct device_node *of_node = s_ctrl->of_node; const void *p; if (!s_ctrl->sensordata->eeprom_name || !of_node) return -EINVAL; Loading @@ -182,18 +185,44 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( if (0 == eeprom_name_len) return 0; src_node = of_parse_phandle(of_node, "qcom,eeprom-src", 0); p = of_get_property(of_node, "qcom,eeprom-src", &count); if (!p || !count) return 0; count /= sizeof(uint32_t); for (i = 0; i < count; i++) { userspace_probe = 0; eeprom_name = NULL; src_node = of_parse_phandle(of_node, "qcom,eeprom-src", i); if (!src_node) { pr_err("eeprom src node NULL\n"); continue; } /* In the case of eeprom probe from kernel eeprom name should be present, Otherwise it will throw as errors */ rc = of_property_read_string(src_node, "qcom,eeprom-name", &eeprom_name); if (rc < 0) { pr_err("%s:%d Eeprom userspace probe for %s\n", __func__, __LINE__, s_ctrl->sensordata->eeprom_name); of_node_put(src_node); userspace_probe = 1; if (count > 1) return -EINVAL; } if (!userspace_probe && strcmp(eeprom_name, s_ctrl->sensordata->eeprom_name)) continue; rc = of_property_read_u32(src_node, "cell-index", &val); if (rc < 0) { pr_err("%s qcom,eeprom cell index %d, rc %d\n", __func__, val, rc); of_node_put(src_node); if (userspace_probe) return -EINVAL; continue; } *eeprom_subdev_id = val; Loading @@ -201,6 +230,8 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( __func__, __LINE__, val); of_node_put(src_node); src_node = NULL; break; } return rc; } Loading Loading
Documentation/devicetree/bindings/media/video/msm-eeprom.txt +122 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ the sensor itself. As a result, the power, clock and GPIOs may be the same as the camera sensor. The following describes the page block map, power supply, clock, GPIO and power on sequence properties of the EEPROM device. Required properties: Required properties if probe happens from camera daemon: - cell-index: eeprom hardware core index - compatible : - "qcom,eeprom" Loading Loading @@ -39,6 +39,8 @@ Required properties: Optional properties: - cam_vdig-supply : should contain regulator to be used for the digital vdd. Example: eeprom0: qcom,eeprom@60 { Loading Loading @@ -74,3 +76,122 @@ Example: qcom,cam-power-seq-cfg-val = <1 1 24000000 1 1>; qcom,cam-power-seq-delay = <1 1 5 5 10>; }; Required properties if eeprom probe is kernel probe: - cell-index: eeprom hardware core index - compatible : - "qcom,eeprom" - reg : offset of eeprom device registers. - qcom,eeprom-name : should specify relevant names of the eeprom module library. - qcom,slave-addr : should specify the slave address of the eeprom. - qcom,cci-master : should specify the cci core index that eeprom use. - qcom,num-blocks : should specify the total block number that eeprom contains, every block should contains page poll and mem. - qcom,page%d : number %d page size, start address, address type, data, data type, delay in ms. size 0 stand for non-paged. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - qcom,poll%d : number %d poll size, poll reg address, address type, data, data type, delay in ms. size 0 stand for not used. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - qcom,mem%d : number %d memory size, start address, address type, data, data type, delay in ms. size 0 stand for not used. - address type : 1 byte, 2 word. - data type : 1 byte, 2 word. - cam_vio-supply : should contain regulator to be used for the IO vdd. - qcom,cam-vreg-name : should specify the regulator name to be used for this eeprom. - qcom,cam-vreg-type : should specify the regulator type to be used for this eeprom. - qcom,cam-vreg-min-voltage : should specify minimum voltage level for eeprom in uV. - qcom,cam-vreg-max-voltage : should specify maximum voltage level for eeprom in uV. - qcom,cam-vreg-op-mode : should specify current level for eeprom in uA. - qcom,gpio-no-mux : should specify the gpio mux type. - gpios : should specify the gpios to be used for the eeprom. - qcom,gpio-reset : should specify the reset gpio index. - qcom,gpio-standby : should specify the standby gpio index. - qcom,gpio-req-tbl-num : should specify the gpio table index. - qcom,gpio-req-tbl-flags : should specify the gpio functions. - qcom,gpio-req-tbl-label : should specify the gpio labels. - qcom,cam-power-seq-type : should specify the power on sequence types. - qcom,cam-power-seq-val : should specify the power on sequence values. - qcom,cam-power-seq-cfg-val : should specify the power on sequence config values. - qcom,cam-power-seq-delay : should specify the power on sequence delay time in ms. Optional properties: - qcom,pageen%d : number %d page enable reg size, start address, address type, data, data type, delay in ms. size 0 stand for not used. - cam_vdig-supply : should contain regulator to be used for the digital vdd. - qcom,saddr%d : property should specify the slave address for block (%d). - qcom,i2c-freq-mode : property should specify the I2C speed mode. Optional properties -EEPROM Camera Multimodule - qcom,cmm-data-support - Camera MultiModule data capability flag. - qcom,cmm-data-compressed - Camera MultiModule data compression flag. - qcom,cmm-data-offset - Camera MultiModule data start offset. - qcom,cmm-data-size - Camera MultiModule data size. Example: eeprom0: qcom,eeprom@60 { cell-index = <0>; reg = <0x60 0x0>; qcom,eeprom-name = "msm_eeprom"; compatible = "qcom,eeprom"; qcom,slave-addr = <0x60>; qcom,cci-master = <0>; qcom,num-blocks = <2>; qcom,page0 = <1 0x0100 2 0x01 1 1>; qcom,poll0 = <0 0x0 2 0 1 1>; qcom,mem0 = <0 0x0 2 0 1 0>; qcom,page1 = <1 0x0200 2 0x8 1 1>; qcom,pageen1 = <1 0x0202 2 0x01 1 10>; qcom,poll1 = <0 0x0 2 0 1 1>; qcom,mem1 = <32 0x3000 2 0 1 0>; qcom,saddr1 = <0x62>; qcom,cmm-data-support; qcom,cmm-data-compressed; qcom,cmm-data-offset = <0>; qcom,cmm-data-size = <0>; cam_vdig-supply = <&pm8226_l5>; cam_vio-supply = <&pm8226_lvs1>; qcom,cam-vreg-name = "cam_vdig", "cam_vio"; qcom,cam-vreg-type = <0 1>; qcom,cam-vreg-min-voltage = <1200000 0>; qcom,cam-vreg-max-voltage = <1200000 0>; qcom,cam-vreg-op-mode = <200000 0>; qcom,gpio-no-mux = <0>; gpios = <&msmgpio 26 0>, <&msmgpio 37 0>, <&msmgpio 36 0>; qcom,gpio-reset = <1>; qcom,gpio-standby = <2>; qcom,gpio-req-tbl-num = <0 1 2>; qcom,gpio-req-tbl-flags = <1 0 0>; qcom,gpio-req-tbl-label = "CAMIF_MCLK", "CAM_RESET1", "CAM_STANDBY"; qcom,cam-power-seq-type = "sensor_vreg", "sensor_vreg", "sensor_clk", "sensor_gpio", "sensor_gpio"; qcom,cam-power-seq-val = "cam_vdig", "cam_vio", "sensor_cam_mclk", "sensor_gpio_reset", "sensor_gpio_standby"; qcom,cam-power-seq-cfg-val = <1 1 24000000 1 1>; qcom,cam-power-seq-delay = <1 1 5 5 10>; };
drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c +564 −63 File changed.Preview size limit exceeded, changes collapsed. Show changes
drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.h +3 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,9 @@ struct msm_eeprom_ctrl_t { struct msm_camera_i2c_client i2c_client; struct msm_eeprom_board_info *eboard_info; uint32_t subdev_id; uint8_t *read_mem; int32_t read_data_size; int32_t userspace_probe; struct msm_eeprom_memory_block_t cal_data; uint8_t is_supported; }; #endif
drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c +48 −17 Original line number Diff line number Diff line Loading @@ -158,11 +158,14 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( struct msm_sensor_ctrl_t *s_ctrl) { int32_t rc = 0; const char *eeprom_name; struct device_node *src_node = NULL; uint32_t val = 0, eeprom_name_len; int32_t *eeprom_subdev_id; int32_t *eeprom_subdev_id, i, userspace_probe = 0; int32_t count = 0; struct msm_sensor_info_t *sensor_info; struct device_node *of_node = s_ctrl->of_node; const void *p; if (!s_ctrl->sensordata->eeprom_name || !of_node) return -EINVAL; Loading @@ -182,18 +185,44 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( if (0 == eeprom_name_len) return 0; src_node = of_parse_phandle(of_node, "qcom,eeprom-src", 0); p = of_get_property(of_node, "qcom,eeprom-src", &count); if (!p || !count) return 0; count /= sizeof(uint32_t); for (i = 0; i < count; i++) { userspace_probe = 0; eeprom_name = NULL; src_node = of_parse_phandle(of_node, "qcom,eeprom-src", i); if (!src_node) { pr_err("eeprom src node NULL\n"); continue; } /* In the case of eeprom probe from kernel eeprom name should be present, Otherwise it will throw as errors */ rc = of_property_read_string(src_node, "qcom,eeprom-name", &eeprom_name); if (rc < 0) { pr_err("%s:%d Eeprom userspace probe for %s\n", __func__, __LINE__, s_ctrl->sensordata->eeprom_name); of_node_put(src_node); userspace_probe = 1; if (count > 1) return -EINVAL; } if (!userspace_probe && strcmp(eeprom_name, s_ctrl->sensordata->eeprom_name)) continue; rc = of_property_read_u32(src_node, "cell-index", &val); if (rc < 0) { pr_err("%s qcom,eeprom cell index %d, rc %d\n", __func__, val, rc); of_node_put(src_node); if (userspace_probe) return -EINVAL; continue; } *eeprom_subdev_id = val; Loading @@ -201,6 +230,8 @@ static int32_t msm_sensor_fill_eeprom_subdevid_by_name( __func__, __LINE__, val); of_node_put(src_node); src_node = NULL; break; } return rc; } Loading