Commit eaa399eb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: do lots of other coding style cleanups

Use some auto-reformat tools to make the atomisp style
a little better. There are still lots of weird things there,
but this will hopefully reduce the number of pure coding
style patches submitted upstream.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent bdfe0beb
...@@ -47,7 +47,7 @@ struct tbd_data_record_header { ...@@ -47,7 +47,7 @@ struct tbd_data_record_header {
#define TBD_CLASS_DRV_ID 2 #define TBD_CLASS_DRV_ID 2
static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr, static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr,
unsigned int size) unsigned int size)
{ {
/* The configuration data contains any number of sequences where /* The configuration data contains any number of sequences where
* the first byte (that is, uint8_t) that marks the number of bytes * the first byte (that is, uint8_t) that marks the number of bytes
...@@ -87,11 +87,11 @@ static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr, ...@@ -87,11 +87,11 @@ static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr,
} }
static int parse_and_apply(struct i2c_client *client, uint8_t *buffer, static int parse_and_apply(struct i2c_client *client, uint8_t *buffer,
unsigned int size) unsigned int size)
{ {
u8 *endptr8 = buffer + size; u8 *endptr8 = buffer + size;
struct tbd_data_record_header *header = struct tbd_data_record_header *header =
(struct tbd_data_record_header *)buffer; (struct tbd_data_record_header *)buffer;
/* There may be any number of datasets present */ /* There may be any number of datasets present */
unsigned int dataset = 0; unsigned int dataset = 0;
...@@ -103,7 +103,7 @@ static int parse_and_apply(struct i2c_client *client, uint8_t *buffer, ...@@ -103,7 +103,7 @@ static int parse_and_apply(struct i2c_client *client, uint8_t *buffer,
/* All data should be located within given buffer */ /* All data should be located within given buffer */
if ((uint8_t *)header + header->data_offset + if ((uint8_t *)header + header->data_offset +
header->data_size > endptr8) header->data_size > endptr8)
return -EINVAL; return -EINVAL;
/* We have a new valid dataset */ /* We have a new valid dataset */
...@@ -114,16 +114,16 @@ static int parse_and_apply(struct i2c_client *client, uint8_t *buffer, ...@@ -114,16 +114,16 @@ static int parse_and_apply(struct i2c_client *client, uint8_t *buffer,
int ret; int ret;
dev_info(&client->dev, dev_info(&client->dev,
"New MSR data for sensor driver (dataset %02d) size:%d\n", "New MSR data for sensor driver (dataset %02d) size:%d\n",
dataset, header->data_size); dataset, header->data_size);
ret = set_msr_configuration(client, ret = set_msr_configuration(client,
buffer + header->data_offset, buffer + header->data_offset,
header->data_size); header->data_size);
if (ret) if (ret)
return ret; return ret;
} }
header = (struct tbd_data_record_header *)(buffer + header = (struct tbd_data_record_header *)(buffer +
header->next_offset); header->next_offset);
} while (header->next_offset); } while (header->next_offset);
return 0; return 0;
...@@ -168,7 +168,7 @@ int apply_msr_data(struct i2c_client *client, const struct firmware *fw) ...@@ -168,7 +168,7 @@ int apply_msr_data(struct i2c_client *client, const struct firmware *fw)
EXPORT_SYMBOL_GPL(apply_msr_data); EXPORT_SYMBOL_GPL(apply_msr_data);
int load_msr_list(struct i2c_client *client, char *name, int load_msr_list(struct i2c_client *client, char *name,
const struct firmware **fw) const struct firmware **fw)
{ {
int ret = request_firmware(fw, name, &client->dev); int ret = request_firmware(fw, name, &client->dev);
...@@ -179,7 +179,7 @@ int load_msr_list(struct i2c_client *client, char *name, ...@@ -179,7 +179,7 @@ int load_msr_list(struct i2c_client *client, char *name,
return ret; return ret;
} }
dev_info(&client->dev, "Received %lu bytes drv data\n", dev_info(&client->dev, "Received %lu bytes drv data\n",
(unsigned long)(*fw)->size); (unsigned long)(*fw)->size);
return 0; return 0;
} }
......
...@@ -296,7 +296,7 @@ static int lm3554_g_flash_intensity(struct v4l2_subdev *sd, s32 *val) ...@@ -296,7 +296,7 @@ static int lm3554_g_flash_intensity(struct v4l2_subdev *sd, s32 *val)
struct lm3554 *flash = to_lm3554(sd); struct lm3554 *flash = to_lm3554(sd);
*val = LM3554_VALUE_TO_PERCENT((u32)flash->flash_current, *val = LM3554_VALUE_TO_PERCENT((u32)flash->flash_current,
LM3554_FLASH_STEP); LM3554_FLASH_STEP);
return 0; return 0;
} }
...@@ -318,7 +318,7 @@ static int lm3554_g_torch_intensity(struct v4l2_subdev *sd, s32 *val) ...@@ -318,7 +318,7 @@ static int lm3554_g_torch_intensity(struct v4l2_subdev *sd, s32 *val)
struct lm3554 *flash = to_lm3554(sd); struct lm3554 *flash = to_lm3554(sd);
*val = LM3554_VALUE_TO_PERCENT((u32)flash->torch_current, *val = LM3554_VALUE_TO_PERCENT((u32)flash->torch_current,
LM3554_TORCH_STEP); LM3554_TORCH_STEP);
return 0; return 0;
} }
...@@ -340,7 +340,7 @@ static int lm3554_g_indicator_intensity(struct v4l2_subdev *sd, s32 *val) ...@@ -340,7 +340,7 @@ static int lm3554_g_indicator_intensity(struct v4l2_subdev *sd, s32 *val)
struct lm3554 *flash = to_lm3554(sd); struct lm3554 *flash = to_lm3554(sd);
*val = LM3554_VALUE_TO_PERCENT((u32)flash->indicator_current, *val = LM3554_VALUE_TO_PERCENT((u32)flash->indicator_current,
LM3554_INDICATOR_STEP); LM3554_INDICATOR_STEP);
return 0; return 0;
} }
...@@ -494,94 +494,94 @@ static const struct v4l2_ctrl_ops ctrl_ops = { ...@@ -494,94 +494,94 @@ static const struct v4l2_ctrl_ops ctrl_ops = {
static const struct v4l2_ctrl_config lm3554_controls[] = { static const struct v4l2_ctrl_config lm3554_controls[] = {
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_TIMEOUT, .id = V4L2_CID_FLASH_TIMEOUT,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Flash Timeout", .name = "Flash Timeout",
.min = 0x0, .min = 0x0,
.max = LM3554_MAX_TIMEOUT, .max = LM3554_MAX_TIMEOUT,
.step = 0x01, .step = 0x01,
.def = LM3554_DEFAULT_TIMEOUT, .def = LM3554_DEFAULT_TIMEOUT,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_INTENSITY, .id = V4L2_CID_FLASH_INTENSITY,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Flash Intensity", .name = "Flash Intensity",
.min = LM3554_MIN_PERCENT, .min = LM3554_MIN_PERCENT,
.max = LM3554_MAX_PERCENT, .max = LM3554_MAX_PERCENT,
.step = 0x01, .step = 0x01,
.def = LM3554_FLASH_DEFAULT_BRIGHTNESS, .def = LM3554_FLASH_DEFAULT_BRIGHTNESS,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_TORCH_INTENSITY, .id = V4L2_CID_FLASH_TORCH_INTENSITY,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Torch Intensity", .name = "Torch Intensity",
.min = LM3554_MIN_PERCENT, .min = LM3554_MIN_PERCENT,
.max = LM3554_MAX_PERCENT, .max = LM3554_MAX_PERCENT,
.step = 0x01, .step = 0x01,
.def = LM3554_TORCH_DEFAULT_BRIGHTNESS, .def = LM3554_TORCH_DEFAULT_BRIGHTNESS,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_INDICATOR_INTENSITY, .id = V4L2_CID_FLASH_INDICATOR_INTENSITY,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Indicator Intensity", .name = "Indicator Intensity",
.min = LM3554_MIN_PERCENT, .min = LM3554_MIN_PERCENT,
.max = LM3554_MAX_PERCENT, .max = LM3554_MAX_PERCENT,
.step = 0x01, .step = 0x01,
.def = LM3554_INDICATOR_DEFAULT_BRIGHTNESS, .def = LM3554_INDICATOR_DEFAULT_BRIGHTNESS,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_STROBE, .id = V4L2_CID_FLASH_STROBE,
.type = V4L2_CTRL_TYPE_BOOLEAN, .type = V4L2_CTRL_TYPE_BOOLEAN,
.name = "Flash Strobe", .name = "Flash Strobe",
.min = 0, .min = 0,
.max = 1, .max = 1,
.step = 1, .step = 1,
.def = 0, .def = 0,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_MODE, .id = V4L2_CID_FLASH_MODE,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Flash Mode", .name = "Flash Mode",
.min = 0, .min = 0,
.max = 100, .max = 100,
.step = 1, .step = 1,
.def = ATOMISP_FLASH_MODE_OFF, .def = ATOMISP_FLASH_MODE_OFF,
.flags = 0, .flags = 0,
}, },
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_STATUS, .id = V4L2_CID_FLASH_STATUS,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Flash Status", .name = "Flash Status",
.min = ATOMISP_FLASH_STATUS_OK, .min = ATOMISP_FLASH_STATUS_OK,
.max = ATOMISP_FLASH_STATUS_TIMEOUT, .max = ATOMISP_FLASH_STATUS_TIMEOUT,
.step = 1, .step = 1,
.def = ATOMISP_FLASH_STATUS_OK, .def = ATOMISP_FLASH_STATUS_OK,
.flags = 0, .flags = 0,
}, },
#ifndef CSS15 #ifndef CSS15
{ {
.ops = &ctrl_ops, .ops = &ctrl_ops,
.id = V4L2_CID_FLASH_STATUS_REGISTER, .id = V4L2_CID_FLASH_STATUS_REGISTER,
.type = V4L2_CTRL_TYPE_INTEGER, .type = V4L2_CTRL_TYPE_INTEGER,
.name = "Flash Status Register", .name = "Flash Status Register",
.min = 0, .min = 0,
.max = 255, .max = 255,
.step = 1, .step = 1,
.def = 0, .def = 0,
.flags = 0, .flags = 0,
}, },
#endif #endif
}; };
...@@ -825,17 +825,17 @@ static void *lm3554_platform_data_func(struct i2c_client *client) ...@@ -825,17 +825,17 @@ static void *lm3554_platform_data_func(struct i2c_client *client)
static struct lm3554_platform_data platform_data; static struct lm3554_platform_data platform_data;
platform_data.gpio_reset = platform_data.gpio_reset =
desc_to_gpio(gpiod_get_index(&client->dev, desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 2, GPIOD_OUT_LOW)); NULL, 2, GPIOD_OUT_LOW));
platform_data.gpio_strobe = platform_data.gpio_strobe =
desc_to_gpio(gpiod_get_index(&client->dev, desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 0, GPIOD_OUT_LOW)); NULL, 0, GPIOD_OUT_LOW));
platform_data.gpio_torch = platform_data.gpio_torch =
desc_to_gpio(gpiod_get_index(&client->dev, desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 1, GPIOD_OUT_LOW)); NULL, 1, GPIOD_OUT_LOW));
dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n", dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n",
platform_data.gpio_reset, platform_data.gpio_strobe, platform_data.gpio_reset, platform_data.gpio_strobe,
platform_data.gpio_torch); platform_data.gpio_torch);
/* Set to TX2 mode, then ENVM/TX2 pin is a power amplifier sync input: /* Set to TX2 mode, then ENVM/TX2 pin is a power amplifier sync input:
* ENVM/TX pin asserted, flash forced into torch; * ENVM/TX pin asserted, flash forced into torch;
......
...@@ -341,52 +341,52 @@ struct mt9m114_write_ctrl { ...@@ -341,52 +341,52 @@ struct mt9m114_write_ctrl {
*/ */
static struct mt9m114_res_struct mt9m114_res[] = { static struct mt9m114_res_struct mt9m114_res[] = {
{ {
.desc = "720P", .desc = "720P",
.res = MT9M114_RES_736P, .res = MT9M114_RES_736P,
.width = 1296, .width = 1296,
.height = 736, .height = 736,
.fps = 30, .fps = 30,
.used = false, .used = false,
.regs = NULL, .regs = NULL,
.skip_frames = 1, .skip_frames = 1,
.pixels_per_line = 0x0640, .pixels_per_line = 0x0640,
.lines_per_frame = 0x0307, .lines_per_frame = 0x0307,
.bin_factor_x = 1, .bin_factor_x = 1,
.bin_factor_y = 1, .bin_factor_y = 1,
.bin_mode = 0, .bin_mode = 0,
}, },
{ {
.desc = "848P", .desc = "848P",
.res = MT9M114_RES_864P, .res = MT9M114_RES_864P,
.width = 1296, .width = 1296,
.height = 864, .height = 864,
.fps = 30, .fps = 30,
.used = false, .used = false,
.regs = NULL, .regs = NULL,
.skip_frames = 1, .skip_frames = 1,
.pixels_per_line = 0x0640, .pixels_per_line = 0x0640,
.lines_per_frame = 0x03E8, .lines_per_frame = 0x03E8,
.bin_factor_x = 1, .bin_factor_x = 1,
.bin_factor_y = 1, .bin_factor_y = 1,
.bin_mode = 0, .bin_mode = 0,
}, },
{ {
.desc = "960P", .desc = "960P",
.res = MT9M114_RES_960P, .res = MT9M114_RES_960P,
.width = 1296, .width = 1296,
.height = 976, .height = 976,
.fps = 30, .fps = 30,
.used = false, .used = false,
.regs = NULL, .regs = NULL,
.skip_frames = 1, .skip_frames = 1,
.pixels_per_line = 0x0644, /* consistent with regs arrays */ .pixels_per_line = 0x0644, /* consistent with regs arrays */
.lines_per_frame = 0x03E5, /* consistent with regs arrays */ .lines_per_frame = 0x03E5, /* consistent with regs arrays */
.bin_factor_x = 1, .bin_factor_x = 1,
.bin_factor_y = 1, .bin_factor_y = 1,
.bin_mode = 0, .bin_mode = 0,
}, },
}; };
...@@ -500,33 +500,33 @@ static struct misensor_reg const mt9m114_exp_center[] = { ...@@ -500,33 +500,33 @@ static struct misensor_reg const mt9m114_exp_center[] = {
#if 0 /* Currently unused */ #if 0 /* Currently unused */
static struct misensor_reg const mt9m114_suspend[] = { static struct misensor_reg const mt9m114_suspend[] = {
{MISENSOR_16BIT, 0x098E, 0xDC00}, {MISENSOR_16BIT, 0x098E, 0xDC00},
{MISENSOR_8BIT, 0xDC00, 0x40}, {MISENSOR_8BIT, 0xDC00, 0x40},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
static struct misensor_reg const mt9m114_streaming[] = { static struct misensor_reg const mt9m114_streaming[] = {
{MISENSOR_16BIT, 0x098E, 0xDC00}, {MISENSOR_16BIT, 0x098E, 0xDC00},
{MISENSOR_8BIT, 0xDC00, 0x34}, {MISENSOR_8BIT, 0xDC00, 0x34},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
#endif #endif
static struct misensor_reg const mt9m114_standby_reg[] = { static struct misensor_reg const mt9m114_standby_reg[] = {
{MISENSOR_16BIT, 0x098E, 0xDC00}, {MISENSOR_16BIT, 0x098E, 0xDC00},
{MISENSOR_8BIT, 0xDC00, 0x50}, {MISENSOR_8BIT, 0xDC00, 0x50},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
#if 0 /* Currently unused */ #if 0 /* Currently unused */
static struct misensor_reg const mt9m114_wakeup_reg[] = { static struct misensor_reg const mt9m114_wakeup_reg[] = {
{MISENSOR_16BIT, 0x098E, 0xDC00}, {MISENSOR_16BIT, 0x098E, 0xDC00},
{MISENSOR_8BIT, 0xDC00, 0x54}, {MISENSOR_8BIT, 0xDC00, 0x54},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
#endif #endif
...@@ -590,7 +590,7 @@ static struct misensor_reg const mt9m114_976P_init[] = { ...@@ -590,7 +590,7 @@ static struct misensor_reg const mt9m114_976P_init[] = {
{MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */ {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
/* cam_sensor_cfg_fine_integ_time_min = 219 */ /* cam_sensor_cfg_fine_integ_time_min = 219 */
{MISENSOR_16BIT, 0xC80E, 0x00DB}, {MISENSOR_16BIT, 0xC80E, 0x00DB},
/* 0x062E //cam_sensor_cfg_fine_integ_time_max = 1459 */ /* 0x062E //cam_sensor_cfg_fine_integ_time_max = 1459 */
{MISENSOR_16BIT, 0xC810, 0x05B3}, {MISENSOR_16BIT, 0xC810, 0x05B3},
/* 0x074C //cam_sensor_cfg_frame_length_lines = 1006 */ /* 0x074C //cam_sensor_cfg_frame_length_lines = 1006 */
{MISENSOR_16BIT, 0xC812, 0x03E5}, {MISENSOR_16BIT, 0xC812, 0x03E5},
...@@ -800,19 +800,19 @@ static struct misensor_reg const mt9m114_common[] = { ...@@ -800,19 +800,19 @@ static struct misensor_reg const mt9m114_common[] = {
#if 0 /* Currently unused */ #if 0 /* Currently unused */
static struct misensor_reg const mt9m114_antiflicker_50hz[] = { static struct misensor_reg const mt9m114_antiflicker_50hz[] = {
{MISENSOR_16BIT, 0x098E, 0xC88B}, {MISENSOR_16BIT, 0x098E, 0xC88B},
{MISENSOR_8BIT, 0xC88B, 0x32}, {MISENSOR_8BIT, 0xC88B, 0x32},
{MISENSOR_8BIT, 0xDC00, 0x28}, {MISENSOR_8BIT, 0xDC00, 0x28},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
static struct misensor_reg const mt9m114_antiflicker_60hz[] = { static struct misensor_reg const mt9m114_antiflicker_60hz[] = {
{MISENSOR_16BIT, 0x098E, 0xC88B}, {MISENSOR_16BIT, 0x098E, 0xC88B},
{MISENSOR_8BIT, 0xC88B, 0x3C}, {MISENSOR_8BIT, 0xC88B, 0x3C},
{MISENSOR_8BIT, 0xDC00, 0x28}, {MISENSOR_8BIT, 0xDC00, 0x28},
{MISENSOR_16BIT, 0x0080, 0x8002}, {MISENSOR_16BIT, 0x0080, 0x8002},
{MISENSOR_TOK_TERM, 0, 0} {MISENSOR_TOK_TERM, 0, 0}
}; };
static struct misensor_reg const mt9m114_iq[] = { static struct misensor_reg const mt9m114_iq[] = {
......
This diff is collapsed.
...@@ -407,7 +407,8 @@ struct atomisp_zoom_point { ...@@ -407,7 +407,8 @@ struct atomisp_zoom_point {
* This specifies the region * This specifies the region
*/ */
struct atomisp_zoom_region { struct atomisp_zoom_region {
struct atomisp_zoom_point origin; /* Starting point coordinates for the region */ struct atomisp_zoom_point
origin; /* Starting point coordinates for the region */
struct atomisp_resolution resolution; /* Region resolution */ struct atomisp_resolution resolution; /* Region resolution */
}; };
......
...@@ -21,15 +21,15 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, ...@@ -21,15 +21,15 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct camera_sensor_platform_data *plat_data, struct camera_sensor_platform_data *plat_data,
enum intel_v4l2_subdev_type type); enum intel_v4l2_subdev_type type);
struct v4l2_subdev *atomisp_gmin_find_subdev(struct i2c_adapter *adapter, struct v4l2_subdev *atomisp_gmin_find_subdev(struct i2c_adapter *adapter,
struct i2c_board_info *board_info); struct i2c_board_info *board_info);
int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd); int atomisp_gmin_remove_subdev(struct v4l2_subdev *sd);
int gmin_get_var_int(struct device *dev, const char *var, int def); int gmin_get_var_int(struct device *dev, const char *var, int def);
int camera_sensor_csi(struct v4l2_subdev *sd, u32 port, int camera_sensor_csi(struct v4l2_subdev *sd, u32 port,
u32 lanes, u32 format, u32 bayer_order, int flag); u32 lanes, u32 format, u32 bayer_order, int flag);
struct camera_sensor_platform_data *gmin_camera_platform_data( struct camera_sensor_platform_data *gmin_camera_platform_data(
struct v4l2_subdev *subdev, struct v4l2_subdev *subdev,
enum atomisp_input_format csi_format, enum atomisp_input_format csi_format,
enum atomisp_bayer_order csi_bayer); enum atomisp_bayer_order csi_bayer);
int atomisp_gmin_register_vcm_control(struct camera_vcm_control *); int atomisp_gmin_register_vcm_control(struct camera_vcm_control *);
......
...@@ -187,13 +187,13 @@ struct camera_vcm_control; ...@@ -187,13 +187,13 @@ struct camera_vcm_control;
struct camera_vcm_ops { struct camera_vcm_ops {
int (*power_up)(struct v4l2_subdev *sd, struct camera_vcm_control *vcm); int (*power_up)(struct v4l2_subdev *sd, struct camera_vcm_control *vcm);
int (*power_down)(struct v4l2_subdev *sd, int (*power_down)(struct v4l2_subdev *sd,
struct camera_vcm_control *vcm); struct camera_vcm_control *vcm);
int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc, int (*queryctrl)(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc,
struct camera_vcm_control *vcm); struct camera_vcm_control *vcm);
int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl, int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl,
struct camera_vcm_control *vcm); struct camera_vcm_control *vcm);
int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl, int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl,
struct camera_vcm_control *vcm); struct camera_vcm_control *vcm);
}; };
struct camera_vcm_control { struct camera_vcm_control {
...@@ -215,8 +215,8 @@ struct camera_sensor_platform_data { ...@@ -215,8 +215,8 @@ struct camera_sensor_platform_data {
int (*v1p8_ctrl)(struct v4l2_subdev *subdev, int on); int (*v1p8_ctrl)(struct v4l2_subdev *subdev, int on);
int (*v2p8_ctrl)(struct v4l2_subdev *subdev, int on); int (*v2p8_ctrl)(struct v4l2_subdev *subdev, int on);
int (*v1p2_ctrl)(struct v4l2_subdev *subdev, int on); int (*v1p2_ctrl)(struct v4l2_subdev *subdev, int on);
struct camera_vcm_control * (*get_vcm_ctrl)(struct v4l2_subdev *subdev, struct camera_vcm_control *(*get_vcm_ctrl)(struct v4l2_subdev *subdev,
char *module_id); char *module_id);
}; };
struct camera_mipi_info { struct camera_mipi_info {
......
...@@ -19,9 +19,9 @@ struct i2c_client; ...@@ -19,9 +19,9 @@ struct i2c_client;
struct firmware; struct firmware;
int load_msr_list(struct i2c_client *client, char *path, int load_msr_list(struct i2c_client *client, char *path,
const struct firmware **fw); const struct firmware **fw);
int apply_msr_data(struct i2c_client *client, const struct firmware *fw); int apply_msr_data(struct i2c_client *client, const struct firmware *fw);
void release_msr_list(struct i2c_client *client, void release_msr_list(struct i2c_client *client,
const struct firmware *fw); const struct firmware *fw);
#endif /* ifndef __LIBMSRLISTHELPER_H__ */ #endif /* ifndef __LIBMSRLISTHELPER_H__ */
...@@ -76,8 +76,8 @@ acc_get_fw(struct atomisp_sub_device *asd, unsigned int handle) ...@@ -76,8 +76,8 @@ acc_get_fw(struct atomisp_sub_device *asd, unsigned int handle)
struct atomisp_acc_fw *acc_fw; struct atomisp_acc_fw *acc_fw;
list_for_each_entry(acc_fw, &asd->acc.fw, list) list_for_each_entry(acc_fw, &asd->acc.fw, list)
if (acc_fw->handle == handle) if (acc_fw->handle == handle)
return acc_fw; return acc_fw;
return NULL; return NULL;
} }
...@@ -141,9 +141,9 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd, ...@@ -141,9 +141,9 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
struct atomisp_acc_fw_load_to_pipe *user_fw) struct atomisp_acc_fw_load_to_pipe *user_fw)
{ {
static const unsigned int pipeline_flags = static const unsigned int pipeline_flags =
ATOMISP_ACC_FW_LOAD_FL_PREVIEW | ATOMISP_ACC_FW_LOAD_FL_COPY | ATOMISP_ACC_FW_LOAD_FL_PREVIEW | ATOMISP_ACC_FW_LOAD_FL_COPY |
ATOMISP_ACC_FW_LOAD_FL_VIDEO | ATOMISP_ACC_FW_LOAD_FL_VIDEO |
ATOMISP_ACC_FW_LOAD_FL_CAPTURE | ATOMISP_ACC_FW_LOAD_FL_ACC; ATOMISP_ACC_FW_LOAD_FL_CAPTURE | ATOMISP_ACC_FW_LOAD_FL_ACC;
struct atomisp_acc_fw *acc_fw; struct atomisp_acc_fw *acc_fw;
int handle; int handle;
...@@ -194,11 +194,11 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd, ...@@ -194,11 +194,11 @@ int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
if (acc_fw->fw->type == ia_css_isp_firmware) { if (acc_fw->fw->type == ia_css_isp_firmware) {
static const int type_to_css[] = { static const int type_to_css[] = {
[ATOMISP_ACC_FW_LOAD_TYPE_OUTPUT] = [ATOMISP_ACC_FW_LOAD_TYPE_OUTPUT] =
IA_CSS_ACC_OUTPUT, IA_CSS_ACC_OUTPUT,
[ATOMISP_ACC_FW_LOAD_TYPE_VIEWFINDER] = [ATOMISP_ACC_FW_LOAD_TYPE_VIEWFINDER] =
IA_CSS_ACC_VIEWFINDER, IA_CSS_ACC_VIEWFINDER,
[ATOMISP_ACC_FW_LOAD_TYPE_STANDALONE] = [ATOMISP_ACC_FW_LOAD_TYPE_STANDALONE] =
IA_CSS_ACC_STANDALONE, IA_CSS_ACC_STANDALONE,
}; };
acc_fw->fw->info.isp.type = type_to_css[acc_fw->type]; acc_fw->fw->info.isp.type = type_to_css[acc_fw->type];
} }
...@@ -383,7 +383,8 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map) ...@@ -383,7 +383,8 @@ int atomisp_acc_map(struct atomisp_sub_device *asd, struct atomisp_acc_map *map)
return 0; return 0;
} }
int atomisp_acc_unmap(struct atomisp_sub_device *asd, struct atomisp_acc_map *map) int atomisp_acc_unmap(struct atomisp_sub_device *asd,
struct atomisp_acc_map *map)
{ {
struct atomisp_map *atomisp_map; struct atomisp_map *atomisp_map;
...@@ -465,9 +466,9 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd) ...@@ -465,9 +466,9 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd)
if (acc_fw->flags & acc_flag_to_pipe[i].flag) { if (acc_fw->flags & acc_flag_to_pipe[i].flag) {
ret = atomisp_css_load_acc_extension(asd, ret = atomisp_css_load_acc_extension(asd,
acc_fw->fw, acc_fw->fw,
acc_flag_to_pipe[i].pipe_id, acc_flag_to_pipe[i].pipe_id,
acc_fw->type); acc_fw->type);
if (ret) if (ret)
goto error; goto error;
...@@ -496,7 +497,7 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd) ...@@ -496,7 +497,7 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd)
while (--i >= 0) { while (--i >= 0) {
if (acc_fw->flags & acc_flag_to_pipe[i].flag) { if (acc_fw->flags & acc_flag_to_pipe[i].flag) {
atomisp_css_unload_acc_extension(asd, acc_fw->fw, atomisp_css_unload_acc_extension(asd, acc_fw->fw,
acc_flag_to_pipe[i].pipe_id); acc_flag_to_pipe[i].pipe_id);
} }
} }
...@@ -512,8 +513,8 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd) ...@@ -512,8 +513,8 @@ int atomisp_acc_load_extensions(struct atomisp_sub_device *asd)
continue; continue;
if (acc_fw->flags & acc_flag_to_pipe[i].flag) { if (acc_fw->flags & acc_flag_to_pipe[i].flag) {
atomisp_css_unload_acc_extension(asd, atomisp_css_unload_acc_extension(asd,
acc_fw->fw, acc_fw->fw,
acc_flag_to_pipe[i].pipe_id); acc_flag_to_pipe[i].pipe_id);
} }
} }
} }
...@@ -536,8 +537,8 @@ void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd) ...@@ -536,8 +537,8 @@ void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd)
for (i = ARRAY_SIZE(acc_flag_to_pipe) - 1; i >= 0; i--) { for (i = ARRAY_SIZE(acc_flag_to_pipe) - 1; i >= 0; i--) {
if (acc_fw->flags & acc_flag_to_pipe[i].flag) { if (acc_fw->flags & acc_flag_to_pipe[i].flag) {
atomisp_css_unload_acc_extension(asd, atomisp_css_unload_acc_extension(asd,
acc_fw->fw, acc_fw->fw,
acc_flag_to_pipe[i].pipe_id); acc_flag_to_pipe[i].pipe_id);
} }
} }
} }
...@@ -570,7 +571,7 @@ int atomisp_acc_set_state(struct atomisp_sub_device *asd, ...@@ -570,7 +571,7 @@ int atomisp_acc_set_state(struct atomisp_sub_device *asd,
for (i = 0; i < ARRAY_SIZE(acc_flag_to_pipe); i++) { for (i = 0; i < ARRAY_SIZE(acc_flag_to_pipe); i++) {
if (acc_fw->flags & acc_flag_to_pipe[i].flag) { if (acc_fw->flags & acc_flag_to_pipe[i].flag) {
pipe = asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]. pipe = asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL].
pipes[acc_flag_to_pipe[i].pipe_id]; pipes[acc_flag_to_pipe[i].pipe_id];
r = ia_css_pipe_set_qos_ext_state(pipe, acc_fw->handle, r = ia_css_pipe_set_qos_ext_state(pipe, acc_fw->handle,
enable); enable);
if (r != IA_CSS_SUCCESS) if (r != IA_CSS_SUCCESS)
......
...@@ -241,12 +241,14 @@ struct atomisp_parameters32 { ...@@ -241,12 +241,14 @@ struct atomisp_parameters32 {
compat_uptr_t tnr_2500_config; /* Skylake: TNR config */ compat_uptr_t tnr_2500_config; /* Skylake: TNR config */
compat_uptr_t dpc_2500_config; /* Skylake: DPC config */ compat_uptr_t dpc_2500_config; /* Skylake: DPC config */
compat_uptr_t awb_2500_config; /* Skylake: auto white balance config */ compat_uptr_t awb_2500_config; /* Skylake: auto white balance config */
compat_uptr_t awb_fr_2500_config; /* Skylake: auto white balance filter response config */ compat_uptr_t
awb_fr_2500_config; /* Skylake: auto white balance filter response config */
compat_uptr_t anr_2500_config; /* Skylake: ANR config */ compat_uptr_t anr_2500_config; /* Skylake: ANR config */
compat_uptr_t af_2500_config; /* Skylake: auto focus config */ compat_uptr_t af_2500_config; /* Skylake: auto focus config */
compat_uptr_t ae_2500_config; /* Skylake: auto exposure config */ compat_uptr_t ae_2500_config; /* Skylake: auto exposure config */
compat_uptr_t bds_2500_config; /* Skylake: bayer downscaler config */ compat_uptr_t bds_2500_config; /* Skylake: bayer downscaler config */
compat_uptr_t dvs_2500_config; /* Skylake: digital video stabilization config */ compat_uptr_t
dvs_2500_config; /* Skylake: digital video stabilization config */
compat_uptr_t res_mgr_2500_config; compat_uptr_t res_mgr_2500_config;
/* /*
......
...@@ -42,15 +42,16 @@ struct atomisp_mipi_csi2_device { ...@@ -42,15 +42,16 @@ struct atomisp_mipi_csi2_device {
u32 output; /* output direction */ u32 output; /* output direction */
}; };
int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, int atomisp_csi2_set_ffmt(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
unsigned int which, uint16_t pad, unsigned int which, uint16_t pad,
struct v4l2_mbus_framefmt *ffmt); struct v4l2_mbus_framefmt *ffmt);
int atomisp_mipi_csi2_init(struct atomisp_device *isp); int atomisp_mipi_csi2_init(struct atomisp_device *isp);
void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp); void atomisp_mipi_csi2_cleanup(struct atomisp_device *isp);
void atomisp_mipi_csi2_unregister_entities( void atomisp_mipi_csi2_unregister_entities(
struct atomisp_mipi_csi2_device *csi2); struct atomisp_mipi_csi2_device *csi2);
int atomisp_mipi_csi2_register_entities(struct atomisp_mipi_csi2_device *csi2, int atomisp_mipi_csi2_register_entities(struct atomisp_mipi_csi2_device *csi2,
struct v4l2_device *vdev); struct v4l2_device *vdev);
void atomisp_csi2_configure(struct atomisp_sub_device *asd); void atomisp_csi2_configure(struct atomisp_sub_device *asd);
......
...@@ -54,7 +54,7 @@ static struct _iunit_debug iunit_debug = { ...@@ -54,7 +54,7 @@ static struct _iunit_debug iunit_debug = {
}; };
static inline int iunit_dump_dbgopt(struct atomisp_device *isp, static inline int iunit_dump_dbgopt(struct atomisp_device *isp,
unsigned int opt) unsigned int opt)
{ {
int ret = 0; int ret = 0;
...@@ -99,11 +99,11 @@ static ssize_t iunit_dbglvl_show(struct device_driver *drv, char *buf) ...@@ -99,11 +99,11 @@ static ssize_t iunit_dbglvl_show(struct device_driver *drv, char *buf)
} }
static ssize_t iunit_dbglvl_store(struct device_driver *drv, const char *buf, static ssize_t iunit_dbglvl_store(struct device_driver *drv, const char *buf,
size_t size) size_t size)
{ {
if (kstrtouint(buf, 10, &iunit_debug.dbglvl) if (kstrtouint(buf, 10, &iunit_debug.dbglvl)
|| iunit_debug.dbglvl < 1 || iunit_debug.dbglvl < 1
|| iunit_debug.dbglvl > 9) { || iunit_debug.dbglvl > 9) {
return -ERANGE; return -ERANGE;
} }
atomisp_css_debug_set_dtrace_level(iunit_debug.dbglvl); atomisp_css_debug_set_dtrace_level(iunit_debug.dbglvl);
...@@ -118,7 +118,7 @@ static ssize_t iunit_dbgfun_show(struct device_driver *drv, char *buf) ...@@ -118,7 +118,7 @@ static ssize_t iunit_dbgfun_show(struct device_driver *drv, char *buf)
} }
static ssize_t iunit_dbgfun_store(struct device_driver *drv, const char *buf, static ssize_t iunit_dbgfun_store(struct device_driver *drv, const char *buf,
size_t size) size_t size)
{ {
unsigned int opt; unsigned int opt;
int ret; int ret;
...@@ -142,7 +142,7 @@ static ssize_t iunit_dbgopt_show(struct device_driver *drv, char *buf) ...@@ -142,7 +142,7 @@ static ssize_t iunit_dbgopt_show(struct device_driver *drv, char *buf)
} }
static ssize_t iunit_dbgopt_store(struct device_driver *drv, const char *buf, static ssize_t iunit_dbgopt_store(struct device_driver *drv, const char *buf,
size_t size) size_t size)
{ {
unsigned int opt; unsigned int opt;
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment