diff options
Diffstat (limited to 'drivers')
102 files changed, 749 insertions, 1208 deletions
diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c index fafe1ebc8aff..2a5df99735fa 100644 --- a/drivers/media/cec/cec-pin.c +++ b/drivers/media/cec/cec-pin.c @@ -668,7 +668,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) /* Start bit low is too short, go back to idle */ if (delta < CEC_TIM_START_BIT_LOW_MIN - CEC_TIM_IDLE_SAMPLE) { if (!pin->rx_start_bit_low_too_short_cnt++) { - pin->rx_start_bit_low_too_short_ts = pin->ts; + pin->rx_start_bit_low_too_short_ts = ktime_to_ns(pin->ts); pin->rx_start_bit_low_too_short_delta = delta; } cec_pin_to_idle(pin); @@ -700,7 +700,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) /* Start bit is too short, go back to idle */ if (delta < CEC_TIM_START_BIT_TOTAL_MIN - CEC_TIM_IDLE_SAMPLE) { if (!pin->rx_start_bit_too_short_cnt++) { - pin->rx_start_bit_too_short_ts = pin->ts; + pin->rx_start_bit_too_short_ts = ktime_to_ns(pin->ts); pin->rx_start_bit_too_short_delta = delta; } cec_pin_to_idle(pin); @@ -770,7 +770,7 @@ static void cec_pin_rx_states(struct cec_pin *pin, ktime_t ts) */ if (delta < CEC_TIM_DATA_BIT_TOTAL_MIN) { if (!pin->rx_data_bit_too_short_cnt++) { - pin->rx_data_bit_too_short_ts = pin->ts; + pin->rx_data_bit_too_short_ts = ktime_to_ns(pin->ts); pin->rx_data_bit_too_short_delta = delta; } cec_pin_low(pin); diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c index 37632bc524d4..9b64f4f354bf 100644 --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c @@ -1149,7 +1149,7 @@ static void gen_twopix(struct tpg_data *tpg, case V4L2_PIX_FMT_NV42: buf[0][offset] = r_y_h; buf[1][2 * offset] = b_v; - buf[1][(2 * offset + 1) %8] = g_u_s; + buf[1][(2 * offset + 1) % 8] = g_u_s; break; case V4L2_PIX_FMT_YUYV: diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 21a7d4b47e1a..e33414975065 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2089,7 +2089,7 @@ static int dvb_frontend_handle_compat_ioctl(struct file *file, unsigned int cmd, } for (i = 0; i < tvps->num; i++) { err = dtv_property_process_get( - fe, &getp, (struct dtv_property *)tvp + i, file); + fe, &getp, (struct dtv_property *)(tvp + i), file); if (err < 0) { kfree(tvp); return err; diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c b/drivers/media/i2c/adv748x/adv748x-afe.c index 5188178588c9..61514bae7e5c 100644 --- a/drivers/media/i2c/adv748x/adv748x-afe.c +++ b/drivers/media/i2c/adv748x/adv748x-afe.c @@ -275,7 +275,8 @@ static int adv748x_afe_s_stream(struct v4l2_subdev *sd, int enable) { struct adv748x_afe *afe = adv748x_sd_to_afe(sd); struct adv748x_state *state = adv748x_afe_to_state(afe); - int ret, signal = V4L2_IN_ST_NO_SIGNAL; + u32 signal = V4L2_IN_ST_NO_SIGNAL; + int ret; mutex_lock(&state->mutex); diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index 8dbbf0f917df..91fae01d052b 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -1,15 +1,5 @@ -/* - * Copyright (c) 2015--2017 Intel Corporation. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2015--2017 Intel Corporation. #include <linux/delay.h> #include <linux/i2c.h> diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index 664e8acdf2a0..daec33f4196a 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1426,7 +1426,7 @@ static int imx274_set_vflip(struct stimx274 *priv, int val) err = imx274_write_reg(priv, IMX274_VFLIP_REG, val); if (err) { - dev_err(&priv->client->dev, "VFILP control error\n"); + dev_err(&priv->client->dev, "VFLIP control error\n"); return err; } diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 30ee9f71bf0d..3dbcae257164 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -1,16 +1,5 @@ -/* - * Copyright (c) 2017 Intel Corporation. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2017 Intel Corporation. #include <linux/acpi.h> #include <linux/i2c.h> @@ -1375,7 +1364,9 @@ ov13858_set_pad_format(struct v4l2_subdev *sd, if (fmt->format.code != MEDIA_BUS_FMT_SGRBG10_1X10) fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10; - mode = v4l2_find_nearest_size(supported_modes, width, height, + mode = v4l2_find_nearest_size(supported_modes, + ARRAY_SIZE(supported_modes), + width, height, fmt->format.width, fmt->format.height); ov13858_update_pad_format(mode, fmt); if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index 83c55e8288e7..385c1886a947 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -832,7 +832,6 @@ MODULE_DEVICE_TABLE(of, ov2685_of_match); static struct i2c_driver ov2685_i2c_driver = { .driver = { .name = "ov2685", - .owner = THIS_MODULE, .pm = &ov2685_pm_ops, .of_match_table = of_match_ptr(ov2685_of_match), }, diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 03940f0cdfa6..852026baa2e7 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1641,6 +1641,9 @@ static int ov5640_set_mode(struct ov5640_dev *sensor, return 0; } +static int ov5640_set_framefmt(struct ov5640_dev *sensor, + struct v4l2_mbus_framefmt *format); + /* restore the last set video mode after chip power-on */ static int ov5640_restore_mode(struct ov5640_dev *sensor) { @@ -1652,7 +1655,11 @@ static int ov5640_restore_mode(struct ov5640_dev *sensor) return ret; /* now restore the last capture mode */ - return ov5640_set_mode(sensor, &ov5640_mode_init_data); + ret = ov5640_set_mode(sensor, &ov5640_mode_init_data); + if (ret < 0) + return ret; + + return ov5640_set_framefmt(sensor, &sensor->fmt); } static void ov5640_power(struct ov5640_dev *sensor, bool enable) @@ -1874,7 +1881,13 @@ static int ov5640_try_fmt_internal(struct v4l2_subdev *sd, if (ov5640_formats[i].code == fmt->code) break; if (i >= ARRAY_SIZE(ov5640_formats)) - fmt->code = ov5640_formats[0].code; + i = 0; + + fmt->code = ov5640_formats[i].code; + fmt->colorspace = ov5640_formats[i].colorspace; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE; + fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace); return 0; } @@ -1885,6 +1898,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, { struct ov5640_dev *sensor = to_ov5640_dev(sd); const struct ov5640_mode_info *new_mode; + struct v4l2_mbus_framefmt *mbus_fmt = &format->format; int ret; if (format->pad != 0) @@ -1897,7 +1911,7 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, goto out; } - ret = ov5640_try_fmt_internal(sd, &format->format, + ret = ov5640_try_fmt_internal(sd, mbus_fmt, sensor->current_fr, &new_mode); if (ret) goto out; @@ -1906,12 +1920,12 @@ static int ov5640_set_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt = v4l2_subdev_get_try_format(sd, cfg, 0); - *fmt = format->format; + *fmt = *mbus_fmt; goto out; } sensor->current_mode = new_mode; - sensor->fmt = format->format; + sensor->fmt = *mbus_fmt; sensor->pending_mode_change = true; out: mutex_unlock(&sensor->lock); @@ -2496,6 +2510,7 @@ static int ov5640_probe(struct i2c_client *client, struct device *dev = &client->dev; struct fwnode_handle *endpoint; struct ov5640_dev *sensor; + struct v4l2_mbus_framefmt *fmt; int ret; sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL); @@ -2503,10 +2518,15 @@ static int ov5640_probe(struct i2c_client *client, return -ENOMEM; sensor->i2c_client = client; - sensor->fmt.code = MEDIA_BUS_FMT_UYVY8_2X8; - sensor->fmt.width = 640; - sensor->fmt.height = 480; - sensor->fmt.field = V4L2_FIELD_NONE; + fmt = &sensor->fmt; + fmt->code = ov5640_formats[0].code; + fmt->colorspace = ov5640_formats[0].colorspace; + fmt->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(fmt->colorspace); + fmt->quantization = V4L2_QUANTIZATION_FULL_RANGE; + fmt->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(fmt->colorspace); + fmt->width = 640; + fmt->height = 480; + fmt->field = V4L2_FIELD_NONE; sensor->frame_interval.numerator = 1; sensor->frame_interval.denominator = ov5640_framerates[OV5640_30_FPS]; sensor->current_fr = OV5640_30_FPS; diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index d28845f7356f..4e3142a7e5a7 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -959,23 +959,6 @@ __ov5645_get_pad_crop(struct ov5645 *ov5645, struct v4l2_subdev_pad_config *cfg, } } -static const struct ov5645_mode_info * -ov5645_find_nearest_mode(unsigned int width, unsigned int height) -{ - int i; - - for (i = ARRAY_SIZE(ov5645_mode_info_data) - 1; i >= 0; i--) { - if (ov5645_mode_info_data[i].width <= width && - ov5645_mode_info_data[i].height <= height) - break; - } - - if (i < 0) - i = 0; - - return &ov5645_mode_info_data[i]; -} - static int ov5645_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) @@ -989,8 +972,11 @@ static int ov5645_set_format(struct v4l2_subdev *sd, __crop = __ov5645_get_pad_crop(ov5645, cfg, format->pad, format->which); - new_mode = ov5645_find_nearest_mode(format->format.width, - format->format.height); + new_mode = v4l2_find_nearest_size(ov5645_mode_info_data, + ARRAY_SIZE(ov5645_mode_info_data), + width, height, + format->format.width, format->format.height); + __crop->width = new_mode->width; __crop->height = new_mode->height; @@ -1131,13 +1117,14 @@ static int ov5645_probe(struct i2c_client *client, ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(endpoint), &ov5645->ep); + + of_node_put(endpoint); + if (ret < 0) { dev_err(dev, "parsing endpoint node failed\n"); return ret; } - of_node_put(endpoint); - if (ov5645->ep.bus_type != V4L2_MBUS_CSI2) { dev_err(dev, "invalid bus type, must be CSI2\n"); return -EINVAL; diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index d2db480da1b9..7b7c74d77370 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -1,16 +1,5 @@ -/* - * Copyright (c) 2017 Intel Corporation. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ +// SPDX-License-Identifier: GPL-2.0 +// Copyright (c) 2017 Intel Corporation. #include <linux/acpi.h> #include <linux/i2c.h> @@ -2230,7 +2219,9 @@ static int ov5670_set_pad_format(struct v4l2_subdev *sd, fmt->format.code = MEDIA_BUS_FMT_SGRBG10_1X10; - mode = v4l2_find_nearest_size(supported_modes, width, height, + mode = v4l2_find_nearest_size(supported_modes, + ARRAY_SIZE(supported_modes), + width, height, fmt->format.width, fmt->format.height); ov5670_update_pad_format(mode, fmt); if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) { diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 226f90886484..af17aaa21f58 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1081,11 +1081,11 @@ static int mtk_jpeg_clk_init(struct mtk_jpeg_dev *jpeg) jpeg->clk_jdec = devm_clk_get(jpeg->dev, "jpgdec"); if (IS_ERR(jpeg->clk_jdec)) - return -EINVAL; + return PTR_ERR(jpeg->clk_jdec); jpeg->clk_jdec_smi = devm_clk_get(jpeg->dev, "jpgdec-smi"); if (IS_ERR(jpeg->clk_jdec_smi)) - return -EINVAL; + return PTR_ERR(jpeg->clk_jdec_smi); return 0; } diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c9e9576bb08a..49bbd1861d3a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -135,20 +135,21 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) return NULL; for (i = 0; i < size; i++) { + bool valid; + if (fmt[i].type != type) continue; - if (k == index) + valid = type != V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || + venus_helper_check_codec(inst, fmt[i].pixfmt); + if (k == index && valid) break; - k++; + if (valid) + k++; } if (i == size) return NULL; - if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && - !venus_helper_check_codec(inst, fmt[i].pixfmt)) - return NULL; - return &fmt[i]; } diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index e3a10a852cad..6b2ce479584e 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -120,20 +120,21 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) return NULL; for (i = 0; i < size; i++) { + bool valid; + if (fmt[i].type != type) continue; - if (k == index) + valid = type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || + venus_helper_check_codec(inst, fmt[i].pixfmt); + if (k == index && valid) break; - k++; + if (valid) + k++; } if (i == size) return NULL; - if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && - !venus_helper_check_codec(inst, fmt[i].pixfmt)) - return NULL; - return &fmt[i]; } diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c index 01c703683657..1599159f2574 100644 --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c @@ -561,8 +561,9 @@ int vivid_try_fmt_vid_cap(struct file *file, void *priv, mp->field = vivid_field_cap(dev, mp->field); if (vivid_is_webcam(dev)) { const struct v4l2_frmsize_discrete *sz = - v4l2_find_nearest_size(webcam_sizes, width, height, - mp->width, mp->height); + v4l2_find_nearest_size(webcam_sizes, + VIVID_WEBCAM_SIZES, width, + height, mp->width, mp->height); w = sz->width; h = sz->height; diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c index f7f3b4b2c2de..8bd6b2f1af15 100644 --- a/drivers/media/platform/vsp1/vsp1_wpf.c +++ b/drivers/media/platform/vsp1/vsp1_wpf.c @@ -452,7 +452,7 @@ static void wpf_configure(struct vsp1_entity *entity, : VI6_WPF_SRCRPF_RPF_ACT_SUB(input->entity.index); } - if (pipe->bru || pipe->num_inputs > 1) + if (pipe->bru) srcrpf |= pipe->bru->type == VSP1_ENTITY_BRU ? VI6_WPF_SRCRPF_VIRACT_MST : VI6_WPF_SRCRPF_VIRACT2_MST; diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c index bc9299059f48..3e14b9e2e763 100644 --- a/drivers/media/tuners/r820t.c +++ b/drivers/media/tuners/r820t.c @@ -20,6 +20,8 @@ // // RF Gain set/get is not implemented. +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/videodev2.h> #include <linux/mutex.h> #include <linux/slab.h> @@ -2371,7 +2373,7 @@ err: err_no_gate: mutex_unlock(&r820t_list_mutex); - tuner_info("%s: failed=%d\n", __func__, rc); + pr_info("%s: failed=%d\n", __func__, rc); r820t_release(fe); return NULL; } diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c index 713029420fcf..67ed66712d05 100644 --- a/drivers/media/usb/cx231xx/cx231xx-dvb.c +++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c @@ -276,7 +276,7 @@ static int start_streaming(struct cx231xx_dvb *dvb) if (dev->USE_ISO) { dev_dbg(dev->dev, "DVB transfer mode is ISO.\n"); - cx231xx_set_alt_setting(dev, INDEX_TS1, 4); + cx231xx_set_alt_setting(dev, INDEX_TS1, 5); rc = cx231xx_set_mode(dev, CX231XX_DIGITAL_MODE); if (rc < 0) return rc; diff --git a/drivers/media/usb/gspca/Kconfig b/drivers/media/usb/gspca/Kconfig index d214a21acff7..bc9a439745aa 100644 --- a/drivers/media/usb/gspca/Kconfig +++ b/drivers/media/usb/gspca/Kconfig @@ -7,7 +7,7 @@ menuconfig USB_GSPCA Say Y here if you want to enable selecting webcams based on the GSPCA framework. - See <file:Documentation/video4linux/gspca.txt> for more info. + See <file:Documentation/media/v4l-drivers/gspca-cardlist.rst> for more info. This driver uses the Video For Linux API. You must say Y or M to "Video For Linux" to use this driver. diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 5198c9eeb348..4312935f1dfc 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -101,7 +101,7 @@ static int get_v4l2_window32(struct v4l2_window __user *kp, static int put_v4l2_window32(struct v4l2_window __user *kp, struct v4l2_window32 __user *up) { - struct v4l2_clip __user *kclips = kp->clips; + struct v4l2_clip __user *kclips; struct v4l2_clip32 __user *uclips; compat_caddr_t p; u32 clipcount; @@ -116,6 +116,8 @@ static int put_v4l2_window32(struct v4l2_window __user *kp, if (!clipcount) return 0; + if (get_user(kclips, &kp->clips)) + return -EFAULT; if (get_user(p, &up->clips)) return -EFAULT; uclips = compat_ptr(p); diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 0301fe426a43..1d0b2208e8fb 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -939,10 +939,14 @@ int __video_register_device(struct video_device *vdev, #endif vdev->minor = i + minor_offset; vdev->num = nr; - devnode_set(vdev); /* Should not happen since we thought this minor was free */ - WARN_ON(video_device[vdev->minor] != NULL); + if (WARN_ON(video_device[vdev->minor])) { + mutex_unlock(&videodev_lock); + printk(KERN_ERR "video_device not empty!\n"); + return -ENFILE; + } + devnode_set(vdev); vdev->index = get_index(vdev); video_device[vdev->minor] = vdev; mutex_unlock(&videodev_lock); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c index 93753cb96180..512fa87fa11b 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c @@ -619,7 +619,7 @@ static const struct v4l2_ctrl_ops ctrl_ops = { .g_volatile_ctrl = gc0310_g_volatile_ctrl }; -struct v4l2_ctrl_config gc0310_controls[] = { +static const struct v4l2_ctrl_config gc0310_controls[] = { { .ops = &ctrl_ops, .id = V4L2_CID_EXPOSURE_ABSOLUTE, diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index 834fba8c4fa0..44db9f9f1fc5 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -107,7 +107,7 @@ mt9m114_write_reg(struct i2c_client *client, u16 data_length, u16 reg, u32 val) int num_msg; struct i2c_msg msg; unsigned char data[6] = {0}; - u16 *wreg; + __be16 *wreg; int retry = 0; if (!client->adapter) { @@ -130,18 +130,20 @@ again: msg.buf = data; /* high byte goes out first */ - wreg = (u16 *)data; + wreg = (void *)data; *wreg = cpu_to_be16(reg); if (data_length == MISENSOR_8BIT) { data[2] = (u8)(val); } else if (data_length == MISENSOR_16BIT) { - u16 *wdata = (u16 *)&data[2]; - *wdata = be16_to_cpu((u16)val); + u16 *wdata = (void *)&data[2]; + + *wdata = be16_to_cpu(*(__be16 *)&data[2]); } else { /* MISENSOR_32BIT */ - u32 *wdata = (u32 *)&data[2]; - *wdata = be32_to_cpu(val); + u32 *wdata = (void *)&data[2]; + + *wdata = be32_to_cpu(*(__be32 *)&data[2]); } num_msg = i2c_transfer(client->adapter, &msg, 1); @@ -245,6 +247,7 @@ static int __mt9m114_flush_reg_array(struct i2c_client *client, const int num_msg = 1; int ret; int retry = 0; + __be16 *data16 = (void *)&ctrl->buffer.addr; if (ctrl->index == 0) return 0; @@ -253,7 +256,7 @@ again: msg.addr = client->addr; msg.flags = 0; msg.len = 2 + ctrl->index; - ctrl->buffer.addr = cpu_to_be16(ctrl->buffer.addr); + *data16 = cpu_to_be16(ctrl->buffer.addr); msg.buf = (u8 *)&ctrl->buffer; ret = i2c_transfer(client->adapter, &msg, num_msg); @@ -282,8 +285,8 @@ static int __mt9m114_buf_reg_array(struct i2c_client *client, struct mt9m114_write_ctrl *ctrl, const struct misensor_reg *next) { - u16 *data16; - u32 *data32; + __be16 *data16; + __be32 *data32; int err; /* Insufficient buffer? Let's flush and get more free space. */ @@ -298,11 +301,11 @@ static int __mt9m114_buf_reg_array(struct i2c_client *client, ctrl->buffer.data[ctrl->index] = (u8)next->val; break; case MISENSOR_16BIT: - data16 = (u16 *)&ctrl->buffer.data[ctrl->index]; + data16 = (__be16 *)&ctrl->buffer.data[ctrl->index]; *data16 = cpu_to_be16((u16)next->val); break; case MISENSOR_32BIT: - data32 = (u32 *)&ctrl->buffer.data[ctrl->index]; + data32 = (__be32 *)&ctrl->buffer.data[ctrl->index]; *data32 = cpu_to_be32(next->val); break; default: diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 11412061c40e..c0849299d592 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -94,9 +94,9 @@ static int ov2680_read_reg(struct i2c_client *client, if (data_length == OV2680_8BIT) *val = (u8)data[0]; else if (data_length == OV2680_16BIT) - *val = be16_to_cpu(*(u16 *)&data[0]); + *val = be16_to_cpu(*(__be16 *)&data[0]); else - *val = be32_to_cpu(*(u32 *)&data[0]); + *val = be32_to_cpu(*(__be32 *)&data[0]); //dev_dbg(&client->dev, "++++i2c read adr%x = %x\n", reg,*val); return 0; } @@ -121,7 +121,7 @@ static int ov2680_write_reg(struct i2c_client *client, u16 data_length, { int ret; unsigned char data[4] = {0}; - u16 *wreg = (u16 *)data; + __be16 *wreg = (void *)data; const u16 len = data_length + sizeof(u16); /* 16-bit address + data */ if (data_length != OV2680_8BIT && data_length != OV2680_16BIT) { @@ -137,7 +137,8 @@ static int ov2680_write_reg(struct i2c_client *client, u16 data_length, data[2] = (u8)(val); } else { /* OV2680_16BIT */ - u16 *wdata = (u16 *)&data[2]; + __be16 *wdata = (void *)&data[2]; + *wdata = cpu_to_be16(val); } @@ -169,12 +170,13 @@ static int __ov2680_flush_reg_array(struct i2c_client *client, struct ov2680_write_ctrl *ctrl) { u16 size; + __be16 *data16 = (void *)&ctrl->buffer.addr; if (ctrl->index == 0) return 0; size = sizeof(u16) + ctrl->index; /* 16-bit address + data */ - ctrl->buffer.addr = cpu_to_be16(ctrl->buffer.addr); + *data16 = cpu_to_be16(ctrl->buffer.addr); ctrl->index = 0; return ov2680_i2c_write(client, size, (u8 *)&ctrl->buffer); @@ -185,7 +187,7 @@ static int __ov2680_buf_reg_array(struct i2c_client *client, const struct ov2680_reg *next) { int size; - u16 *data16; + __be16 *data16; switch (next->type) { case OV2680_8BIT: @@ -194,7 +196,7 @@ static int __ov2680_buf_reg_array(struct i2c_client *client, break; case OV2680_16BIT: size = 2; - data16 = (u16 *)&ctrl->buffer.data[ctrl->index]; + data16 = (void *)&ctrl->buffer.data[ctrl->index]; *data16 = cpu_to_be16((u16)next->val); break; default: @@ -722,7 +724,7 @@ static const struct v4l2_ctrl_ops ctrl_ops = { .g_volatile_ctrl = ov2680_g_volatile_ctrl }; -struct v4l2_ctrl_config ov2680_controls[] = { +static const struct v4l2_ctrl_config ov2680_controls[] = { { .ops = &ctrl_ops, .id = V4L2_CID_EXPOSURE_ABSOLUTE, diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index e59358ac89ce..a362eebd882f 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -85,9 +85,9 @@ static int ov2722_read_reg(struct i2c_client *client, if (data_length == OV2722_8BIT) *val = (u8)data[0]; else if (data_length == OV2722_16BIT) - *val = be16_to_cpu(*(u16 *)&data[0]); + *val = be16_to_cpu(*(__be16 *)&data[0]); else - *val = be32_to_cpu(*(u32 *)&data[0]); + *val = be32_to_cpu(*(__be32 *)&data[0]); return 0; } @@ -112,7 +112,7 @@ static int ov2722_write_reg(struct i2c_client *client, u16 data_length, { int ret; unsigned char data[4] = {0}; - u16 *wreg = (u16 *)data; + __be16 *wreg = (__be16 *)data; const u16 len = data_length + sizeof(u16); /* 16-bit address + data */ if (data_length != OV2722_8BIT && data_length != OV2722_16BIT) { @@ -128,7 +128,8 @@ static int ov2722_write_reg(struct i2c_client *client, u16 data_length, data[2] = (u8)(val); } else { /* OV2722_16BIT */ - u16 *wdata = (u16 *)&data[2]; + __be16 *wdata = (__be16 *)&data[2]; + *wdata = cpu_to_be16(val); } @@ -160,12 +161,13 @@ static int __ov2722_flush_reg_array(struct i2c_client *client, struct ov2722_write_ctrl *ctrl) { u16 size; + __be16 *data16 = (void *)&ctrl->buffer.addr; if (ctrl->index == 0) return 0; size = sizeof(u16) + ctrl->index; /* 16-bit address + data */ - ctrl->buffer.addr = cpu_to_be16(ctrl->buffer.addr); + *data16 = cpu_to_be16(ctrl->buffer.addr); ctrl->index = 0; return ov2722_i2c_write(client, size, (u8 *)&ctrl->buffer); @@ -176,7 +178,7 @@ static int __ov2722_buf_reg_array(struct i2c_client *client, const struct ov2722_reg *next) { int size; - u16 *data16; + __be16 *data16; switch (next->type) { case OV2722_8BIT: @@ -185,7 +187,7 @@ static int __ov2722_buf_reg_array(struct i2c_client *client, break; case OV2722_16BIT: size = 2; - data16 = (u16 *)&ctrl->buffer.data[ctrl->index]; + data16 = (void *)&ctrl->buffer.data[ctrl->index]; *data16 = cpu_to_be16((u16)next->val); break; default: @@ -569,7 +571,7 @@ static const struct v4l2_ctrl_ops ctrl_ops = { .g_volatile_ctrl = ov2722_g_volatile_ctrl }; -struct v4l2_ctrl_config ov2722_controls[] = { +static const struct v4l2_ctrl_config ov2722_controls[] = { { .ops = &ctrl_ops, .id = V4L2_CID_EXPOSURE_ABSOLUTE, diff --git a/drivers/staging/media/atomisp/i2c/gc0310.h b/drivers/staging/media/atomisp/i2c/gc0310.h index af6b11f6e5e7..70c252c5163c 100644 --- a/drivers/staging/media/atomisp/i2c/gc0310.h +++ b/drivers/staging/media/atomisp/i2c/gc0310.h @@ -377,8 +377,7 @@ static struct gc0310_reg const gc0310_VGA_30fps[] = { {GC0310_TOK_TERM, 0, 0}, }; - -struct gc0310_resolution gc0310_res_preview[] = { +static struct gc0310_resolution gc0310_res_preview[] = { { .desc = "gc0310_VGA_30fps", .width = 656, // 648, diff --git a/drivers/staging/media/atomisp/i2c/ov2722.h b/drivers/staging/media/atomisp/i2c/ov2722.h index 028b04aaaa8f..757b37613ccc 100644 --- a/drivers/staging/media/atomisp/i2c/ov2722.h +++ b/drivers/staging/media/atomisp/i2c/ov2722.h @@ -1096,7 +1096,7 @@ static struct ov2722_reg const ov2722_720p_30fps[] = { {OV2722_TOK_TERM, 0, 0}, }; -struct ov2722_resolution ov2722_res_preview[] = { +static struct ov2722_resolution ov2722_res_preview[] = { { .desc = "ov2722_1632_1092_30fps", .width = 1632, diff --git a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c index 30a735e59e54..714297c36b3e 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c +++ b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c @@ -173,9 +173,9 @@ static int ov5693_read_reg(struct i2c_client *client, if (data_length == OV5693_8BIT) *val = (u8)data[0]; else if (data_length == OV5693_16BIT) - *val = be16_to_cpu(*(u16 *)&data[0]); + *val = be16_to_cpu(*(__be16 *)&data[0]); else - *val = be32_to_cpu(*(u32 *)&data[0]); + *val = be32_to_cpu(*(__be32 *)&data[0]); return 0; } @@ -200,13 +200,13 @@ static int vcm_dw_i2c_write(struct i2c_client *client, u16 data) struct i2c_msg msg; const int num_msg = 1; int ret; - u16 val; + __be16 val; val = cpu_to_be16(data); msg.addr = VCM_ADDR; msg.flags = 0; msg.len = OV5693_16BIT; - msg.buf = (u8 *)&val; + msg.buf = (void *)&val; ret = i2c_transfer(client->adapter, &msg, 1); @@ -263,7 +263,7 @@ static int ov5693_write_reg(struct i2c_client *client, u16 data_length, { int ret; unsigned char data[4] = {0}; - u16 *wreg = (u16 *)data; + __be16 *wreg = (void *)data; const u16 len = data_length + sizeof(u16); /* 16-bit address + data */ if (data_length != OV5693_8BIT && data_length != OV5693_16BIT) { @@ -279,7 +279,8 @@ static int ov5693_write_reg(struct i2c_client *client, u16 data_length, data[2] = (u8)(val); } else { /* OV5693_16BIT */ - u16 *wdata = (u16 *)&data[2]; + __be16 *wdata = (void *)&data[2]; + *wdata = cpu_to_be16(val); } @@ -311,15 +312,17 @@ static int __ov5693_flush_reg_array(struct i2c_client *client, struct ov5693_write_ctrl *ctrl) { u16 size; + __be16 *reg = (void *)&ctrl->buffer.addr; if (ctrl->index == 0) return 0; size = sizeof(u16) + ctrl->index; /* 16-bit address + data */ - ctrl->buffer.addr = cpu_to_be16(ctrl->buffer.addr); + + *reg = cpu_to_be16(ctrl->buffer.addr); ctrl->index = 0; - return ov5693_i2c_write(client, size, (u8 *)&ctrl->buffer); + return ov5693_i2c_write(client, size, (u8 *)reg); } static int __ov5693_buf_reg_array(struct i2c_client *client, @@ -327,7 +330,7 @@ static int __ov5693_buf_reg_array(struct i2c_client *client, const struct ov5693_reg *next) { int size; - u16 *data16; + __be16 *data16; switch (next->type) { case OV5693_8BIT: @@ -336,7 +339,8 @@ static int __ov5693_buf_reg_array(struct i2c_client *client, break; case OV5693_16BIT: size = 2; - data16 = (u16 *)&ctrl->buffer.data[ctrl->index]; + + data16 = (void *)&ctrl->buffer.data[ctrl->index]; *data16 = cpu_to_be16((u16)next->val); break; default: @@ -951,7 +955,7 @@ static int ad5823_t_focus_vcm(struct v4l2_subdev *sd, u16 val) return ret; } -int ad5823_t_focus_abs(struct v4l2_subdev *sd, s32 value) +static int ad5823_t_focus_abs(struct v4l2_subdev *sd, s32 value) { value = min(value, AD5823_MAX_FOCUS_POS); return ad5823_t_focus_vcm(sd, value); @@ -1132,7 +1136,7 @@ static const struct v4l2_ctrl_ops ctrl_ops = { .g_volatile_ctrl = ov5693_g_volatile_ctrl }; -struct v4l2_ctrl_config ov5693_controls[] = { +static const struct v4l2_ctrl_config ov5693_controls[] = { { .ops = &ctrl_ops, .id = V4L2_CID_EXPOSURE_ABSOLUTE, diff --git a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h index 6d27dd849a62..9058a82455a6 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h +++ b/drivers/staging/media/atomisp/i2c/ov5693/ov5693.h @@ -1087,7 +1087,7 @@ static struct ov5693_reg const ov5693_2576x1936_30fps[] = { {OV5693_TOK_TERM, 0, 0} }; -struct ov5693_resolution ov5693_res_preview[] = { +static struct ov5693_resolution ov5693_res_preview[] = { { .desc = "ov5693_736x496_30fps", .width = 736, diff --git a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h index e0f0c379e7ce..aa5e294e7b7d 100644 --- a/drivers/staging/media/atomisp/include/linux/atomisp_platform.h +++ b/drivers/staging/media/atomisp/include/linux/atomisp_platform.h @@ -104,6 +104,10 @@ enum atomisp_input_format { ATOMISP_INPUT_FORMAT_USER_DEF8, /* User defined 8-bit data type 8 */ }; +#define N_ATOMISP_INPUT_FORMAT (ATOMISP_INPUT_FORMAT_USER_DEF8 + 1) + + + enum intel_v4l2_subdev_type { RAW_CAMERA = 1, SOC_CAMERA = 2, diff --git a/drivers/staging/media/atomisp/pci/atomisp2/Makefile b/drivers/staging/media/atomisp/pci/atomisp2/Makefile index 83f816faba1b..7fead5fc9a7d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/Makefile +++ b/drivers/staging/media/atomisp/pci/atomisp2/Makefile @@ -59,17 +59,14 @@ atomisp-objs += \ css2400/isp/kernels/bnr/bnr_1.0/ia_css_bnr.host.o \ css2400/isp/kernels/bnr/bnr2_2/ia_css_bnr2_2.host.o \ css2400/isp/kernels/dpc2/ia_css_dpc2.host.o \ - css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.o \ css2400/isp/kernels/fc/fc_1.0/ia_css_formats.host.o \ css2400/isp/kernels/ctc/ctc_1.0/ia_css_ctc.host.o \ css2400/isp/kernels/ctc/ctc_1.0/ia_css_ctc_table.host.o \ css2400/isp/kernels/ctc/ctc2/ia_css_ctc2.host.o \ css2400/isp/kernels/ctc/ctc1_5/ia_css_ctc1_5.host.o \ css2400/isp/kernels/bh/bh_2/ia_css_bh.host.o \ - css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.o \ css2400/isp/kernels/bnlm/ia_css_bnlm.host.o \ css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.o \ - css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.o \ css2400/isp/kernels/dvs/dvs_1.0/ia_css_dvs.host.o \ css2400/isp/kernels/anr/anr_1.0/ia_css_anr.host.o \ css2400/isp/kernels/anr/anr_2/ia_css_anr2_table.host.o \ @@ -96,7 +93,6 @@ atomisp-objs += \ css2400/isp/kernels/ob/ob2/ia_css_ob2.host.o \ css2400/isp/kernels/iterator/iterator_1.0/ia_css_iterator.host.o \ css2400/isp/kernels/wb/wb_1.0/ia_css_wb.host.o \ - css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.o \ css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.o \ css2400/isp/kernels/sc/sc_1.0/ia_css_sc.host.o \ css2400/isp/kernels/ipu2_io_ls/bayer_io_ls/ia_css_bayer_io.host.o \ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c index 22f2dbcecc15..fa6ea506f8b1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c @@ -437,7 +437,7 @@ static void atomisp_reset_event(struct atomisp_sub_device *asd) } -static void print_csi_rx_errors(enum ia_css_csi2_port port, +static void print_csi_rx_errors(enum mipi_port_id port, struct atomisp_device *isp) { u32 infos = 0; @@ -481,7 +481,7 @@ static void clear_irq_reg(struct atomisp_device *isp) } static struct atomisp_sub_device * -__get_asd_from_port(struct atomisp_device *isp, mipi_port_ID_t port) +__get_asd_from_port(struct atomisp_device *isp, enum mipi_port_id port) { int i; @@ -515,7 +515,7 @@ irqreturn_t atomisp_isr(int irq, void *dev) spin_lock_irqsave(&isp->lock, flags); if (isp->sw_contex.power_state != ATOM_ISP_POWER_UP || - isp->css_initialized == false) { + !isp->css_initialized) { spin_unlock_irqrestore(&isp->lock, flags); return IRQ_HANDLED; } @@ -570,9 +570,9 @@ irqreturn_t atomisp_isr(int irq, void *dev) (irq_infos & CSS_IRQ_INFO_IF_ERROR)) { /* handle mipi receiver error */ u32 rx_infos; - enum ia_css_csi2_port port; + enum mipi_port_id port; - for (port = IA_CSS_CSI2_PORT0; port <= IA_CSS_CSI2_PORT2; + for (port = MIPI_PORT0_ID; port <= MIPI_PORT2_ID; port++) { print_csi_rx_errors(port, isp); atomisp_css_rx_get_irq_info(port, &rx_infos); @@ -4603,7 +4603,7 @@ int atomisp_fixed_pattern(struct atomisp_sub_device *asd, int flag, } if (*value == 0) { - asd->params.fpn_en = 0; + asd->params.fpn_en = false; return 0; } @@ -5028,7 +5028,7 @@ atomisp_try_fmt_file(struct atomisp_device *isp, struct v4l2_format *f) return 0; } -mipi_port_ID_t __get_mipi_port(struct atomisp_device *isp, +enum mipi_port_id __get_mipi_port(struct atomisp_device *isp, enum atomisp_camera_port port) { switch (port) { @@ -5162,22 +5162,22 @@ static int __enable_continuous_mode(struct atomisp_sub_device *asd, return atomisp_update_run_mode(asd); } -int configure_pp_input_nop(struct atomisp_sub_device *asd, - unsigned int width, unsigned int height) +static int configure_pp_input_nop(struct atomisp_sub_device *asd, + unsigned int width, unsigned int height) { return 0; } -int configure_output_nop(struct atomisp_sub_device *asd, - unsigned int width, unsigned int height, - unsigned int min_width, - enum atomisp_css_frame_format sh_fmt) +static int configure_output_nop(struct atomisp_sub_device *asd, + unsigned int width, unsigned int height, + unsigned int min_width, + enum atomisp_css_frame_format sh_fmt) { return 0; } -int get_frame_info_nop(struct atomisp_sub_device *asd, - struct atomisp_css_frame_info *finfo) +static int get_frame_info_nop(struct atomisp_sub_device *asd, + struct atomisp_css_frame_info *finfo) { return 0; } @@ -5524,7 +5524,7 @@ static void atomisp_get_dis_envelop(struct atomisp_sub_device *asd, /* if subdev type is SOC camera,we do not need to set DVS */ if (isp->inputs[asd->input_curr].type == SOC_CAMERA) - asd->params.video_dis_en = 0; + asd->params.video_dis_en = false; if (asd->params.video_dis_en && asd->run_mode->val == ATOMISP_RUN_MODE_VIDEO) { @@ -5624,7 +5624,7 @@ static int atomisp_set_fmt_to_snr(struct video_device *vdev, ffmt = req_ffmt; dev_warn(isp->dev, "can not enable video dis due to sensor limitation."); - asd->params.video_dis_en = 0; + asd->params.video_dis_en = false; } } dev_dbg(isp->dev, "sensor width: %d, height: %d\n", @@ -5649,7 +5649,7 @@ static int atomisp_set_fmt_to_snr(struct video_device *vdev, (ffmt->width < req_ffmt->width || ffmt->height < req_ffmt->height)) { dev_warn(isp->dev, "can not enable video dis due to sensor limitation."); - asd->params.video_dis_en = 0; + asd->params.video_dis_en = false; } atomisp_subdev_set_ffmt(&asd->subdev, fh.pad, @@ -6152,7 +6152,7 @@ int atomisp_set_shading_table(struct atomisp_sub_device *asd, if (!user_shading_table->enable) { atomisp_css_set_shading_table(asd, NULL); - asd->params.sc_en = 0; + asd->params.sc_en = false; return 0; } @@ -6190,7 +6190,7 @@ int atomisp_set_shading_table(struct atomisp_sub_device *asd, free_table = asd->params.css_param.shading_table; asd->params.css_param.shading_table = shading_table; atomisp_css_set_shading_table(asd, shading_table); - asd->params.sc_en = 1; + asd->params.sc_en = true; out: if (free_table != NULL) @@ -6627,7 +6627,7 @@ int atomisp_inject_a_fake_event(struct atomisp_sub_device *asd, int *event) return 0; } -int atomisp_get_pipe_id(struct atomisp_video_pipe *pipe) +static int atomisp_get_pipe_id(struct atomisp_video_pipe *pipe) { struct atomisp_sub_device *asd = pipe->asd; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.h index bdc73862fb79..79d493dba403 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.h @@ -389,7 +389,7 @@ int atomisp_source_pad_to_stream_id(struct atomisp_sub_device *asd, */ void atomisp_eof_event(struct atomisp_sub_device *asd, uint8_t exp_id); -mipi_port_ID_t __get_mipi_port(struct atomisp_device *isp, +enum mipi_port_id __get_mipi_port(struct atomisp_device *isp, enum atomisp_camera_port port); bool atomisp_is_vf_pipe(struct atomisp_video_pipe *pipe); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h index 3ef850cd25bd..6c829d0a1e4c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h @@ -148,10 +148,10 @@ void atomisp_css_init_struct(struct atomisp_sub_device *asd); int atomisp_css_irq_translate(struct atomisp_device *isp, unsigned int *infos); -void atomisp_css_rx_get_irq_info(enum ia_css_csi2_port port, +void atomisp_css_rx_get_irq_info(enum mipi_port_id port, unsigned int *infos); -void atomisp_css_rx_clear_irq_info(enum ia_css_csi2_port port, +void atomisp_css_rx_clear_irq_info(enum mipi_port_id port, unsigned int infos); int atomisp_css_irq_enable(struct atomisp_device *isp, @@ -182,8 +182,6 @@ void atomisp_css_mmu_invalidate_cache(void); void atomisp_css_mmu_invalidate_tlb(void); -void atomisp_css_mmu_set_page_table_base_index(unsigned long base_index); - int atomisp_css_start(struct atomisp_sub_device *asd, enum atomisp_css_pipe_id pipe_id, bool in_reset); @@ -255,7 +253,7 @@ void atomisp_css_isys_set_valid(struct atomisp_sub_device *asd, void atomisp_css_isys_set_format(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format format, + enum atomisp_input_format format, int isys_stream); int atomisp_css_set_default_isys_config(struct atomisp_sub_device *asd, @@ -264,18 +262,18 @@ int atomisp_css_set_default_isys_config(struct atomisp_sub_device *asd, int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format); + enum atomisp_input_format input_format); void atomisp_css_isys_two_stream_cfg_update_stream1( struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format, + enum atomisp_input_format input_format, unsigned int width, unsigned int height); void atomisp_css_isys_two_stream_cfg_update_stream2( struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format, + enum atomisp_input_format input_format, unsigned int width, unsigned int height); int atomisp_css_input_set_resolution(struct atomisp_sub_device *asd, @@ -292,7 +290,7 @@ void atomisp_css_input_set_bayer_order(struct atomisp_sub_device *asd, void atomisp_css_input_set_format(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format format); + enum atomisp_input_format format); int atomisp_css_input_set_effective_resolution( struct atomisp_sub_device *asd, @@ -334,11 +332,11 @@ void atomisp_css_enable_cvf(struct atomisp_sub_device *asd, bool enable); int atomisp_css_input_configure_port(struct atomisp_sub_device *asd, - mipi_port_ID_t port, + enum mipi_port_id port, unsigned int num_lanes, unsigned int timeout, unsigned int mipi_freq, - enum atomisp_css_stream_format metadata_format, + enum atomisp_input_format metadata_format, unsigned int metadata_width, unsigned int metadata_height); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c index 7621b4537147..f668c68dc33a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c @@ -88,7 +88,7 @@ unsigned int atomisp_css_debug_get_dtrace_level(void) return ia_css_debug_trace_level; } -void atomisp_css2_hw_store_8(hrt_address addr, uint8_t data) +static void atomisp_css2_hw_store_8(hrt_address addr, uint8_t data) { unsigned long flags; @@ -126,7 +126,7 @@ static uint8_t atomisp_css2_hw_load_8(hrt_address addr) return ret; } -uint16_t atomisp_css2_hw_load_16(hrt_address addr) +static uint16_t atomisp_css2_hw_load_16(hrt_address addr) { unsigned long flags; uint16_t ret; @@ -136,7 +136,8 @@ uint16_t atomisp_css2_hw_load_16(hrt_address addr) spin_unlock_irqrestore(&mmio_lock, flags); return ret; } -uint32_t atomisp_css2_hw_load_32(hrt_address addr) + +static uint32_t atomisp_css2_hw_load_32(hrt_address addr) { unsigned long flags; uint32_t ret; @@ -1019,7 +1020,7 @@ int atomisp_css_irq_translate(struct atomisp_device *isp, return 0; } -void atomisp_css_rx_get_irq_info(enum ia_css_csi2_port port, +void atomisp_css_rx_get_irq_info(enum mipi_port_id port, unsigned int *infos) { #ifndef ISP2401_NEW_INPUT_SYSTEM @@ -1029,7 +1030,7 @@ void atomisp_css_rx_get_irq_info(enum ia_css_csi2_port port, #endif } -void atomisp_css_rx_clear_irq_info(enum ia_css_csi2_port port, +void atomisp_css_rx_clear_irq_info(enum mipi_port_id port, unsigned int infos) { #ifndef ISP2401_NEW_INPUT_SYSTEM @@ -1159,31 +1160,6 @@ void atomisp_css_mmu_invalidate_tlb(void) ia_css_mmu_invalidate_cache(); } -void atomisp_css_mmu_set_page_table_base_index(unsigned long base_index) -{ -} - -/* - * Check whether currently running MIPI buffer size fulfill - * the requirement of the stream to be run - */ -bool __need_realloc_mipi_buffer(struct atomisp_device *isp) -{ - unsigned int i; - - for (i = 0; i < isp->num_of_streams; i++) { - struct atomisp_sub_device *asd = &isp->asd[i]; - - if (asd->streaming != - ATOMISP_DEVICE_STREAMING_ENABLED) - continue; - if (asd->mipi_frame_size < isp->mipi_frame_size) - return true; - } - - return false; -} - int atomisp_css_start(struct atomisp_sub_device *asd, enum atomisp_css_pipe_id pipe_id, bool in_reset) { @@ -1808,7 +1784,7 @@ void atomisp_css_isys_set_valid(struct atomisp_sub_device *asd, void atomisp_css_isys_set_format(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format format, + enum atomisp_input_format format, int isys_stream) { @@ -1820,7 +1796,7 @@ void atomisp_css_isys_set_format(struct atomisp_sub_device *asd, void atomisp_css_input_set_format(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format format) + enum atomisp_input_format format) { struct ia_css_stream_config *s_config = @@ -1859,7 +1835,7 @@ int atomisp_css_set_default_isys_config(struct atomisp_sub_device *asd, int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format) + enum atomisp_input_format input_format) { struct ia_css_stream_config *s_config = &asd->stream_env[stream_id].stream_config; @@ -1873,9 +1849,9 @@ int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device *asd, s_config->isys_config[IA_CSS_STREAM_ISYS_STREAM_1].linked_isys_stream_id = IA_CSS_STREAM_ISYS_STREAM_0; s_config->isys_config[IA_CSS_STREAM_ISYS_STREAM_0].format = - IA_CSS_STREAM_FORMAT_USER_DEF1; + ATOMISP_INPUT_FORMAT_USER_DEF1; s_config->isys_config[IA_CSS_STREAM_ISYS_STREAM_1].format = - IA_CSS_STREAM_FORMAT_USER_DEF2; + ATOMISP_INPUT_FORMAT_USER_DEF2; s_config->isys_config[IA_CSS_STREAM_ISYS_STREAM_1].valid = true; return 0; } @@ -1883,7 +1859,7 @@ int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device *asd, void atomisp_css_isys_two_stream_cfg_update_stream1( struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format, + enum atomisp_input_format input_format, unsigned int width, unsigned int height) { struct ia_css_stream_config *s_config = @@ -1901,7 +1877,7 @@ void atomisp_css_isys_two_stream_cfg_update_stream1( void atomisp_css_isys_two_stream_cfg_update_stream2( struct atomisp_sub_device *asd, enum atomisp_input_stream_id stream_id, - enum atomisp_css_stream_format input_format, + enum atomisp_input_format input_format, unsigned int width, unsigned int height) { struct ia_css_stream_config *s_config = @@ -2142,11 +2118,11 @@ void atomisp_css_enable_cvf(struct atomisp_sub_device *asd, int atomisp_css_input_configure_port( struct atomisp_sub_device *asd, - mipi_port_ID_t port, + enum mipi_port_id port, unsigned int num_lanes, unsigned int timeout, unsigned int mipi_freq, - enum atomisp_css_stream_format metadata_format, + enum atomisp_input_format metadata_format, unsigned int metadata_width, unsigned int metadata_height) { @@ -2890,8 +2866,8 @@ stream_err: return -EINVAL; } -unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd, - uint16_t source_pad) +static unsigned int atomisp_get_pipe_index(struct atomisp_sub_device *asd, + uint16_t source_pad) { struct atomisp_device *isp = asd->isp; /* diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.h index b03711668eda..a06c5b6e8027 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.h @@ -37,7 +37,6 @@ #define atomisp_css_irq_info ia_css_irq_info #define atomisp_css_isp_config ia_css_isp_config #define atomisp_css_bayer_order ia_css_bayer_order -#define atomisp_css_stream_format ia_css_stream_format #define atomisp_css_capture_mode ia_css_capture_mode #define atomisp_css_input_mode ia_css_input_mode #define atomisp_css_frame ia_css_frame @@ -117,7 +116,7 @@ */ #define CSS_ID(val) (IA_ ## val) #define CSS_EVENT(val) (IA_CSS_EVENT_TYPE_ ## val) -#define CSS_FORMAT(val) (IA_CSS_STREAM_FORMAT_ ## val) +#define CSS_FORMAT(val) (ATOMISP_INPUT_FORMAT_ ## val) #define CSS_EVENT_PORT_EOF CSS_EVENT(PORT_EOF) #define CSS_EVENT_FRAME_TAGGED CSS_EVENT(FRAME_TAGGED) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c index ceedb82b6beb..a815c768bda9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c @@ -22,6 +22,7 @@ #include "atomisp_compat.h" #include "atomisp_internal.h" #include "atomisp_ioctl.h" +#include "atomisp_drvfs.h" #include "hmm/hmm.h" /* diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c index 545ef024841d..709137f25700 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c @@ -689,7 +689,7 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp) { unsigned int i; - isp->sw_contex.file_input = 0; + isp->sw_contex.file_input = false; isp->need_gfx_throttle = true; isp->isp_fatal_error = false; isp->mipi_frame_size = 0; @@ -708,12 +708,12 @@ static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) v4l2_ctrl_s_ctrl(asd->run_mode, ATOMISP_RUN_MODE_STILL_CAPTURE); memset(&asd->params.css_param, 0, sizeof(asd->params.css_param)); asd->params.color_effect = V4L2_COLORFX_NONE; - asd->params.bad_pixel_en = 1; - asd->params.gdc_cac_en = 0; - asd->params.video_dis_en = 0; - asd->params.sc_en = 0; - asd->params.fpn_en = 0; - asd->params.xnr_en = 0; + asd->params.bad_pixel_en = true; + asd->params.gdc_cac_en = false; + asd->params.video_dis_en = false; + asd->params.sc_en = false; + asd->params.fpn_en = false; + asd->params.xnr_en = false; asd->params.false_color = 0; asd->params.online_process = 1; asd->params.yuv_ds_en = 0; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c index 5c84dd63778e..61bd550dafb9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c @@ -1607,10 +1607,12 @@ int atomisp_stream_on_master_slave_sensor(struct atomisp_device *isp, /* FIXME! */ #ifndef ISP2401 -void __wdt_on_master_slave_sensor(struct atomisp_device *isp, unsigned int wdt_duration) +static void __wdt_on_master_slave_sensor(struct atomisp_device *isp, + unsigned int wdt_duration) #else -void __wdt_on_master_slave_sensor(struct atomisp_video_pipe *pipe, - unsigned int wdt_duration, bool enable) +static void __wdt_on_master_slave_sensor(struct atomisp_video_pipe *pipe, + unsigned int wdt_duration, + bool enable) #endif { #ifndef ISP2401 @@ -2731,7 +2733,7 @@ static int atomisp_s_parm_file(struct file *file, void *fh, } rt_mutex_lock(&isp->mutex); - isp->sw_contex.file_input = 1; + isp->sw_contex.file_input = true; rt_mutex_unlock(&isp->mutex); return 0; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.c index b78276ac22da..49a9973b4289 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.c @@ -42,17 +42,17 @@ const struct atomisp_in_fmt_conv atomisp_in_fmt_conv[] = { { MEDIA_BUS_FMT_SGBRG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_GBRG, CSS_FORMAT_RAW_12 }, { MEDIA_BUS_FMT_SGRBG12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_GRBG, CSS_FORMAT_RAW_12 }, { MEDIA_BUS_FMT_SRGGB12_1X12, 12, 12, ATOMISP_INPUT_FORMAT_RAW_12, CSS_BAYER_ORDER_RGGB, CSS_FORMAT_RAW_12 }, - { MEDIA_BUS_FMT_UYVY8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, IA_CSS_STREAM_FORMAT_YUV422_8 }, - { MEDIA_BUS_FMT_YUYV8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, IA_CSS_STREAM_FORMAT_YUV422_8 }, - { MEDIA_BUS_FMT_JPEG_1X8, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, IA_CSS_STREAM_FORMAT_BINARY_8 }, + { MEDIA_BUS_FMT_UYVY8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, ATOMISP_INPUT_FORMAT_YUV422_8 }, + { MEDIA_BUS_FMT_YUYV8_1X16, 8, 8, ATOMISP_INPUT_FORMAT_YUV422_8, 0, ATOMISP_INPUT_FORMAT_YUV422_8 }, + { MEDIA_BUS_FMT_JPEG_1X8, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 }, { V4L2_MBUS_FMT_CUSTOM_NV12, 12, 12, CSS_FRAME_FORMAT_NV12, 0, CSS_FRAME_FORMAT_NV12 }, { V4L2_MBUS_FMT_CUSTOM_NV21, 12, 12, CSS_FRAME_FORMAT_NV21, 0, CSS_FRAME_FORMAT_NV21 }, - { V4L2_MBUS_FMT_CUSTOM_YUV420, 12, 12, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, 0, IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY }, + { V4L2_MBUS_FMT_CUSTOM_YUV420, 12, 12, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, 0, ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY }, #if 0 - { V4L2_MBUS_FMT_CUSTOM_M10MO_RAW, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, IA_CSS_STREAM_FORMAT_BINARY_8 }, + { V4L2_MBUS_FMT_CUSTOM_M10MO_RAW, 8, 8, CSS_FRAME_FORMAT_BINARY_8, 0, ATOMISP_INPUT_FORMAT_BINARY_8 }, #endif /* no valid V4L2 MBUS code for metadata format, so leave it 0. */ - { 0, 0, 0, ATOMISP_INPUT_FORMAT_EMBEDDED, 0, IA_CSS_STREAM_FORMAT_EMBEDDED }, + { 0, 0, 0, ATOMISP_INPUT_FORMAT_EMBEDDED, 0, ATOMISP_INPUT_FORMAT_EMBEDDED }, {} }; @@ -101,7 +101,7 @@ const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv(u32 code) } const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_by_atomisp_in_fmt( - enum atomisp_css_stream_format atomisp_in_fmt) + enum atomisp_input_format atomisp_in_fmt) { int i; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.h index c3eba675da06..59ff8723c182 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_subdev.h @@ -58,9 +58,9 @@ struct atomisp_in_fmt_conv { u32 code; uint8_t bpp; /* bits per pixel */ uint8_t depth; /* uncompressed */ - enum atomisp_css_stream_format atomisp_in_fmt; + enum atomisp_input_format atomisp_in_fmt; enum atomisp_css_bayer_order bayer_order; - enum ia_css_stream_format css_stream_fmt; + enum atomisp_input_format css_stream_fmt; }; struct atomisp_sub_device; @@ -424,10 +424,10 @@ bool atomisp_subdev_is_compressed(u32 code); const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv(u32 code); #ifndef ISP2401 const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_by_atomisp_in_fmt( - enum atomisp_css_stream_format atomisp_in_fmt); + enum atomisp_input_format atomisp_in_fmt); #else const struct atomisp_in_fmt_conv - *atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_css_stream_format + *atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_input_format atomisp_in_fmt); #endif const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_compressed(u32 code); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h index a8c27676a38b..5ab48f346790 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/interface/ia_css_util.h @@ -116,7 +116,7 @@ extern bool ia_css_util_resolution_is_even( * */ extern unsigned int ia_css_util_input_format_bpp( - enum ia_css_stream_format stream_format, + enum atomisp_input_format stream_format, bool two_ppc); /* @brief check if input format it raw @@ -126,7 +126,7 @@ extern unsigned int ia_css_util_input_format_bpp( * */ extern bool ia_css_util_is_input_format_raw( - enum ia_css_stream_format stream_format); + enum atomisp_input_format stream_format); /* @brief check if input format it yuv * @@ -135,7 +135,7 @@ extern bool ia_css_util_is_input_format_raw( * */ extern bool ia_css_util_is_input_format_yuv( - enum ia_css_stream_format stream_format); + enum atomisp_input_format stream_format); #endif /* __IA_CSS_UTIL_H__ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c index 54193789a809..91e586112332 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/camera/util/src/util.c @@ -52,55 +52,55 @@ enum ia_css_err ia_css_convert_errno( /* MW: Table look-up ??? */ unsigned int ia_css_util_input_format_bpp( - enum ia_css_stream_format format, + enum atomisp_input_format format, bool two_ppc) { unsigned int rval = 0; switch (format) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_RGB_888: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_BINARY_8: - case IA_CSS_STREAM_FORMAT_EMBEDDED: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_EMBEDDED: rval = 8; break; - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_RAW_10: rval = 10; break; - case IA_CSS_STREAM_FORMAT_YUV420_16: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV422_16: rval = 16; break; - case IA_CSS_STREAM_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_444: rval = 4; break; - case IA_CSS_STREAM_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_555: rval = 5; break; - case IA_CSS_STREAM_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_565: rval = 65; break; - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RAW_6: rval = 6; break; - case IA_CSS_STREAM_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_7: rval = 7; break; - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_12: rval = 12; break; - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_14: if (two_ppc) rval = 14; else rval = 12; break; - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_16: if (two_ppc) rval = 16; else @@ -175,28 +175,28 @@ bool ia_css_util_resolution_is_even(const struct ia_css_resolution resolution) } #endif -bool ia_css_util_is_input_format_raw(enum ia_css_stream_format format) +bool ia_css_util_is_input_format_raw(enum atomisp_input_format format) { - return ((format == IA_CSS_STREAM_FORMAT_RAW_6) || - (format == IA_CSS_STREAM_FORMAT_RAW_7) || - (format == IA_CSS_STREAM_FORMAT_RAW_8) || - (format == IA_CSS_STREAM_FORMAT_RAW_10) || - (format == IA_CSS_STREAM_FORMAT_RAW_12)); + return ((format == ATOMISP_INPUT_FORMAT_RAW_6) || + (format == ATOMISP_INPUT_FORMAT_RAW_7) || + (format == ATOMISP_INPUT_FORMAT_RAW_8) || + (format == ATOMISP_INPUT_FORMAT_RAW_10) || + (format == ATOMISP_INPUT_FORMAT_RAW_12)); /* raw_14 and raw_16 are not supported as input formats to the ISP. * They can only be copied to a frame in memory using the * copy binary. */ } -bool ia_css_util_is_input_format_yuv(enum ia_css_stream_format format) +bool ia_css_util_is_input_format_yuv(enum atomisp_input_format format) { - return format == IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY || - format == IA_CSS_STREAM_FORMAT_YUV420_8 || - format == IA_CSS_STREAM_FORMAT_YUV420_10 || - format == IA_CSS_STREAM_FORMAT_YUV420_16 || - format == IA_CSS_STREAM_FORMAT_YUV422_8 || - format == IA_CSS_STREAM_FORMAT_YUV422_10 || - format == IA_CSS_STREAM_FORMAT_YUV422_16; + return format == ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY || + format == ATOMISP_INPUT_FORMAT_YUV420_8 || + format == ATOMISP_INPUT_FORMAT_YUV420_10 || + format == ATOMISP_INPUT_FORMAT_YUV420_16 || + format == ATOMISP_INPUT_FORMAT_YUV422_8 || + format == ATOMISP_INPUT_FORMAT_YUV422_10 || + format == ATOMISP_INPUT_FORMAT_YUV422_16; } enum ia_css_err ia_css_util_check_input( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h index d2e3a2deea2e..7907f0ff6d6c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/css_2401_csi2p_system/system_global.h @@ -284,12 +284,12 @@ typedef enum { N_RX_ID } rx_ID_t; -typedef enum { +enum mipi_port_id { MIPI_PORT0_ID = 0, MIPI_PORT1_ID, MIPI_PORT2_ID, N_MIPI_PORT_ID -} mipi_port_ID_t; +}; #define N_RX_CHANNEL_ID 4 diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/debug.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/debug.c index c412810887b3..dcb9a3127cfe 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/debug.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/debug.c @@ -29,7 +29,7 @@ hrt_address debug_buffer_address = (hrt_address)-1; hrt_vaddress debug_buffer_ddr_address = (hrt_vaddress)-1; /* The local copy */ -debug_data_t debug_data; +static debug_data_t debug_data; debug_data_t *debug_data_ptr = &debug_data; void debug_buffer_init(const hrt_address addr) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/gp_timer.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/gp_timer.c index bcfd443f5202..b6b1344786b1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/gp_timer.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/gp_timer.c @@ -29,7 +29,7 @@ gp_timer_reg_load(uint32_t reg); static void gp_timer_reg_store(uint32_t reg, uint32_t value); -uint32_t +static uint32_t gp_timer_reg_load(uint32_t reg) { return ia_css_device_load_uint32( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_formatter.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_formatter.c index a8997e45738e..0e1ca995fb06 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_formatter.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_formatter.c @@ -45,8 +45,9 @@ const uint8_t HIVE_IF_SWITCH_CODE[N_INPUT_FORMATTER_ID] = { HIVE_INPUT_SWITCH_SELECT_STR_TO_MEM}; /* MW Should be part of system_global.h, where we have the main enumeration */ -const bool HIVE_IF_BIN_COPY[N_INPUT_FORMATTER_ID] = { - false, false, false, true}; +static const bool HIVE_IF_BIN_COPY[N_INPUT_FORMATTER_ID] = { + false, false, false, true +}; void input_formatter_rst( const input_formatter_ID_t ID) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c index bd6821e436b2..2515e162828f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system.c @@ -29,7 +29,7 @@ #define ZERO (0x0) #define ONE (1U) -const ib_buffer_t IB_BUFFER_NULL = {0 ,0, 0 }; +static const ib_buffer_t IB_BUFFER_NULL = {0 ,0, 0 }; static input_system_error_t input_system_configure_channel( const channel_cfg_t channel); @@ -98,7 +98,7 @@ static inline void ctrl_unit_get_state( static inline void mipi_port_get_state( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, mipi_port_state_t *state); static inline void rx_channel_get_state( @@ -180,7 +180,7 @@ void receiver_get_state( const rx_ID_t ID, receiver_state_t *state) { - mipi_port_ID_t port_id; + enum mipi_port_id port_id; unsigned int ch_id; assert(ID < N_RX_ID); @@ -209,7 +209,7 @@ void receiver_get_state( state->raw16 = (uint16_t)receiver_reg_load(ID, _HRT_CSS_RECEIVER_RAW16_REG_IDX); - for (port_id = (mipi_port_ID_t)0; port_id < N_MIPI_PORT_ID; port_id++) { + for (port_id = (enum mipi_port_id)0; port_id < N_MIPI_PORT_ID; port_id++) { mipi_port_get_state(ID, port_id, &(state->mipi_port_state[port_id])); } @@ -305,7 +305,7 @@ void receiver_set_compression( void receiver_port_enable( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const bool cnd) { hrt_data reg = receiver_port_reg_load(ID, port_ID, @@ -324,7 +324,7 @@ void receiver_port_enable( bool is_receiver_port_enabled( const rx_ID_t ID, - const mipi_port_ID_t port_ID) + const enum mipi_port_id port_ID) { hrt_data reg = receiver_port_reg_load(ID, port_ID, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX); @@ -333,7 +333,7 @@ bool is_receiver_port_enabled( void receiver_irq_enable( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const rx_irq_info_t irq_info) { receiver_port_reg_store(ID, @@ -343,7 +343,7 @@ void receiver_irq_enable( rx_irq_info_t receiver_get_irq_info( const rx_ID_t ID, - const mipi_port_ID_t port_ID) + const enum mipi_port_id port_ID) { return receiver_port_reg_load(ID, port_ID, _HRT_CSS_RECEIVER_IRQ_STATUS_REG_IDX); @@ -351,7 +351,7 @@ rx_irq_info_t receiver_get_irq_info( void receiver_irq_clear( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const rx_irq_info_t irq_info) { receiver_port_reg_store(ID, @@ -556,7 +556,7 @@ static inline void ctrl_unit_get_state( static inline void mipi_port_get_state( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, mipi_port_state_t *state) { int i; @@ -644,12 +644,12 @@ static inline void rx_channel_get_state( } // MW: "2400" in the name is not good, but this is to avoid a naming conflict -input_system_cfg2400_t config; +static input_system_cfg2400_t config; static void receiver_rst( const rx_ID_t ID) { - mipi_port_ID_t port_id; + enum mipi_port_id port_id; assert(ID < N_RX_ID); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h index 3e8bd00082dc..bf9230fd08f2 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_local.h @@ -353,7 +353,7 @@ typedef struct rx_cfg_s rx_cfg_t; */ struct rx_cfg_s { rx_mode_t mode; /* The HW config */ - mipi_port_ID_t port; /* The port ID to apply the control on */ + enum mipi_port_id port; /* The port ID to apply the control on */ unsigned int timeout; unsigned int initcount; unsigned int synccount; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h index 118185eb86e9..48876bb08b70 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/host/input_system_private.h @@ -63,7 +63,7 @@ STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_reg_load( STORAGE_CLASS_INPUT_SYSTEM_C void receiver_port_reg_store( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const hrt_address reg, const hrt_data value) { @@ -77,7 +77,7 @@ STORAGE_CLASS_INPUT_SYSTEM_C void receiver_port_reg_store( STORAGE_CLASS_INPUT_SYSTEM_C hrt_data receiver_port_reg_load( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const hrt_address reg) { assert(ID < N_RX_ID); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h index d803efd7400a..6f63962a54e8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_common/system_global.h @@ -266,12 +266,12 @@ typedef enum { N_RX_ID } rx_ID_t; -typedef enum { +enum mipi_port_id { MIPI_PORT0_ID = 0, MIPI_PORT1_ID, MIPI_PORT2_ID, N_MIPI_PORT_ID -} mipi_port_ID_t; +}; #define N_RX_CHANNEL_ID 4 diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h index 1596757fe9ef..6e37ff0fe0f9 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/host/input_system_public.h @@ -83,7 +83,7 @@ extern void receiver_set_compression( */ extern void receiver_port_enable( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const bool cnd); /*! Flag if PORT[port_ID] of RECEIVER[ID] is enabled @@ -95,7 +95,7 @@ extern void receiver_port_enable( */ extern bool is_receiver_port_enabled( const rx_ID_t ID, - const mipi_port_ID_t port_ID); + const enum mipi_port_id port_ID); /*! Enable the IRQ channels of PORT[port_ID] of RECEIVER[ID] @@ -107,7 +107,7 @@ extern bool is_receiver_port_enabled( */ extern void receiver_irq_enable( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const rx_irq_info_t irq_info); /*! Return the IRQ status of PORT[port_ID] of RECEIVER[ID] @@ -119,7 +119,7 @@ extern void receiver_irq_enable( */ extern rx_irq_info_t receiver_get_irq_info( const rx_ID_t ID, - const mipi_port_ID_t port_ID); + const enum mipi_port_id port_ID); /*! Clear the IRQ status of PORT[port_ID] of RECEIVER[ID] @@ -131,7 +131,7 @@ extern rx_irq_info_t receiver_get_irq_info( */ extern void receiver_irq_clear( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const rx_irq_info_t irq_info); /*! Write to a control register of INPUT_SYSTEM[ID] @@ -195,7 +195,7 @@ STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_reg_load( */ STORAGE_CLASS_INPUT_SYSTEM_H void receiver_port_reg_store( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const hrt_address reg, const hrt_data value); @@ -210,7 +210,7 @@ STORAGE_CLASS_INPUT_SYSTEM_H void receiver_port_reg_store( */ STORAGE_CLASS_INPUT_SYSTEM_H hrt_data receiver_port_reg_load( const rx_ID_t ID, - const mipi_port_ID_t port_ID, + const enum mipi_port_id port_ID, const hrt_address reg); /*! Write to a control register of SUB_SYSTEM[sub_ID] of INPUT_SYSTEM[ID] diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_input_port.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_input_port.h index f415570a3da9..ad9ca5449369 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_input_port.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_input_port.h @@ -12,6 +12,9 @@ * more details. */ +/* For MIPI_PORT0_ID to MIPI_PORT2_ID */ +#include "system_global.h" + #ifndef __IA_CSS_INPUT_PORT_H #define __IA_CSS_INPUT_PORT_H @@ -19,21 +22,12 @@ * This file contains information about the possible input ports for CSS */ -/* Enumeration of the physical input ports on the CSS hardware. - * There are 3 MIPI CSI-2 ports. - */ -enum ia_css_csi2_port { - IA_CSS_CSI2_PORT0, /* Implicitly map to MIPI_PORT0_ID */ - IA_CSS_CSI2_PORT1, /* Implicitly map to MIPI_PORT1_ID */ - IA_CSS_CSI2_PORT2 /* Implicitly map to MIPI_PORT2_ID */ -}; - /* Backward compatible for CSS API 2.0 only * TO BE REMOVED when all drivers move to CSS API 2.1 */ -#define IA_CSS_CSI2_PORT_4LANE IA_CSS_CSI2_PORT0 -#define IA_CSS_CSI2_PORT_1LANE IA_CSS_CSI2_PORT1 -#define IA_CSS_CSI2_PORT_2LANE IA_CSS_CSI2_PORT2 +#define IA_CSS_CSI2_PORT_4LANE MIPI_PORT0_ID +#define IA_CSS_CSI2_PORT_1LANE MIPI_PORT1_ID +#define IA_CSS_CSI2_PORT_2LANE MIPI_PORT2_ID /* The CSI2 interface supports 2 types of compression or can * be run without compression. @@ -56,7 +50,7 @@ struct ia_css_csi2_compression { /* Input port structure. */ struct ia_css_input_port { - enum ia_css_csi2_port port; /** Physical CSI-2 port */ + enum mipi_port_id port; /** Physical CSI-2 port */ unsigned int num_lanes; /** Number of lanes used (4-lane port only) */ unsigned int timeout; /** Timeout value */ unsigned int rxcount; /** Register value, should include all lanes */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_irq.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_irq.h index 10ef61178bb2..c8840138899a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_irq.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_irq.h @@ -186,7 +186,7 @@ ia_css_rx_get_irq_info(unsigned int *irq_bits); * that occurred. */ void -ia_css_rx_port_get_irq_info(enum ia_css_csi2_port port, unsigned int *irq_bits); +ia_css_rx_port_get_irq_info(enum mipi_port_id port, unsigned int *irq_bits); /* @brief Clear CSI receiver error info. * @@ -218,7 +218,7 @@ ia_css_rx_clear_irq_info(unsigned int irq_bits); * error bits get overwritten. */ void -ia_css_rx_port_clear_irq_info(enum ia_css_csi2_port port, unsigned int irq_bits); +ia_css_rx_port_clear_irq_info(enum mipi_port_id port, unsigned int irq_bits); /* @brief Enable or disable specific interrupts. * diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_metadata.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_metadata.h index 8b674c98224c..ed0b6ab371da 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_metadata.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_metadata.h @@ -27,8 +27,8 @@ * to process sensor metadata. */ struct ia_css_metadata_config { - enum ia_css_stream_format data_type; /** Data type of CSI-2 embedded - data. The default value is IA_CSS_STREAM_FORMAT_EMBEDDED. For + enum atomisp_input_format data_type; /** Data type of CSI-2 embedded + data. The default value is ATOMISP_INPUT_FORMAT_EMBEDDED. For certain sensors, user can choose non-default data type for embedded data. */ struct ia_css_resolution resolution; /** Resolution */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_mipi.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_mipi.h index f9c9cd76be97..367b2aafa5e8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_mipi.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_mipi.h @@ -55,7 +55,7 @@ ia_css_mipi_frame_specify(const unsigned int size_mem_words, * */ enum ia_css_err -ia_css_mipi_frame_enable_check_on_size(const enum ia_css_csi2_port port, +ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port, const unsigned int size_mem_words); #endif @@ -74,7 +74,7 @@ ia_css_mipi_frame_enable_check_on_size(const enum ia_css_csi2_port port, enum ia_css_err ia_css_mipi_frame_calculate_size(const unsigned int width, const unsigned int height, - const enum ia_css_stream_format format, + const enum atomisp_input_format format, const bool hasSOLandEOL, const unsigned int embedded_data_size_words, unsigned int *size_mem_words); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_format.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_format.h index f7e9020a86e1..f97b9eb2b19c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_format.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_format.h @@ -20,75 +20,10 @@ */ #include <type_support.h> /* bool */ - -/* The ISP streaming input interface supports the following formats. - * These match the corresponding MIPI formats. - */ -enum ia_css_stream_format { - IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY, /** 8 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV420_8, /** 8 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV420_10, /** 10 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV420_16, /** 16 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV422_8, /** UYVY..UYVY, 8 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV422_10, /** UYVY..UYVY, 10 bits per subpixel */ - IA_CSS_STREAM_FORMAT_YUV422_16, /** UYVY..UYVY, 16 bits per subpixel */ - IA_CSS_STREAM_FORMAT_RGB_444, /** BGR..BGR, 4 bits per subpixel */ - IA_CSS_STREAM_FORMAT_RGB_555, /** BGR..BGR, 5 bits per subpixel */ - IA_CSS_STREAM_FORMAT_RGB_565, /** BGR..BGR, 5 bits B and R, 6 bits G */ - IA_CSS_STREAM_FORMAT_RGB_666, /** BGR..BGR, 6 bits per subpixel */ - IA_CSS_STREAM_FORMAT_RGB_888, /** BGR..BGR, 8 bits per subpixel */ - IA_CSS_STREAM_FORMAT_RAW_6, /** RAW data, 6 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_7, /** RAW data, 7 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_8, /** RAW data, 8 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_10, /** RAW data, 10 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_12, /** RAW data, 12 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_14, /** RAW data, 14 bits per pixel */ - IA_CSS_STREAM_FORMAT_RAW_16, /** RAW data, 16 bits per pixel, which is - not specified in CSI-MIPI standard*/ - IA_CSS_STREAM_FORMAT_BINARY_8, /** Binary byte stream, which is target at - JPEG. */ - - /* CSI2-MIPI specific format: Generic short packet data. It is used to - * keep the timing information for the opening/closing of shutters, - * triggering of flashes and etc. - */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT1, /** Generic Short Packet Code 1 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT2, /** Generic Short Packet Code 2 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT3, /** Generic Short Packet Code 3 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT4, /** Generic Short Packet Code 4 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT5, /** Generic Short Packet Code 5 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT6, /** Generic Short Packet Code 6 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT7, /** Generic Short Packet Code 7 */ - IA_CSS_STREAM_FORMAT_GENERIC_SHORT8, /** Generic Short Packet Code 8 */ - - /* CSI2-MIPI specific format: YUV data. - */ - IA_CSS_STREAM_FORMAT_YUV420_8_SHIFT, /** YUV420 8-bit (Chroma Shifted Pixel Sampling) */ - IA_CSS_STREAM_FORMAT_YUV420_10_SHIFT, /** YUV420 8-bit (Chroma Shifted Pixel Sampling) */ - - /* CSI2-MIPI specific format: Generic long packet data - */ - IA_CSS_STREAM_FORMAT_EMBEDDED, /** Embedded 8-bit non Image Data */ - - /* CSI2-MIPI specific format: User defined byte-based data. For example, - * the data transmitter (e.g. the SoC sensor) can keep the JPEG data as - * the User Defined Data Type 4 and the MPEG data as the - * User Defined Data Type 7. - */ - IA_CSS_STREAM_FORMAT_USER_DEF1, /** User defined 8-bit data type 1 */ - IA_CSS_STREAM_FORMAT_USER_DEF2, /** User defined 8-bit data type 2 */ - IA_CSS_STREAM_FORMAT_USER_DEF3, /** User defined 8-bit data type 3 */ - IA_CSS_STREAM_FORMAT_USER_DEF4, /** User defined 8-bit data type 4 */ - IA_CSS_STREAM_FORMAT_USER_DEF5, /** User defined 8-bit data type 5 */ - IA_CSS_STREAM_FORMAT_USER_DEF6, /** User defined 8-bit data type 6 */ - IA_CSS_STREAM_FORMAT_USER_DEF7, /** User defined 8-bit data type 7 */ - IA_CSS_STREAM_FORMAT_USER_DEF8, /** User defined 8-bit data type 8 */ -}; - -#define IA_CSS_STREAM_FORMAT_NUM IA_CSS_STREAM_FORMAT_USER_DEF8 +#include "../../../include/linux/atomisp_platform.h" unsigned int ia_css_util_input_format_bpp( - enum ia_css_stream_format format, + enum atomisp_input_format format, bool two_ppc); -#endif /* __IA_CSS_STREAM_FORMAT_H */ +#endif /* __ATOMISP_INPUT_FORMAT_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_public.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_public.h index ca3203357ff5..ddefad330db7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_public.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_stream_public.h @@ -62,7 +62,7 @@ enum { */ struct ia_css_stream_isys_stream_config { struct ia_css_resolution input_res; /** Resolution of input data */ - enum ia_css_stream_format format; /** Format of input stream. This data + enum atomisp_input_format format; /** Format of input stream. This data format will be mapped to MIPI data type internally. */ int linked_isys_stream_id; /** default value is -1, other value means @@ -77,7 +77,7 @@ struct ia_css_stream_input_config { Used for CSS 2400/1 System and deprecated for other systems (replaced by input_effective_res in ia_css_pipe_config) */ - enum ia_css_stream_format format; /** Format of input stream. This data + enum atomisp_input_format format; /** Format of input stream. This data format will be mapped to MIPI data type internally. */ enum ia_css_bayer_order bayer_order; /** Bayer order for RAW streams */ @@ -257,7 +257,7 @@ ia_css_stream_unload(struct ia_css_stream *stream); * * This function will return the stream format. */ -enum ia_css_stream_format +enum atomisp_input_format ia_css_stream_get_format(const struct ia_css_stream *stream); /* @brief Check if the stream is configured for 2 pixels per clock @@ -453,7 +453,7 @@ ia_css_stream_send_input_line(const struct ia_css_stream *stream, */ void ia_css_stream_send_input_embedded_line(const struct ia_css_stream *stream, - enum ia_css_stream_format format, + enum atomisp_input_format format, const unsigned short *data, unsigned int width); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm.host.h index b99c0644ab38..675f6e539b3f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm.host.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm.host.h @@ -17,7 +17,6 @@ #include "ia_css_bnlm_types.h" #include "ia_css_bnlm_param.h" -#include "ia_css_bnlm_default.host.h" void ia_css_bnlm_vmem_encode( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.c deleted file mode 100644 index e2eb88c0f123..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_bnlm_types.h" - -const struct ia_css_bnlm_config default_bnlm_config = { - - .rad_enable = true, - .rad_x_origin = 0, - .rad_y_origin = 0, - .avg_min_th = 127, - .max_min_th = 2047, - - .exp_coeff_a = 6048, - .exp_coeff_b = 7828, - .exp_coeff_c = 0, - .exp_exponent = 3, - - .nl_th = {2252, 2251, 2250}, - .match_quality_max_idx = {2, 3, 3, 1}, - - .mu_root_lut_thr = { - 26, 56, 128, 216, 462, 626, 932, 1108, 1480, 1564, 1824, 1896, 2368, 3428, 4560}, - .mu_root_lut_val = { - 384, 320, 320, 264, 248, 240, 224, 192, 192, 160, 160, 160, 136, 130, 96, 80}, - .sad_norm_lut_thr = { - 236, 328, 470, 774, 964, 1486, 2294, 3244, 4844, 6524, 6524, 6524, 6524, 6524, 6524}, - .sad_norm_lut_val = { - 8064, 7680, 7168, 6144, 5120, 3840, 2560, 2304, 1984, 1792, 1792, 1792, 1792, 1792, 1792, 1792}, - .sig_detail_lut_thr = { - 2936, 3354, 3943, 4896, 5230, 5682, 5996, 7299, 7299, 7299, 7299, 7299, 7299, 7299, 7299}, - .sig_detail_lut_val = { - 8191, 7680, 7168, 6144, 5120, 4608, 4224, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032, 4032}, - .sig_rad_lut_thr = { - 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20}, - .sig_rad_lut_val = { - 2560, 7168, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188, 8188}, - .rad_pow_lut_thr = { - 0, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013, 7013}, - .rad_pow_lut_val = { - 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191}, - .nl_0_lut_thr = { - 1072, 7000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000}, - .nl_0_lut_val = { - 2560, 3072, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120, 5120}, - .nl_1_lut_thr = { - 624, 3224, 3392, 7424, 7424, 7424, 7424, 7424, 7424, 7424, 7424, 7424, 7424, 7424, 7424}, - .nl_1_lut_val = { - 3584, 4608, 5120, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144, 6144}, - .nl_2_lut_thr = { - 745, 2896, 3720, 6535, 7696, 8040, 8040, 8040, 8040, 8040, 8040, 8040, 8040, 8040, 8040}, - .nl_2_lut_val = { - 3584, 4608, 6144, 7168, 7936, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191}, - .nl_3_lut_thr = { - 4848, 4984, 5872, 6000, 6517, 6960, 7944, 8088, 8161, 8161, 8161, 8161, 8161, 8161, 8161}, - .nl_3_lut_val = { - 3072, 4104, 4608, 5120, 6144, 7168, 7680, 8128, 8191, 8191, 8191, 8191, 8191, 8191, 8191, 8191}, - -}; - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.h deleted file mode 100644 index f18c8070abba..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/bnlm/ia_css_bnlm_default.host.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_BNLM_DEFAULT_HOST_H -#define __IA_CSS_BNLM_DEFAULT_HOST_H - -#include "ia_css_bnlm_types.h" -extern const struct ia_css_bnlm_config default_bnlm_config; - -#endif /* __IA_CSS_BNLM_DEFAULT_HOST_H */ - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2.host.h index 641564b4af8e..38d10a5237c6 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2.host.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2.host.h @@ -17,7 +17,6 @@ #include "ia_css_dpc2_types.h" #include "ia_css_dpc2_param.h" -#include "ia_css_dpc2_default.host.h" void ia_css_dpc2_encode( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.c deleted file mode 100644 index c102601cc635..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_dpc2_types.h" - -const struct ia_css_dpc2_config default_dpc2_config = { - .metric1 = 1638, - .metric2 = 128, - .metric3 = 1638, - .wb_gain_gr = 512, - .wb_gain_r = 512, - .wb_gain_b = 512, - .wb_gain_gb = 512 -}; - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.h deleted file mode 100644 index a1527ce3eddc..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/dpc2/ia_css_dpc2_default.host.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_DPC2_DEFAULT_HOST_H -#define __IA_CSS_DPC2_DEFAULT_HOST_H - -#include "ia_css_dpc2_types.h" - -extern const struct ia_css_dpc2_config default_dpc2_config; - -#endif /* __IA_CSS_DPC2_DEFAULT_HOST_H */ - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.h index 355ff13273b0..fff932c1364e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8.host.h @@ -17,7 +17,6 @@ #include "ia_css_eed1_8_types.h" #include "ia_css_eed1_8_param.h" -#include "ia_css_eed1_8_default.host.h" void ia_css_eed1_8_vmem_encode( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.c deleted file mode 100644 index 3622719dafa5..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_eed1_8_types.h" - -/* The default values for the kernel parameters are based on - * ISP261 CSS API public parameter list_all.xlsx from 12-09-2014 - * The parameter list is available on the ISP261 sharepoint - */ - -/* Default kernel parameters. */ -const struct ia_css_eed1_8_config default_eed1_8_config = { - .rbzp_strength = 5489, - .fcstrength = 6554, - .fcthres_0 = 0, - .fcthres_1 = 0, - .fc_sat_coef = 8191, - .fc_coring_prm = 128, - .aerel_thres0 = 0, - .aerel_gain0 = 8191, - .aerel_thres1 = 16, - .aerel_gain1 = 20, - .derel_thres0 = 1229, - .derel_gain0 = 1, - .derel_thres1 = 819, - .derel_gain1 = 1, - .coring_pos0 = 0, - .coring_pos1 = 0, - .coring_neg0 = 0, - .coring_neg1 = 0, - .gain_exp = 2, - .gain_pos0 = 6144, - .gain_pos1 = 2048, - .gain_neg0 = 2048, - .gain_neg1 = 6144, - .pos_margin0 = 1475, - .pos_margin1 = 1475, - .neg_margin0 = 1475, - .neg_margin1 = 1475, - .dew_enhance_seg_x = { - 0, - 64, - 272, - 688, - 1376, - 2400, - 3840, - 5744, - 8191 - }, - .dew_enhance_seg_y = { - 0, - 144, - 480, - 1040, - 1852, - 2945, - 4357, - 6094, - 8191 - }, - .dew_enhance_seg_slope = { - 4608, - 3308, - 2757, - 2417, - 2186, - 8033, - 7473, - 7020 - }, - .dew_enhance_seg_exp = { - 2, - 2, - 2, - 2, - 2, - 0, - 0, - 0 - }, - .dedgew_max = 6144 -}; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.h deleted file mode 100644 index 782f739ca8b5..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/eed1_8/ia_css_eed1_8_default.host.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_EED1_8_DEFAULT_HOST_H -#define __IA_CSS_EED1_8_DEFAULT_HOST_H - -#include "ia_css_eed1_8_types.h" - -extern const struct ia_css_eed1_8_config default_eed1_8_config; - -#endif /* __IA_CSS_EED1_8_DEFAULT_HOST_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/output/output_1.0/ia_css_output.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/output/output_1.0/ia_css_output.host.c index 8fdf47c9310c..9efe5e5e4e06 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/output/output_1.0/ia_css_output.host.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/output/output_1.0/ia_css_output.host.c @@ -60,7 +60,7 @@ ia_css_output_config( (void)size; ia_css_dma_configure_from_info(&to->port_b, from->info); to->width_a_over_b = elems_a / to->port_b.elems; - to->height = from->info->res.height; + to->height = from->info ? from->info->res.height : 0; to->enable = from->info != NULL; ia_css_frame_info_to_frame_sp_info(&to->info, from->info); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw.host.c index 68a27f0cfba0..fa9ce0fedf23 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw.host.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw.host.c @@ -37,34 +37,34 @@ sh_css_elems_bytes_from_info (unsigned raw_bit_depth) /* MW: These areMIPI / ISYS properties, not camera function properties */ static enum sh_stream_format -css2isp_stream_format(enum ia_css_stream_format from) +css2isp_stream_format(enum atomisp_input_format from) { switch (from) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: return sh_stream_format_yuv420_legacy; - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_16: return sh_stream_format_yuv420; - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_16: return sh_stream_format_yuv422; - case IA_CSS_STREAM_FORMAT_RGB_444: - case IA_CSS_STREAM_FORMAT_RGB_555: - case IA_CSS_STREAM_FORMAT_RGB_565: - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_888: return sh_stream_format_rgb; - case IA_CSS_STREAM_FORMAT_RAW_6: - case IA_CSS_STREAM_FORMAT_RAW_7: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_RAW_10: - case IA_CSS_STREAM_FORMAT_RAW_12: - case IA_CSS_STREAM_FORMAT_RAW_14: - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_16: return sh_stream_format_raw; - case IA_CSS_STREAM_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: default: return sh_stream_format_raw; } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw_types.h index 5c0b8febd79a..ae868eb5e10f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw_types.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/raw/raw_1.0/ia_css_raw_types.h @@ -28,7 +28,7 @@ struct ia_css_raw_configuration { const struct ia_css_frame_info *in_info; const struct ia_css_frame_info *internal_info; bool two_ppc; - enum ia_css_stream_format stream_format; + enum atomisp_input_format stream_format; bool deinterleaved; uint8_t enable_left_padding; }; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.c index e775af51c0c0..78a113bfe8f1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.c @@ -15,7 +15,7 @@ #include "ia_css_debug.h" #include "ia_css_tdf.host.h" -const int16_t g_pyramid[8][8] = { +static const int16_t g_pyramid[8][8] = { {128, 384, 640, 896, 896, 640, 384, 128}, {384, 1152, 1920, 2688, 2688, 1920, 1152, 384}, {640, 1920, 3200, 4480, 4480, 3200, 1920, 640}, diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h index 1b3e759e41a3..bd628a18e839 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf.host.h @@ -17,7 +17,6 @@ #include "ia_css_tdf_types.h" #include "ia_css_tdf_param.h" -#include "ia_css_tdf_default.host.h" void ia_css_tdf_vmem_encode( diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.c deleted file mode 100644 index 9bb42daf070d..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#include "ia_css_tdf_types.h" - -const struct ia_css_tdf_config default_tdf_config = { - .thres_flat_table = {0}, - .thres_detail_table = {0}, - .epsilon_0 = 4095, - .epsilon_1 = 5733, - .eps_scale_text = 409, - .eps_scale_edge = 3686, - .sepa_flat = 1294, - .sepa_edge = 4095, - .blend_flat = 819, - .blend_text = 819, - .blend_edge = 8191, - .shading_gain = 1024, - .shading_base_gain = 8191, - .local_y_gain = 0, - .local_y_base_gain = 2047, - .rad_x_origin = 0, - .rad_y_origin = 0 -}; - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.h deleted file mode 100644 index cd8fb70e5a87..000000000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/tdf/tdf_1.0/ia_css_tdf_default.host.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Support for Intel Camera Imaging ISP subsystem. - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ - -#ifndef __IA_CSS_TDF_DEFAULT_HOST_H -#define __IA_CSS_TDF_DEFAULT_HOST_H - -#include "ia_css_tdf_types.h" - -extern const struct ia_css_tdf_config default_tdf_config; - -#endif /* __IA_CSS_TDF_DEFAULT_HOST_H */ - diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c index 5610833ed595..c2076e412410 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/vf/vf_1.0/ia_css_vf.host.c @@ -130,11 +130,11 @@ ia_css_vf_configure( err = configure_kernel(info, out_info, vf_info, downscale_log2, &config); configure_dma(&config, vf_info); - if (binary) { - if (vf_info) - vf_info->raw_bit_depth = info->dma.vfdec_bits_per_pixel; - ia_css_configure_vf (binary, &config); - } + + if (vf_info) + vf_info->raw_bit_depth = info->dma.vfdec_bits_per_pixel; + ia_css_configure_vf (binary, &config); + return IA_CSS_SUCCESS; } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h index 732e49a241eb..b62c4d321a4e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h @@ -113,7 +113,7 @@ struct ia_css_binary_descr { #endif bool enable_capture_pp_bli; struct ia_css_resolution dvs_env; - enum ia_css_stream_format stream_format; + enum atomisp_input_format stream_format; struct ia_css_frame_info *in_info; /* the info of the input-frame with the ISP required resolution. */ struct ia_css_frame_info *bds_out_info; @@ -126,7 +126,7 @@ struct ia_css_binary_descr { struct ia_css_binary { const struct ia_css_binary_xinfo *info; - enum ia_css_stream_format input_format; + enum atomisp_input_format input_format; struct ia_css_frame_info in_frame_info; struct ia_css_frame_info internal_frame_info; struct ia_css_frame_info out_frame_info[IA_CSS_BINARY_MAX_OUTPUT_PORTS]; @@ -162,7 +162,7 @@ struct ia_css_binary { #define IA_CSS_BINARY_DEFAULT_SETTINGS \ (struct ia_css_binary) { \ - .input_format = IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY, \ + .input_format = ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY, \ .in_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ .internal_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ .out_frame_info = {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \ @@ -179,7 +179,7 @@ enum ia_css_err ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, bool online, bool two_ppc, - enum ia_css_stream_format stream_format, + enum atomisp_input_format stream_format, const struct ia_css_frame_info *in_info, const struct ia_css_frame_info *bds_out_info, const struct ia_css_frame_info *out_info[], diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c index a0f0e9062c4c..0cd6e1da43cf 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c @@ -861,7 +861,7 @@ binary_supports_output_format(const struct ia_css_binary_xinfo *info, #ifdef ISP2401 static bool binary_supports_input_format(const struct ia_css_binary_xinfo *info, - enum ia_css_stream_format format) + enum atomisp_input_format format) { assert(info != NULL); @@ -1088,7 +1088,7 @@ enum ia_css_err ia_css_binary_fill_info(const struct ia_css_binary_xinfo *xinfo, bool online, bool two_ppc, - enum ia_css_stream_format stream_format, + enum atomisp_input_format stream_format, const struct ia_css_frame_info *in_info, /* can be NULL */ const struct ia_css_frame_info *bds_out_info, /* can be NULL */ const struct ia_css_frame_info *out_info[], /* can be NULL */ @@ -1382,7 +1382,7 @@ ia_css_binary_find(struct ia_css_binary_descr *descr, int mode; bool online; bool two_ppc; - enum ia_css_stream_format stream_format; + enum atomisp_input_format stream_format; const struct ia_css_frame_info *req_in_info, *req_bds_out_info, *req_out_info[IA_CSS_BINARY_MAX_OUTPUT_PORTS], diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/bufq/src/bufq.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/bufq/src/bufq.c index e50d9f2e2609..ffbcdd80d934 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/bufq/src/bufq.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/bufq/src/bufq.c @@ -90,12 +90,11 @@ struct sh_css_queues { #endif -struct sh_css_queues css_queues; - - /******************************************************* *** Static variables ********************************************************/ +static struct sh_css_queues css_queues; + static int buffer_type_to_queue_id_map[SH_CSS_MAX_SP_THREADS][IA_CSS_NUM_DYNAMIC_BUFFER_TYPE]; static bool queue_availability[SH_CSS_MAX_SP_THREADS][SH_CSS_MAX_NUM_QUEUES]; @@ -207,7 +206,7 @@ static void map_buffer_type_to_queue_id( } for (i = SH_CSS_QUEUE_C_ID; i < SH_CSS_MAX_NUM_QUEUES; i++) { - if (queue_availability[thread_id][i] == true) { + if (queue_availability[thread_id][i]) { queue_availability[thread_id][i] = false; buffer_type_to_queue_id_map[thread_id][buf_type] = i; break; @@ -266,7 +265,7 @@ static ia_css_queue_t *bufq_get_qhandle( case sh_css_sp2host_isys_event_queue: q = &css_queues.sp2host_isys_event_queue_handle; break; -#endif +#endif case sh_css_host2sp_tag_cmd_queue: q = &css_queues.host2sp_tag_cmd_queue_handle; break; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c index 60395904f89a..4607a76dc78a 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c @@ -110,9 +110,6 @@ /* Global variable to store the dtrace verbosity level */ unsigned int ia_css_debug_trace_level = IA_CSS_DEBUG_WARNING; -/* Assumes that IA_CSS_STREAM_FORMAT_BINARY_8 is last */ -#define N_IA_CSS_STREAM_FORMAT (IA_CSS_STREAM_FORMAT_BINARY_8+1) - #define DPG_START "ia_css_debug_pipe_graph_dump_start " #define DPG_END " ia_css_debug_pipe_graph_dump_end\n" @@ -141,8 +138,8 @@ static struct pipe_graph_class { int width; int eff_height; int eff_width; - enum ia_css_stream_format stream_format; -} pg_inst = {true, 0, 0, 0, 0, N_IA_CSS_STREAM_FORMAT}; + enum atomisp_input_format stream_format; +} pg_inst = {true, 0, 0, 0, 0, N_ATOMISP_INPUT_FORMAT}; static const char * const queue_id_to_str[] = { /* [SH_CSS_QUEUE_A_ID] =*/ "queue_A", @@ -261,86 +258,86 @@ unsigned int ia_css_debug_get_dtrace_level(void) return ia_css_debug_trace_level; } -static const char *debug_stream_format2str(const enum ia_css_stream_format stream_format) +static const char *debug_stream_format2str(const enum atomisp_input_format stream_format) { switch (stream_format) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: return "yuv420-8-legacy"; - case IA_CSS_STREAM_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_8: return "yuv420-8"; - case IA_CSS_STREAM_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_10: return "yuv420-10"; - case IA_CSS_STREAM_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV420_16: return "yuv420-16"; - case IA_CSS_STREAM_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: return "yuv422-8"; - case IA_CSS_STREAM_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_10: return "yuv422-10"; - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV422_16: return "yuv422-16"; - case IA_CSS_STREAM_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_444: return "rgb444"; - case IA_CSS_STREAM_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_555: return "rgb555"; - case IA_CSS_STREAM_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_565: return "rgb565"; - case IA_CSS_STREAM_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_666: return "rgb666"; - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_888: return "rgb888"; - case IA_CSS_STREAM_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_6: return "raw6"; - case IA_CSS_STREAM_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_7: return "raw7"; - case IA_CSS_STREAM_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_8: return "raw8"; - case IA_CSS_STREAM_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_10: return "raw10"; - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_12: return "raw12"; - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_14: return "raw14"; - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_16: return "raw16"; - case IA_CSS_STREAM_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: return "binary8"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT1: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT1: return "generic-short1"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT2: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT2: return "generic-short2"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT3: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT3: return "generic-short3"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT4: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT4: return "generic-short4"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT5: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT5: return "generic-short5"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT6: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT6: return "generic-short6"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT7: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT7: return "generic-short7"; - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT8: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT8: return "generic-short8"; - case IA_CSS_STREAM_FORMAT_YUV420_8_SHIFT: + case ATOMISP_INPUT_FORMAT_YUV420_8_SHIFT: return "yuv420-8-shift"; - case IA_CSS_STREAM_FORMAT_YUV420_10_SHIFT: + case ATOMISP_INPUT_FORMAT_YUV420_10_SHIFT: return "yuv420-10-shift"; - case IA_CSS_STREAM_FORMAT_EMBEDDED: + case ATOMISP_INPUT_FORMAT_EMBEDDED: return "embedded-8"; - case IA_CSS_STREAM_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF1: return "user-def-8-type-1"; - case IA_CSS_STREAM_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF2: return "user-def-8-type-2"; - case IA_CSS_STREAM_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF3: return "user-def-8-type-3"; - case IA_CSS_STREAM_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF4: return "user-def-8-type-4"; - case IA_CSS_STREAM_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF5: return "user-def-8-type-5"; - case IA_CSS_STREAM_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF6: return "user-def-8-type-6"; - case IA_CSS_STREAM_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF7: return "user-def-8-type-7"; - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_USER_DEF8: return "user-def-8-type-8"; default: @@ -2679,9 +2676,9 @@ ia_css_debug_pipe_graph_dump_frame( } dtrace_dot( "node [shape = box, " - "fixedsize=true, width=2, height=0.7]; \"0x%08lx\" " + "fixedsize=true, width=2, height=0.7]; \"%p\" " "[label = \"%s\\n%d(%d) x %d, %dbpp\\n%s\"];", - HOST_ADDRESS(frame), + frame, debug_frame_format2str(frame->info.format), frame->info.res.width, frame->info.padded_width, @@ -2691,16 +2688,16 @@ ia_css_debug_pipe_graph_dump_frame( if (in_frame) { dtrace_dot( - "\"0x%08lx\"->\"%s(pipe%d)\" " + "\"%p\"->\"%s(pipe%d)\" " "[label = %s_frame];", - HOST_ADDRESS(frame), + frame, blob_name, id, frame_name); } else { dtrace_dot( - "\"%s(pipe%d)\"->\"0x%08lx\" " + "\"%s(pipe%d)\"->\"%p\" " "[label = %s_frame];", blob_name, id, - HOST_ADDRESS(frame), + frame, frame_name); } } @@ -2730,7 +2727,7 @@ void ia_css_debug_pipe_graph_dump_epilogue(void) } - if (pg_inst.stream_format != N_IA_CSS_STREAM_FORMAT) { + if (pg_inst.stream_format != N_ATOMISP_INPUT_FORMAT) { /* An input stream format has been set so assume we have * an input system and sensor */ @@ -2770,7 +2767,7 @@ void ia_css_debug_pipe_graph_dump_epilogue(void) pg_inst.height = 0; pg_inst.eff_width = 0; pg_inst.eff_height = 0; - pg_inst.stream_format = N_IA_CSS_STREAM_FORMAT; + pg_inst.stream_format = N_ATOMISP_INPUT_FORMAT; } void @@ -3011,9 +3008,9 @@ ia_css_debug_pipe_graph_dump_sp_raw_copy( snprintf(ring_buffer, sizeof(ring_buffer), "node [shape = box, " - "fixedsize=true, width=2, height=0.7]; \"0x%08lx\" " + "fixedsize=true, width=2, height=0.7]; \"%p\" " "[label = \"%s\\n%d(%d) x %d\\nRingbuffer\"];", - HOST_ADDRESS(out_frame), + out_frame, debug_frame_format2str(out_frame->info.format), out_frame->info.res.width, out_frame->info.padded_width, @@ -3022,9 +3019,9 @@ ia_css_debug_pipe_graph_dump_sp_raw_copy( dtrace_dot(ring_buffer); dtrace_dot( - "\"%s(pipe%d)\"->\"0x%08lx\" " + "\"%s(pipe%d)\"->\"%p\" " "[label = out_frame];", - "sp_raw_copy", 1, HOST_ADDRESS(out_frame)); + "sp_raw_copy", 1, out_frame); snprintf(dot_id_input_bin, sizeof(dot_id_input_bin), "%s(pipe%d)", "sp_raw_copy", 1); } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src/ifmtr.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src/ifmtr.c index adefa57820a4..1bed027435fd 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src/ifmtr.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/ifmtr/src/ifmtr.c @@ -112,13 +112,13 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, width_b_factor = 1, start_column_b, left_padding = 0; input_formatter_cfg_t if_a_config, if_b_config; - enum ia_css_stream_format input_format; + enum atomisp_input_format input_format; enum ia_css_err err = IA_CSS_SUCCESS; uint8_t if_config_index; /* Determine which input formatter config set is targeted. */ /* Index is equal to the CSI-2 port used. */ - enum ia_css_csi2_port port; + enum mipi_port_id port; if (binary) { cropped_height = binary->in_frame_info.res.height; @@ -141,7 +141,7 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, if (config->mode == IA_CSS_INPUT_MODE_SENSOR || config->mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR) { port = config->source.port.port; - if_config_index = (uint8_t) (port - IA_CSS_CSI2_PORT0); + if_config_index = (uint8_t) (port - MIPI_PORT0_ID); } else if (config->mode == IA_CSS_INPUT_MODE_MEMORY) { if_config_index = SH_CSS_IF_CONFIG_NOT_NEEDED; } else { @@ -189,7 +189,7 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, bits_per_pixel = input_formatter_get_alignment(INPUT_FORMATTER0_ID) * 8 / ISP_VEC_NELEMS; switch (input_format) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: if (two_ppc) { vmem_increment = 1; deinterleaving = 1; @@ -219,9 +219,9 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, start_column = start_column * deinterleaving / 2; } break; - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_16: if (two_ppc) { vmem_increment = 1; deinterleaving = 1; @@ -246,9 +246,9 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, start_column *= deinterleaving; } break; - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_16: if (two_ppc) { vmem_increment = 1; deinterleaving = 1; @@ -267,11 +267,11 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, start_column *= deinterleaving; } break; - case IA_CSS_STREAM_FORMAT_RGB_444: - case IA_CSS_STREAM_FORMAT_RGB_555: - case IA_CSS_STREAM_FORMAT_RGB_565: - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_888: num_vectors *= 2; if (two_ppc) { deinterleaving = 2; /* BR in if_a, G in if_b */ @@ -293,11 +293,11 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, num_vectors = num_vectors / 2 * deinterleaving; buf_offset_b = buffer_width / 2 / ISP_VEC_NELEMS; break; - case IA_CSS_STREAM_FORMAT_RAW_6: - case IA_CSS_STREAM_FORMAT_RAW_7: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_RAW_10: - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_12: if (two_ppc) { int crop_col = (start_column % 2) == 1; vmem_increment = 2; @@ -332,8 +332,8 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, vectors_per_line = CEIL_DIV(cropped_width, ISP_VEC_NELEMS); vectors_per_line = CEIL_MUL(vectors_per_line, deinterleaving); break; - case IA_CSS_STREAM_FORMAT_RAW_14: - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_16: if (two_ppc) { num_vectors *= 2; vmem_increment = 1; @@ -350,26 +350,26 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, } buffer_height *= 2; break; - case IA_CSS_STREAM_FORMAT_BINARY_8: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT1: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT2: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT3: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT4: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT5: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT6: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT7: - case IA_CSS_STREAM_FORMAT_GENERIC_SHORT8: - case IA_CSS_STREAM_FORMAT_YUV420_8_SHIFT: - case IA_CSS_STREAM_FORMAT_YUV420_10_SHIFT: - case IA_CSS_STREAM_FORMAT_EMBEDDED: - case IA_CSS_STREAM_FORMAT_USER_DEF1: - case IA_CSS_STREAM_FORMAT_USER_DEF2: - case IA_CSS_STREAM_FORMAT_USER_DEF3: - case IA_CSS_STREAM_FORMAT_USER_DEF4: - case IA_CSS_STREAM_FORMAT_USER_DEF5: - case IA_CSS_STREAM_FORMAT_USER_DEF6: - case IA_CSS_STREAM_FORMAT_USER_DEF7: - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT1: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT2: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT3: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT4: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT5: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT6: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT7: + case ATOMISP_INPUT_FORMAT_GENERIC_SHORT8: + case ATOMISP_INPUT_FORMAT_YUV420_8_SHIFT: + case ATOMISP_INPUT_FORMAT_YUV420_10_SHIFT: + case ATOMISP_INPUT_FORMAT_EMBEDDED: + case ATOMISP_INPUT_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF8: break; } if (width_a == 0) @@ -420,9 +420,9 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, if_a_config.buf_eol_offset = buffer_width * bits_per_pixel / 8 - line_width; if_a_config.is_yuv420_format = - (input_format == IA_CSS_STREAM_FORMAT_YUV420_8) - || (input_format == IA_CSS_STREAM_FORMAT_YUV420_10) - || (input_format == IA_CSS_STREAM_FORMAT_YUV420_16); + (input_format == ATOMISP_INPUT_FORMAT_YUV420_8) + || (input_format == ATOMISP_INPUT_FORMAT_YUV420_10) + || (input_format == ATOMISP_INPUT_FORMAT_YUV420_16); if_a_config.block_no_reqs = (config->mode != IA_CSS_INPUT_MODE_SENSOR); if (two_ppc) { @@ -449,9 +449,9 @@ enum ia_css_err ia_css_ifmtr_configure(struct ia_css_stream_config *config, if_b_config.buf_eol_offset = buffer_width * bits_per_pixel / 8 - line_width; if_b_config.is_yuv420_format = - input_format == IA_CSS_STREAM_FORMAT_YUV420_8 - || input_format == IA_CSS_STREAM_FORMAT_YUV420_10 - || input_format == IA_CSS_STREAM_FORMAT_YUV420_16; + input_format == ATOMISP_INPUT_FORMAT_YUV420_8 + || input_format == ATOMISP_INPUT_FORMAT_YUV420_10 + || input_format == ATOMISP_INPUT_FORMAT_YUV420_16; if_b_config.block_no_reqs = (config->mode != IA_CSS_INPUT_MODE_SENSOR); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/interface/ia_css_inputfifo.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/interface/ia_css_inputfifo.h index 47d0f7e53f47..545f9e2da59e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/interface/ia_css_inputfifo.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/interface/ia_css_inputfifo.h @@ -42,12 +42,12 @@ void ia_css_inputfifo_send_input_frame( unsigned int width, unsigned int height, unsigned int ch_id, - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, bool two_ppc); void ia_css_inputfifo_start_frame( unsigned int ch_id, - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, bool two_ppc); void ia_css_inputfifo_send_line( @@ -59,7 +59,7 @@ void ia_css_inputfifo_send_line( void ia_css_inputfifo_send_embedded_line( unsigned int ch_id, - enum ia_css_stream_format data_type, + enum atomisp_input_format data_type, const unsigned short *data, unsigned int width); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/src/inputfifo.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/src/inputfifo.c index 8dc74927e9a2..24ca4aaf8df1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/src/inputfifo.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/inputfifo/src/inputfifo.c @@ -86,7 +86,7 @@ static unsigned int inputfifo_curr_ch_id, inputfifo_curr_fmt_type; #endif struct inputfifo_instance { unsigned int ch_id; - enum ia_css_stream_format input_format; + enum atomisp_input_format input_format; bool two_ppc; bool streaming; unsigned int hblank_cycles; @@ -466,21 +466,21 @@ static void inputfifo_send_frame( static enum inputfifo_mipi_data_type inputfifo_determine_type( - enum ia_css_stream_format input_format) + enum atomisp_input_format input_format) { enum inputfifo_mipi_data_type type; type = inputfifo_mipi_data_type_regular; - if (input_format == IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY) { + if (input_format == ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY) { type = inputfifo_mipi_data_type_yuv420_legacy; - } else if (input_format == IA_CSS_STREAM_FORMAT_YUV420_8 || - input_format == IA_CSS_STREAM_FORMAT_YUV420_10 || - input_format == IA_CSS_STREAM_FORMAT_YUV420_16) { + } else if (input_format == ATOMISP_INPUT_FORMAT_YUV420_8 || + input_format == ATOMISP_INPUT_FORMAT_YUV420_10 || + input_format == ATOMISP_INPUT_FORMAT_YUV420_16) { type = inputfifo_mipi_data_type_yuv420; - } else if (input_format >= IA_CSS_STREAM_FORMAT_RGB_444 && - input_format <= IA_CSS_STREAM_FORMAT_RGB_888) { + } else if (input_format >= ATOMISP_INPUT_FORMAT_RGB_444 && + input_format <= ATOMISP_INPUT_FORMAT_RGB_888) { type = inputfifo_mipi_data_type_rgb; } @@ -500,7 +500,7 @@ void ia_css_inputfifo_send_input_frame( unsigned int width, unsigned int height, unsigned int ch_id, - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, bool two_ppc) { unsigned int fmt_type, hblank_cycles, marker_cycles; @@ -524,7 +524,7 @@ void ia_css_inputfifo_send_input_frame( void ia_css_inputfifo_start_frame( unsigned int ch_id, - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, bool two_ppc) { struct inputfifo_instance *s2mi; @@ -574,7 +574,7 @@ void ia_css_inputfifo_send_line( void ia_css_inputfifo_send_embedded_line( unsigned int ch_id, - enum ia_css_stream_format data_type, + enum atomisp_input_format data_type, const unsigned short *data, unsigned int width) { diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/interface/ia_css_isys.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/interface/ia_css_isys.h index 4cf2defe9ef0..8c005db9766e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/interface/ia_css_isys.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/interface/ia_css_isys.h @@ -50,8 +50,8 @@ typedef input_system_cfg_t ia_css_isys_descr_t; #if defined(USE_INPUT_SYSTEM_VERSION_2) || defined(USE_INPUT_SYSTEM_VERSION_2401) input_system_error_t ia_css_isys_init(void); void ia_css_isys_uninit(void); -mipi_port_ID_t ia_css_isys_port_to_mipi_port( - enum ia_css_csi2_port api_port); +enum mipi_port_id ia_css_isys_port_to_mipi_port( + enum mipi_port_id api_port); #endif #if defined(USE_INPUT_SYSTEM_VERSION_2401) @@ -68,7 +68,7 @@ mipi_port_ID_t ia_css_isys_port_to_mipi_port( * there is already a stream registered with the same handle */ enum ia_css_err ia_css_isys_csi_rx_register_stream( - enum ia_css_csi2_port port, + enum mipi_port_id port, uint32_t isys_stream_id); /** @@ -83,14 +83,14 @@ enum ia_css_err ia_css_isys_csi_rx_register_stream( * there is no stream registered with that handle */ enum ia_css_err ia_css_isys_csi_rx_unregister_stream( - enum ia_css_csi2_port port, + enum mipi_port_id port, uint32_t isys_stream_id); enum ia_css_err ia_css_isys_convert_compressed_format( struct ia_css_csi2_compression *comp, struct input_system_cfg_s *cfg); unsigned int ia_css_csi2_calculate_input_system_alignment( - enum ia_css_stream_format fmt_type); + enum atomisp_input_format fmt_type); #endif #if !defined(USE_INPUT_SYSTEM_VERSION_2401) @@ -101,12 +101,12 @@ void ia_css_isys_rx_configure( void ia_css_isys_rx_disable(void); -void ia_css_isys_rx_enable_all_interrupts(mipi_port_ID_t port); +void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port); -unsigned int ia_css_isys_rx_get_interrupt_reg(mipi_port_ID_t port); -void ia_css_isys_rx_get_irq_info(mipi_port_ID_t port, +unsigned int ia_css_isys_rx_get_interrupt_reg(enum mipi_port_id port); +void ia_css_isys_rx_get_irq_info(enum mipi_port_id port, unsigned int *irq_infos); -void ia_css_isys_rx_clear_irq_info(mipi_port_ID_t port, +void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port, unsigned int irq_infos); unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits); @@ -124,7 +124,7 @@ unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits); * format type must be sumitted correctly by the application. */ enum ia_css_err ia_css_isys_convert_stream_format_to_mipi_format( - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, mipi_predictor_t compression, unsigned int *fmt_type); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/csi_rx_rmgr.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/csi_rx_rmgr.c index 3b04dc51335a..a914ce5532ec 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/csi_rx_rmgr.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/csi_rx_rmgr.c @@ -141,7 +141,7 @@ void ia_css_isys_csi_rx_lut_rmgr_release( } enum ia_css_err ia_css_isys_csi_rx_register_stream( - enum ia_css_csi2_port port, + enum mipi_port_id port, uint32_t isys_stream_id) { enum ia_css_err retval = IA_CSS_ERR_INTERNAL_ERROR; @@ -160,7 +160,7 @@ enum ia_css_err ia_css_isys_csi_rx_register_stream( } enum ia_css_err ia_css_isys_csi_rx_unregister_stream( - enum ia_css_csi2_port port, + enum mipi_port_id port, uint32_t isys_stream_id) { enum ia_css_err retval = IA_CSS_ERR_INTERNAL_ERROR; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/isys_init.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/isys_init.c index 4122084fd237..2ae5e59d5e31 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/isys_init.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/isys_init.c @@ -105,8 +105,6 @@ input_system_error_t ia_css_isys_init(void) #elif defined(USE_INPUT_SYSTEM_VERSION_2401) input_system_error_t ia_css_isys_init(void) { - input_system_error_t error = INPUT_SYSTEM_ERR_NO_ERROR; - ia_css_isys_csi_rx_lut_rmgr_init(); ia_css_isys_ibuf_rmgr_init(); ia_css_isys_dma_channel_rmgr_init(); @@ -120,7 +118,7 @@ input_system_error_t ia_css_isys_init(void) isys_irqc_status_enable(ISYS_IRQ1_ID); isys_irqc_status_enable(ISYS_IRQ2_ID); - return error; + return INPUT_SYSTEM_ERR_NO_ERROR; } #endif diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/rx.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/rx.c index 70f6cb5e5918..425bd3cc3f34 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/rx.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/rx.c @@ -36,7 +36,7 @@ more details. #include "sh_css_internal.h" #if !defined(USE_INPUT_SYSTEM_VERSION_2401) -void ia_css_isys_rx_enable_all_interrupts(mipi_port_ID_t port) +void ia_css_isys_rx_enable_all_interrupts(enum mipi_port_id port) { hrt_data bits = receiver_port_reg_load(RX0_ID, port, @@ -80,22 +80,22 @@ void ia_css_isys_rx_enable_all_interrupts(mipi_port_ID_t port) * initializers in Windows. Without that there is no easy way to guarantee * that the array values would be in the correct order. * */ -mipi_port_ID_t ia_css_isys_port_to_mipi_port(enum ia_css_csi2_port api_port) +enum mipi_port_id ia_css_isys_port_to_mipi_port(enum mipi_port_id api_port) { /* In this module the validity of the inptu variable should * have been checked already, so we do not check for erroneous * values. */ - mipi_port_ID_t port = MIPI_PORT0_ID; + enum mipi_port_id port = MIPI_PORT0_ID; - if (api_port == IA_CSS_CSI2_PORT1) + if (api_port == MIPI_PORT1_ID) port = MIPI_PORT1_ID; - else if (api_port == IA_CSS_CSI2_PORT2) + else if (api_port == MIPI_PORT2_ID) port = MIPI_PORT2_ID; return port; } -unsigned int ia_css_isys_rx_get_interrupt_reg(mipi_port_ID_t port) +unsigned int ia_css_isys_rx_get_interrupt_reg(enum mipi_port_id port) { return receiver_port_reg_load(RX0_ID, port, @@ -104,17 +104,17 @@ unsigned int ia_css_isys_rx_get_interrupt_reg(mipi_port_ID_t port) void ia_css_rx_get_irq_info(unsigned int *irq_infos) { - ia_css_rx_port_get_irq_info(IA_CSS_CSI2_PORT1, irq_infos); + ia_css_rx_port_get_irq_info(MIPI_PORT1_ID, irq_infos); } -void ia_css_rx_port_get_irq_info(enum ia_css_csi2_port api_port, +void ia_css_rx_port_get_irq_info(enum mipi_port_id api_port, unsigned int *irq_infos) { - mipi_port_ID_t port = ia_css_isys_port_to_mipi_port(api_port); + enum mipi_port_id port = ia_css_isys_port_to_mipi_port(api_port); ia_css_isys_rx_get_irq_info(port, irq_infos); } -void ia_css_isys_rx_get_irq_info(mipi_port_ID_t port, +void ia_css_isys_rx_get_irq_info(enum mipi_port_id port, unsigned int *irq_infos) { unsigned int bits; @@ -169,16 +169,16 @@ unsigned int ia_css_isys_rx_translate_irq_infos(unsigned int bits) void ia_css_rx_clear_irq_info(unsigned int irq_infos) { - ia_css_rx_port_clear_irq_info(IA_CSS_CSI2_PORT1, irq_infos); + ia_css_rx_port_clear_irq_info(MIPI_PORT1_ID, irq_infos); } -void ia_css_rx_port_clear_irq_info(enum ia_css_csi2_port api_port, unsigned int irq_infos) +void ia_css_rx_port_clear_irq_info(enum mipi_port_id api_port, unsigned int irq_infos) { - mipi_port_ID_t port = ia_css_isys_port_to_mipi_port(api_port); + enum mipi_port_id port = ia_css_isys_port_to_mipi_port(api_port); ia_css_isys_rx_clear_irq_info(port, irq_infos); } -void ia_css_isys_rx_clear_irq_info(mipi_port_ID_t port, unsigned int irq_infos) +void ia_css_isys_rx_clear_irq_info(enum mipi_port_id port, unsigned int irq_infos) { hrt_data bits = receiver_port_reg_load(RX0_ID, port, @@ -229,7 +229,7 @@ void ia_css_isys_rx_clear_irq_info(mipi_port_ID_t port, unsigned int irq_infos) #endif /* #if !defined(USE_INPUT_SYSTEM_VERSION_2401) */ enum ia_css_err ia_css_isys_convert_stream_format_to_mipi_format( - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, mipi_predictor_t compression, unsigned int *fmt_type) { @@ -244,25 +244,25 @@ enum ia_css_err ia_css_isys_convert_stream_format_to_mipi_format( */ if (compression != MIPI_PREDICTOR_NONE) { switch (input_format) { - case IA_CSS_STREAM_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_6: *fmt_type = 6; break; - case IA_CSS_STREAM_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_7: *fmt_type = 7; break; - case IA_CSS_STREAM_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_8: *fmt_type = 8; break; - case IA_CSS_STREAM_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_10: *fmt_type = 10; break; - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_12: *fmt_type = 12; break; - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_14: *fmt_type = 14; break; - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_16: *fmt_type = 16; break; default: @@ -277,96 +277,96 @@ enum ia_css_err ia_css_isys_convert_stream_format_to_mipi_format( * MW: For some reason the mapping is not 1-to-1 */ switch (input_format) { - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_888: *fmt_type = MIPI_FORMAT_RGB888; break; - case IA_CSS_STREAM_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_555: *fmt_type = MIPI_FORMAT_RGB555; break; - case IA_CSS_STREAM_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_444: *fmt_type = MIPI_FORMAT_RGB444; break; - case IA_CSS_STREAM_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_565: *fmt_type = MIPI_FORMAT_RGB565; break; - case IA_CSS_STREAM_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_666: *fmt_type = MIPI_FORMAT_RGB666; break; - case IA_CSS_STREAM_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_8: *fmt_type = MIPI_FORMAT_RAW8; break; - case IA_CSS_STREAM_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_10: *fmt_type = MIPI_FORMAT_RAW10; break; - case IA_CSS_STREAM_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_6: *fmt_type = MIPI_FORMAT_RAW6; break; - case IA_CSS_STREAM_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_7: *fmt_type = MIPI_FORMAT_RAW7; break; - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_12: *fmt_type = MIPI_FORMAT_RAW12; break; - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_14: *fmt_type = MIPI_FORMAT_RAW14; break; - case IA_CSS_STREAM_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_8: *fmt_type = MIPI_FORMAT_YUV420_8; break; - case IA_CSS_STREAM_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_10: *fmt_type = MIPI_FORMAT_YUV420_10; break; - case IA_CSS_STREAM_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: *fmt_type = MIPI_FORMAT_YUV422_8; break; - case IA_CSS_STREAM_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_10: *fmt_type = MIPI_FORMAT_YUV422_10; break; - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: *fmt_type = MIPI_FORMAT_YUV420_8_LEGACY; break; - case IA_CSS_STREAM_FORMAT_EMBEDDED: + case ATOMISP_INPUT_FORMAT_EMBEDDED: *fmt_type = MIPI_FORMAT_EMBEDDED; break; #ifndef USE_INPUT_SYSTEM_VERSION_2401 - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_16: /* This is not specified by Arasan, so we use * 17 for now. */ *fmt_type = MIPI_FORMAT_RAW16; break; - case IA_CSS_STREAM_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: *fmt_type = MIPI_FORMAT_BINARY_8; break; #else - case IA_CSS_STREAM_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF1: *fmt_type = MIPI_FORMAT_CUSTOM0; break; - case IA_CSS_STREAM_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF2: *fmt_type = MIPI_FORMAT_CUSTOM1; break; - case IA_CSS_STREAM_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF3: *fmt_type = MIPI_FORMAT_CUSTOM2; break; - case IA_CSS_STREAM_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF4: *fmt_type = MIPI_FORMAT_CUSTOM3; break; - case IA_CSS_STREAM_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF5: *fmt_type = MIPI_FORMAT_CUSTOM4; break; - case IA_CSS_STREAM_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF6: *fmt_type = MIPI_FORMAT_CUSTOM5; break; - case IA_CSS_STREAM_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF7: *fmt_type = MIPI_FORMAT_CUSTOM6; break; - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_USER_DEF8: *fmt_type = MIPI_FORMAT_CUSTOM7; break; #endif - case IA_CSS_STREAM_FORMAT_YUV420_16: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV422_16: default: return IA_CSS_ERR_INTERNAL_ERROR; } @@ -448,34 +448,34 @@ enum ia_css_err ia_css_isys_convert_compressed_format( } unsigned int ia_css_csi2_calculate_input_system_alignment( - enum ia_css_stream_format fmt_type) + enum atomisp_input_format fmt_type) { unsigned int memory_alignment_in_bytes = HIVE_ISP_DDR_WORD_BYTES; switch (fmt_type) { - case IA_CSS_STREAM_FORMAT_RAW_6: - case IA_CSS_STREAM_FORMAT_RAW_7: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_RAW_10: - case IA_CSS_STREAM_FORMAT_RAW_12: - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_14: memory_alignment_in_bytes = 2 * ISP_VEC_NELEMS; break; - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_USER_DEF1: - case IA_CSS_STREAM_FORMAT_USER_DEF2: - case IA_CSS_STREAM_FORMAT_USER_DEF3: - case IA_CSS_STREAM_FORMAT_USER_DEF4: - case IA_CSS_STREAM_FORMAT_USER_DEF5: - case IA_CSS_STREAM_FORMAT_USER_DEF6: - case IA_CSS_STREAM_FORMAT_USER_DEF7: - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF8: /* Planar YUV formats need to have all planes aligned, this means * double the alignment for the Y plane if the horizontal decimation is 2. */ memory_alignment_in_bytes = 2 * HIVE_ISP_DDR_WORD_BYTES; break; - case IA_CSS_STREAM_FORMAT_EMBEDDED: + case ATOMISP_INPUT_FORMAT_EMBEDDED: default: memory_alignment_in_bytes = HIVE_ISP_DDR_WORD_BYTES; break; @@ -492,7 +492,7 @@ void ia_css_isys_rx_configure(const rx_cfg_t *config, #if defined(HAS_RX_VERSION_2) bool port_enabled[N_MIPI_PORT_ID]; bool any_port_enabled = false; - mipi_port_ID_t port; + enum mipi_port_id port; if ((config == NULL) || (config->mode >= N_RX_MODE) @@ -500,7 +500,7 @@ void ia_css_isys_rx_configure(const rx_cfg_t *config, assert(0); return; } - for (port = (mipi_port_ID_t) 0; port < N_MIPI_PORT_ID; port++) { + for (port = (enum mipi_port_id) 0; port < N_MIPI_PORT_ID; port++) { if (is_receiver_port_enabled(RX0_ID, port)) any_port_enabled = true; } @@ -595,8 +595,8 @@ void ia_css_isys_rx_configure(const rx_cfg_t *config, void ia_css_isys_rx_disable(void) { - mipi_port_ID_t port; - for (port = (mipi_port_ID_t) 0; port < N_MIPI_PORT_ID; port++) { + enum mipi_port_id port; + for (port = (enum mipi_port_id) 0; port < N_MIPI_PORT_ID; port++) { receiver_port_reg_store(RX0_ID, port, _HRT_CSS_RECEIVER_DEVICE_READY_REG_IDX, false); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c index 90922a7acefd..2484949453b7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c @@ -331,7 +331,7 @@ static bool create_input_system_channel( break; } - if (rc == false) + if (!rc) return false; if (!acquire_sid(me->stream2mmio_id, &(me->stream2mmio_sid_id))) { @@ -474,7 +474,7 @@ static bool calculate_input_system_channel_cfg( rc = calculate_stream2mmio_cfg(isys_cfg, metadata, &(channel_cfg->stream2mmio_cfg)); - if (rc == false) + if (!rc) return false; rc = calculate_ibuf_ctrl_cfg( @@ -482,7 +482,7 @@ static bool calculate_input_system_channel_cfg( input_port, isys_cfg, &(channel_cfg->ibuf_ctrl_cfg)); - if (rc == false) + if (!rc) return false; if (metadata) channel_cfg->ibuf_ctrl_cfg.stores_per_frame = isys_cfg->metadata.lines_per_frame; @@ -491,7 +491,7 @@ static bool calculate_input_system_channel_cfg( channel, isys_cfg, &(channel_cfg->dma_cfg)); - if (rc == false) + if (!rc) return false; rc = calculate_isys2401_dma_port_cfg( @@ -499,7 +499,7 @@ static bool calculate_input_system_channel_cfg( false, metadata, &(channel_cfg->dma_src_port_cfg)); - if (rc == false) + if (!rc) return false; rc = calculate_isys2401_dma_port_cfg( @@ -507,7 +507,7 @@ static bool calculate_input_system_channel_cfg( isys_cfg->raw_packed, metadata, &(channel_cfg->dma_dest_port_cfg)); - if (rc == false) + if (!rc) return false; return true; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c index 81a50c73ad0b..4746620ca212 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/pipeline/src/pipeline.c @@ -161,9 +161,9 @@ void ia_css_pipeline_start(enum ia_css_pipe_id pipe_id, #endif #if !defined(HAS_NO_INPUT_SYSTEM) #ifndef ISP2401 - , (mipi_port_ID_t) 0 + , (enum mipi_port_id) 0 #else - (mipi_port_ID_t) 0, + (enum mipi_port_id) 0, #endif #endif #ifndef ISP2401 @@ -574,7 +574,7 @@ static void pipeline_map_num_to_sp_thread(unsigned int pipe_num) But the below is more descriptive. */ - assert(found_sp_thread != false); + assert(found_sp_thread); } static void pipeline_unmap_num_to_sp_thread(unsigned int pipe_num) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c index 54239ac9d7c9..a4d8a48f95ba 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/rmgr/src/rmgr_vbuf.c @@ -24,12 +24,12 @@ * @brief VBUF resource handles */ #define NUM_HANDLES 1000 -struct ia_css_rmgr_vbuf_handle handle_table[NUM_HANDLES]; +static struct ia_css_rmgr_vbuf_handle handle_table[NUM_HANDLES]; /* * @brief VBUF resource pool - refpool */ -struct ia_css_rmgr_vbuf_pool refpool = { +static struct ia_css_rmgr_vbuf_pool refpool = { false, /* copy_on_write */ false, /* recycle */ 0, /* size */ @@ -40,7 +40,7 @@ struct ia_css_rmgr_vbuf_pool refpool = { /* * @brief VBUF resource pool - writepool */ -struct ia_css_rmgr_vbuf_pool writepool = { +static struct ia_css_rmgr_vbuf_pool writepool = { true, /* copy_on_write */ false, /* recycle */ 0, /* size */ @@ -51,7 +51,7 @@ struct ia_css_rmgr_vbuf_pool writepool = { /* * @brief VBUF resource pool - hmmbufferpool */ -struct ia_css_rmgr_vbuf_pool hmmbufferpool = { +static struct ia_css_rmgr_vbuf_pool hmmbufferpool = { true, /* copy_on_write */ true, /* recycle */ 32, /* size */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c index 37116faab631..c771e4b910f3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c @@ -462,46 +462,46 @@ verify_copy_out_frame_format(struct ia_css_pipe *pipe) assert(pipe->stream != NULL); switch (pipe->stream->config.input_config.format) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: - case IA_CSS_STREAM_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8: for (i=0; i<ARRAY_SIZE(yuv420_copy_formats) && !found; i++) found = (out_fmt == yuv420_copy_formats[i]); break; - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_16: found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16); break; - case IA_CSS_STREAM_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: for (i=0; i<ARRAY_SIZE(yuv422_copy_formats) && !found; i++) found = (out_fmt == yuv422_copy_formats[i]); break; - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_16: found = (out_fmt == IA_CSS_FRAME_FORMAT_YUV422_16 || out_fmt == IA_CSS_FRAME_FORMAT_YUV420_16); break; - case IA_CSS_STREAM_FORMAT_RGB_444: - case IA_CSS_STREAM_FORMAT_RGB_555: - case IA_CSS_STREAM_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_565: found = (out_fmt == IA_CSS_FRAME_FORMAT_RGBA888 || out_fmt == IA_CSS_FRAME_FORMAT_RGB565); break; - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_888: found = (out_fmt == IA_CSS_FRAME_FORMAT_RGBA888 || out_fmt == IA_CSS_FRAME_FORMAT_YUV420); break; - case IA_CSS_STREAM_FORMAT_RAW_6: - case IA_CSS_STREAM_FORMAT_RAW_7: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_RAW_10: - case IA_CSS_STREAM_FORMAT_RAW_12: - case IA_CSS_STREAM_FORMAT_RAW_14: - case IA_CSS_STREAM_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_16: found = (out_fmt == IA_CSS_FRAME_FORMAT_RAW) || (out_fmt == IA_CSS_FRAME_FORMAT_RAW_PACKED); break; - case IA_CSS_STREAM_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: found = (out_fmt == IA_CSS_FRAME_FORMAT_BINARY_8); break; default: @@ -586,13 +586,13 @@ sh_css_config_input_network(struct ia_css_stream *stream) } #elif !defined(HAS_NO_INPUT_SYSTEM) && defined(USE_INPUT_SYSTEM_VERSION_2401) static unsigned int csi2_protocol_calculate_max_subpixels_per_line( - enum ia_css_stream_format format, + enum atomisp_input_format format, unsigned int pixels_per_line) { unsigned int rval; switch (format) { - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: /* * The frame format layout is shown below. * @@ -611,9 +611,9 @@ static unsigned int csi2_protocol_calculate_max_subpixels_per_line( */ rval = pixels_per_line * 2; break; - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV420_16: /* * The frame format layout is shown below. * @@ -630,9 +630,9 @@ static unsigned int csi2_protocol_calculate_max_subpixels_per_line( */ rval = pixels_per_line * 2; break; - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_YUV422_16: /* * The frame format layout is shown below. * @@ -649,11 +649,11 @@ static unsigned int csi2_protocol_calculate_max_subpixels_per_line( */ rval = pixels_per_line * 2; break; - case IA_CSS_STREAM_FORMAT_RGB_444: - case IA_CSS_STREAM_FORMAT_RGB_555: - case IA_CSS_STREAM_FORMAT_RGB_565: - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RGB_888: /* * The frame format layout is shown below. * @@ -670,22 +670,22 @@ static unsigned int csi2_protocol_calculate_max_subpixels_per_line( */ rval = pixels_per_line * 4; break; - case IA_CSS_STREAM_FORMAT_RAW_6: - case IA_CSS_STREAM_FORMAT_RAW_7: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_RAW_10: - case IA_CSS_STREAM_FORMAT_RAW_12: - case IA_CSS_STREAM_FORMAT_RAW_14: - case IA_CSS_STREAM_FORMAT_RAW_16: - case IA_CSS_STREAM_FORMAT_BINARY_8: - case IA_CSS_STREAM_FORMAT_USER_DEF1: - case IA_CSS_STREAM_FORMAT_USER_DEF2: - case IA_CSS_STREAM_FORMAT_USER_DEF3: - case IA_CSS_STREAM_FORMAT_USER_DEF4: - case IA_CSS_STREAM_FORMAT_USER_DEF5: - case IA_CSS_STREAM_FORMAT_USER_DEF6: - case IA_CSS_STREAM_FORMAT_USER_DEF7: - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF8: /* * The frame format layout is shown below. * @@ -742,11 +742,11 @@ static bool sh_css_translate_stream_cfg_to_input_system_input_port_id( break; case IA_CSS_INPUT_MODE_BUFFERED_SENSOR: - if (stream_cfg->source.port.port == IA_CSS_CSI2_PORT0) { + if (stream_cfg->source.port.port == MIPI_PORT0_ID) { isys_stream_descr->input_port_id = INPUT_SYSTEM_CSI_PORT0_ID; - } else if (stream_cfg->source.port.port == IA_CSS_CSI2_PORT1) { + } else if (stream_cfg->source.port.port == MIPI_PORT1_ID) { isys_stream_descr->input_port_id = INPUT_SYSTEM_CSI_PORT1_ID; - } else if (stream_cfg->source.port.port == IA_CSS_CSI2_PORT2) { + } else if (stream_cfg->source.port.port == MIPI_PORT2_ID) { isys_stream_descr->input_port_id = INPUT_SYSTEM_CSI_PORT2_ID; } @@ -927,7 +927,7 @@ static bool sh_css_translate_stream_cfg_to_input_system_input_port_resolution( unsigned int max_subpixels_per_line; unsigned int lines_per_frame; unsigned int align_req_in_bytes; - enum ia_css_stream_format fmt_type; + enum atomisp_input_format fmt_type; fmt_type = stream_cfg->isys_config[isys_stream_idx].format; if ((stream_cfg->mode == IA_CSS_INPUT_MODE_SENSOR || @@ -936,11 +936,11 @@ static bool sh_css_translate_stream_cfg_to_input_system_input_port_resolution( if (stream_cfg->source.port.compression.uncompressed_bits_per_pixel == UNCOMPRESSED_BITS_PER_PIXEL_10) { - fmt_type = IA_CSS_STREAM_FORMAT_RAW_10; + fmt_type = ATOMISP_INPUT_FORMAT_RAW_10; } else if (stream_cfg->source.port.compression.uncompressed_bits_per_pixel == UNCOMPRESSED_BITS_PER_PIXEL_12) { - fmt_type = IA_CSS_STREAM_FORMAT_RAW_12; + fmt_type = ATOMISP_INPUT_FORMAT_RAW_12; } else return false; @@ -1082,7 +1082,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) /* get the SP thread id */ rc = ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &sp_thread_id); - if (rc != true) + if (!rc) return IA_CSS_ERR_INTERNAL_ERROR; /* get the target input terminal */ sp_pipeline_input_terminal = &(sh_css_sp_group.pipe_io[sp_thread_id].input); @@ -1108,7 +1108,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) &(isys_stream_descr)); } - if (rc != true) + if (!rc) return IA_CSS_ERR_INTERNAL_ERROR; isys_stream_id = ia_css_isys_generate_stream_id(sp_thread_id, i); @@ -1118,7 +1118,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) &(isys_stream_descr), &(sp_pipeline_input_terminal->context.virtual_input_system_stream[i]), isys_stream_id); - if (rc != true) + if (!rc) return IA_CSS_ERR_INTERNAL_ERROR; /* calculate the configuration of the virtual Input System (2401) */ @@ -1126,7 +1126,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) &(sp_pipeline_input_terminal->context.virtual_input_system_stream[i]), &(isys_stream_descr), &(sp_pipeline_input_terminal->ctrl.virtual_input_system_stream_cfg[i])); - if (rc != true) { + if (!rc) { ia_css_isys_stream_destroy(&(sp_pipeline_input_terminal->context.virtual_input_system_stream[i])); return IA_CSS_ERR_INTERNAL_ERROR; } @@ -1195,7 +1195,7 @@ static inline struct ia_css_pipe *stream_get_target_pipe( static enum ia_css_err stream_csi_rx_helper( struct ia_css_stream *stream, - enum ia_css_err (*func)(enum ia_css_csi2_port, uint32_t)) + enum ia_css_err (*func)(enum mipi_port_id, uint32_t)) { enum ia_css_err retval = IA_CSS_ERR_INTERNAL_ERROR; uint32_t sp_thread_id, stream_id; @@ -1391,7 +1391,7 @@ start_copy_on_sp(struct ia_css_pipe *pipe, ia_css_isys_rx_disable(); #endif - if (pipe->stream->config.input_config.format != IA_CSS_STREAM_FORMAT_BINARY_8) + if (pipe->stream->config.input_config.format != ATOMISP_INPUT_FORMAT_BINARY_8) return IA_CSS_ERR_INTERNAL_ERROR; sh_css_sp_start_binary_copy(ia_css_pipe_get_pipe_num(pipe), out_frame, pipe->stream->config.pixels_per_clock == 2); @@ -1454,7 +1454,7 @@ static void start_pipe( &me->stream->info.metadata_info #if !defined(HAS_NO_INPUT_SYSTEM) ,(input_mode==IA_CSS_INPUT_MODE_MEMORY) ? - (mipi_port_ID_t)0 : + (enum mipi_port_id)0 : me->stream->config.source.port.port #endif #ifdef ISP2401 @@ -1497,7 +1497,7 @@ static void enable_interrupts(enum ia_css_irq_type irq_type) { #ifdef USE_INPUT_SYSTEM_VERSION_2 - mipi_port_ID_t port; + enum mipi_port_id port; #endif bool enable_pulse = irq_type != IA_CSS_IRQ_TYPE_EDGE; IA_CSS_ENTER_PRIVATE(""); @@ -2562,7 +2562,7 @@ ia_css_uninit(void) ifmtr_set_if_blocking_mode_reset = true; #endif - if (fw_explicitly_loaded == false) { + if (!fw_explicitly_loaded) { ia_css_unload_firmware(); } ia_css_spctrl_unload_fw(SP0_ID); @@ -4074,9 +4074,9 @@ preview_start(struct ia_css_pipe *pipe) #endif #if !defined(HAS_NO_INPUT_SYSTEM) #ifndef ISP2401 - , (mipi_port_ID_t)0 + , (enum mipi_port_id)0 #else - (mipi_port_ID_t)0, + (enum mipi_port_id)0, #endif #endif #ifndef ISP2401 @@ -4106,9 +4106,9 @@ preview_start(struct ia_css_pipe *pipe) #endif #if !defined(HAS_NO_INPUT_SYSTEM) #ifndef ISP2401 - , (mipi_port_ID_t) 0 + , (enum mipi_port_id) 0 #else - (mipi_port_ID_t) 0, + (enum mipi_port_id) 0, #endif #endif #ifndef ISP2401 @@ -4673,7 +4673,7 @@ ia_css_dequeue_psys_event(struct ia_css_event *event) event->type = convert_event_sp_to_host_domain[payload[0]]; /* Some sane default values since not all events use all fields. */ event->pipe = NULL; - event->port = IA_CSS_CSI2_PORT0; + event->port = MIPI_PORT0_ID; event->exp_id = 0; event->fw_warning = IA_CSS_FW_WARNING_NONE; event->fw_handle = 0; @@ -4719,7 +4719,7 @@ ia_css_dequeue_psys_event(struct ia_css_event *event) } } if (event->type == IA_CSS_EVENT_TYPE_PORT_EOF) { - event->port = (enum ia_css_csi2_port)payload[1]; + event->port = (enum mipi_port_id)payload[1]; event->exp_id = payload[3]; } else if (event->type == IA_CSS_EVENT_TYPE_FW_WARNING) { event->fw_warning = (enum ia_css_fw_warning)payload[1]; @@ -5949,9 +5949,9 @@ static enum ia_css_err video_start(struct ia_css_pipe *pipe) #endif #if !defined(HAS_NO_INPUT_SYSTEM) #ifndef ISP2401 - , (mipi_port_ID_t)0 + , (enum mipi_port_id)0 #else - (mipi_port_ID_t)0, + (enum mipi_port_id)0, #endif #endif #ifndef ISP2401 @@ -6784,7 +6784,7 @@ static bool copy_on_sp(struct ia_css_pipe *pipe) rval &= (pipe->config.default_capture_config.mode == IA_CSS_CAPTURE_MODE_RAW); - rval &= ((pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_BINARY_8) || + rval &= ((pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8) || (pipe->config.mode == IA_CSS_PIPE_MODE_COPY)); return rval; @@ -6817,7 +6817,7 @@ static enum ia_css_err load_capture_binaries( return err; } if (copy_on_sp(pipe) && - pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_BINARY_8) { + pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8) { ia_css_frame_info_init( &pipe->output_info[0], JPEG_BYTES, @@ -6915,7 +6915,7 @@ need_yuv_scaler_stage(const struct ia_css_pipe *pipe) /* TODO: make generic function */ need_format_conversion = - ((pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY) && + ((pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY) && (pipe->output_info[0].format != IA_CSS_FRAME_FORMAT_CSI_MIPI_LEGACY_YUV420_8)); in_res = pipe->config.input_effective_res; @@ -7304,7 +7304,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) /* * NOTES * - Why does the "yuvpp" pipe needs "isp_copy_binary" (i.e. ISP Copy) when - * its input is "IA_CSS_STREAM_FORMAT_YUV422_8"? + * its input is "ATOMISP_INPUT_FORMAT_YUV422_8"? * * In most use cases, the first stage in the "yuvpp" pipe is the "yuv_scale_ * binary". However, the "yuv_scale_binary" does NOT support the input-frame @@ -7319,7 +7319,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) * "yuv_scale_binary". */ need_isp_copy_binary = - (pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_YUV422_8); + (pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_YUV422_8); #else /* !USE_INPUT_SYSTEM_VERSION_2401 */ need_isp_copy_binary = true; #endif /* USE_INPUT_SYSTEM_VERSION_2401 */ @@ -7627,11 +7627,11 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe) * Bayer-Quad RAW. */ int in_frame_format; - if (pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY) { + if (pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY) { in_frame_format = IA_CSS_FRAME_FORMAT_CSI_MIPI_LEGACY_YUV420_8; - } else if (pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_YUV422_8) { + } else if (pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_YUV422_8) { /* - * When the sensor output frame format is "IA_CSS_STREAM_FORMAT_YUV422_8", + * When the sensor output frame format is "ATOMISP_INPUT_FORMAT_YUV422_8", * the "isp_copy_var" binary is selected as the first stage in the yuvpp * pipe. * @@ -7739,7 +7739,7 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe) for (i = 0, j = 0; i < num_stage; i++) { assert(j < num_output_stage); - if (pipe->pipe_settings.yuvpp.is_output_stage[i] == true) { + if (pipe->pipe_settings.yuvpp.is_output_stage[i]) { tmp_out_frame = out_frame[j]; tmp_vf_frame = vf_frame[j]; } else { @@ -7758,7 +7758,7 @@ create_host_yuvpp_pipeline(struct ia_css_pipe *pipe) } /* we use output port 1 as internal output port */ tmp_in_frame = yuv_scaler_stage->args.out_frame[1]; - if (pipe->pipe_settings.yuvpp.is_output_stage[i] == true) { + if (pipe->pipe_settings.yuvpp.is_output_stage[i]) { if (tmp_vf_frame && (tmp_vf_frame->info.res.width != 0)) { in_frame = yuv_scaler_stage->args.out_vf_frame; err = add_vf_pp_stage(pipe, in_frame, tmp_vf_frame, &vf_pp_binary[j], @@ -7812,7 +7812,7 @@ create_host_copy_pipeline(struct ia_css_pipe *pipe, out_frame->flash_state = IA_CSS_FRAME_FLASH_STATE_NONE; if (copy_on_sp(pipe) && - pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_BINARY_8) { + pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8) { ia_css_frame_info_init( &out_frame->info, JPEG_BYTES, @@ -8044,7 +8044,6 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe) } if (mode == IA_CSS_CAPTURE_MODE_PRIMARY) { - unsigned int frm; struct ia_css_frame *local_in_frame = NULL; struct ia_css_frame *local_out_frame = NULL; @@ -8082,7 +8081,6 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe) return err; } } - (void)frm; /* If we use copy iso primary, the input must be yuv iso raw */ current_stage->args.copy_vf = @@ -8321,8 +8319,6 @@ sh_css_pipe_get_output_frame_info(struct ia_css_pipe *pipe, struct ia_css_frame_info *info, unsigned int idx) { - enum ia_css_err err = IA_CSS_SUCCESS; - assert(pipe != NULL); assert(info != NULL); @@ -8331,7 +8327,7 @@ sh_css_pipe_get_output_frame_info(struct ia_css_pipe *pipe, *info = pipe->output_info[idx]; if (copy_on_sp(pipe) && - pipe->stream->config.input_config.format == IA_CSS_STREAM_FORMAT_BINARY_8) { + pipe->stream->config.input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8) { ia_css_frame_info_init( info, JPEG_BYTES, @@ -8347,7 +8343,7 @@ sh_css_pipe_get_output_frame_info(struct ia_css_pipe *pipe, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, "sh_css_pipe_get_output_frame_info() leave:\n"); - return err; + return IA_CSS_SUCCESS; } #if !defined(HAS_NO_INPUT_SYSTEM) @@ -8392,7 +8388,7 @@ ia_css_stream_send_input_line(const struct ia_css_stream *stream, void ia_css_stream_send_input_embedded_line(const struct ia_css_stream *stream, - enum ia_css_stream_format format, + enum atomisp_input_format format, const unsigned short *data, unsigned int width) { @@ -9176,7 +9172,7 @@ ia_css_stream_configure_rx(struct ia_css_stream *stream) else if (config->num_lanes != 0) return IA_CSS_ERR_INVALID_ARGUMENTS; - if (config->port > IA_CSS_CSI2_PORT2) + if (config->port > MIPI_PORT2_ID) return IA_CSS_ERR_INVALID_ARGUMENTS; stream->csi_rx_config.port = ia_css_isys_port_to_mipi_port(config->port); @@ -9363,7 +9359,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, #if defined(USE_INPUT_SYSTEM_VERSION_2) /* We don't support metadata for JPEG stream, since they both use str2mem */ - if (stream_config->input_config.format == IA_CSS_STREAM_FORMAT_BINARY_8 && + if (stream_config->input_config.format == ATOMISP_INPUT_FORMAT_BINARY_8 && stream_config->metadata_config.resolution.height > 0) { err = IA_CSS_ERR_INVALID_ARGUMENTS; IA_CSS_LEAVE_ERR(err); @@ -10142,7 +10138,7 @@ ia_css_temp_pipe_to_pipe_id(const struct ia_css_pipe *pipe, enum ia_css_pipe_id return IA_CSS_SUCCESS; } -enum ia_css_stream_format +enum atomisp_input_format ia_css_stream_get_format(const struct ia_css_stream *stream) { return stream->config.input_config.format; @@ -10218,8 +10214,6 @@ ia_css_stream_get_3a_binary(const struct ia_css_stream *stream) enum ia_css_err ia_css_stream_set_output_padded_width(struct ia_css_stream *stream, unsigned int output_padded_width) { - enum ia_css_err err = IA_CSS_SUCCESS; - struct ia_css_pipe *pipe; assert(stream != NULL); @@ -10232,7 +10226,7 @@ ia_css_stream_set_output_padded_width(struct ia_css_stream *stream, unsigned int pipe->config.output_info[IA_CSS_PIPE_OUTPUT_STAGE_0].padded_width = output_padded_width; pipe->output_info[IA_CSS_PIPE_OUTPUT_STAGE_0].padded_width = output_padded_width; - return err; + return IA_CSS_SUCCESS; } static struct ia_css_binary * @@ -10734,7 +10728,7 @@ ia_css_pipe_set_qos_ext_state(struct ia_css_pipe *pipe, uint32_t fw_handle, bool (uint8_t) IA_CSS_PSYS_SW_EVENT_STAGE_ENABLE_DISABLE, (uint8_t) thread_id, (uint8_t) stage->stage_num, - (enable == true) ? 1 : 0); + enable ? 1 : 0); if (err == IA_CSS_SUCCESS) { if(enable) SH_CSS_QOS_STAGE_ENABLE(&(sh_css_sp_group.pipe[thread_id]),stage->stage_num); @@ -11059,7 +11053,7 @@ static struct sh_css_hmm_buffer_record buffer_record = &hmm_buffer_record[0]; for (i = 0; i < MAX_HMM_BUFFER_NUM; i++) { - if (buffer_record->in_use == false) { + if (!buffer_record->in_use) { buffer_record->in_use = true; buffer_record->type = type; buffer_record->h_vbuf = h_vbuf; @@ -11083,7 +11077,7 @@ static struct sh_css_hmm_buffer_record buffer_record = &hmm_buffer_record[0]; for (i = 0; i < MAX_HMM_BUFFER_NUM; i++) { - if ((buffer_record->in_use == true) && + if ((buffer_record->in_use) && (buffer_record->type == type) && (buffer_record->h_vbuf != NULL) && (buffer_record->h_vbuf->vptr == ddr_buffer_addr)) { @@ -11093,7 +11087,7 @@ static struct sh_css_hmm_buffer_record buffer_record++; } - if (found_record == true) + if (found_record) return buffer_record; else return NULL; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c index 883474e90c81..a6a00024bae8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_mipi.c @@ -104,7 +104,7 @@ static bool ia_css_mipi_is_source_port_valid(struct ia_css_pipe *pipe, enum ia_css_err ia_css_mipi_frame_calculate_size(const unsigned int width, const unsigned int height, - const enum ia_css_stream_format format, + const enum atomisp_input_format format, const bool hasSOLandEOL, const unsigned int embedded_data_size_words, unsigned int *size_mem_words) @@ -136,16 +136,16 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, width_padded, height, format, hasSOLandEOL, embedded_data_size_words); switch (format) { - case IA_CSS_STREAM_FORMAT_RAW_6: /* 4p, 3B, 24bits */ + case ATOMISP_INPUT_FORMAT_RAW_6: /* 4p, 3B, 24bits */ bits_per_pixel = 6; break; - case IA_CSS_STREAM_FORMAT_RAW_7: /* 8p, 7B, 56bits */ + case ATOMISP_INPUT_FORMAT_RAW_7: /* 8p, 7B, 56bits */ bits_per_pixel = 7; break; - case IA_CSS_STREAM_FORMAT_RAW_8: /* 1p, 1B, 8bits */ - case IA_CSS_STREAM_FORMAT_BINARY_8: /* 8bits, TODO: check. */ - case IA_CSS_STREAM_FORMAT_YUV420_8: /* odd 2p, 2B, 16bits, even 2p, 4B, 32bits */ + case ATOMISP_INPUT_FORMAT_RAW_8: /* 1p, 1B, 8bits */ + case ATOMISP_INPUT_FORMAT_BINARY_8: /* 8bits, TODO: check. */ + case ATOMISP_INPUT_FORMAT_YUV420_8: /* odd 2p, 2B, 16bits, even 2p, 4B, 32bits */ bits_per_pixel = 8; break; - case IA_CSS_STREAM_FORMAT_YUV420_10: /* odd 4p, 5B, 40bits, even 4p, 10B, 80bits */ - case IA_CSS_STREAM_FORMAT_RAW_10: /* 4p, 5B, 40bits */ + case ATOMISP_INPUT_FORMAT_YUV420_10: /* odd 4p, 5B, 40bits, even 4p, 10B, 80bits */ + case ATOMISP_INPUT_FORMAT_RAW_10: /* 4p, 5B, 40bits */ #if !defined(HAS_NO_PACKED_RAW_PIXELS) /* The changes will be reverted as soon as RAW * Buffers are deployed by the 2401 Input System @@ -156,26 +156,26 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, bits_per_pixel = 16; #endif break; - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: /* 2p, 3B, 24bits */ - case IA_CSS_STREAM_FORMAT_RAW_12: /* 2p, 3B, 24bits */ + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: /* 2p, 3B, 24bits */ + case ATOMISP_INPUT_FORMAT_RAW_12: /* 2p, 3B, 24bits */ bits_per_pixel = 12; break; - case IA_CSS_STREAM_FORMAT_RAW_14: /* 4p, 7B, 56bits */ + case ATOMISP_INPUT_FORMAT_RAW_14: /* 4p, 7B, 56bits */ bits_per_pixel = 14; break; - case IA_CSS_STREAM_FORMAT_RGB_444: /* 1p, 2B, 16bits */ - case IA_CSS_STREAM_FORMAT_RGB_555: /* 1p, 2B, 16bits */ - case IA_CSS_STREAM_FORMAT_RGB_565: /* 1p, 2B, 16bits */ - case IA_CSS_STREAM_FORMAT_YUV422_8: /* 2p, 4B, 32bits */ + case ATOMISP_INPUT_FORMAT_RGB_444: /* 1p, 2B, 16bits */ + case ATOMISP_INPUT_FORMAT_RGB_555: /* 1p, 2B, 16bits */ + case ATOMISP_INPUT_FORMAT_RGB_565: /* 1p, 2B, 16bits */ + case ATOMISP_INPUT_FORMAT_YUV422_8: /* 2p, 4B, 32bits */ bits_per_pixel = 16; break; - case IA_CSS_STREAM_FORMAT_RGB_666: /* 4p, 9B, 72bits */ + case ATOMISP_INPUT_FORMAT_RGB_666: /* 4p, 9B, 72bits */ bits_per_pixel = 18; break; - case IA_CSS_STREAM_FORMAT_YUV422_10: /* 2p, 5B, 40bits */ + case ATOMISP_INPUT_FORMAT_YUV422_10: /* 2p, 5B, 40bits */ bits_per_pixel = 20; break; - case IA_CSS_STREAM_FORMAT_RGB_888: /* 1p, 3B, 24bits */ + case ATOMISP_INPUT_FORMAT_RGB_888: /* 1p, 3B, 24bits */ bits_per_pixel = 24; break; - case IA_CSS_STREAM_FORMAT_YUV420_16: /* Not supported */ - case IA_CSS_STREAM_FORMAT_YUV422_16: /* Not supported */ - case IA_CSS_STREAM_FORMAT_RAW_16: /* TODO: not specified in MIPI SPEC, check */ + case ATOMISP_INPUT_FORMAT_YUV420_16: /* Not supported */ + case ATOMISP_INPUT_FORMAT_YUV422_16: /* Not supported */ + case ATOMISP_INPUT_FORMAT_RAW_16: /* TODO: not specified in MIPI SPEC, check */ default: return IA_CSS_ERR_INVALID_ARGUMENTS; } @@ -183,9 +183,9 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */ /* Even lines for YUV420 formats are double in bits_per_pixel. */ - if (format == IA_CSS_STREAM_FORMAT_YUV420_8 - || format == IA_CSS_STREAM_FORMAT_YUV420_10 - || format == IA_CSS_STREAM_FORMAT_YUV420_16) { + if (format == ATOMISP_INPUT_FORMAT_YUV420_8 + || format == ATOMISP_INPUT_FORMAT_YUV420_10 + || format == ATOMISP_INPUT_FORMAT_YUV420_16) { even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */ } else { even_line_bytes = odd_line_bytes; @@ -239,7 +239,7 @@ ia_css_mipi_frame_calculate_size(const unsigned int width, #if !defined(HAS_NO_INPUT_SYSTEM) && defined(USE_INPUT_SYSTEM_VERSION_2) enum ia_css_err -ia_css_mipi_frame_enable_check_on_size(const enum ia_css_csi2_port port, +ia_css_mipi_frame_enable_check_on_size(const enum mipi_port_id port, const unsigned int size_mem_words) { uint32_t idx; @@ -285,7 +285,7 @@ calculate_mipi_buff_size( #else unsigned int width; unsigned int height; - enum ia_css_stream_format format; + enum atomisp_input_format format; bool pack_raw_pixels; unsigned int width_padded; @@ -348,15 +348,15 @@ calculate_mipi_buff_size( bits_per_pixel = sh_css_stream_format_2_bits_per_subpixel(format); bits_per_pixel = - (format == IA_CSS_STREAM_FORMAT_RAW_10 && pack_raw_pixels) ? bits_per_pixel : 16; + (format == ATOMISP_INPUT_FORMAT_RAW_10 && pack_raw_pixels) ? bits_per_pixel : 16; if (bits_per_pixel == 0) return IA_CSS_ERR_INTERNAL_ERROR; odd_line_bytes = (width_padded * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */ /* Even lines for YUV420 formats are double in bits_per_pixel. */ - if (format == IA_CSS_STREAM_FORMAT_YUV420_8 - || format == IA_CSS_STREAM_FORMAT_YUV420_10) { + if (format == ATOMISP_INPUT_FORMAT_YUV420_8 + || format == ATOMISP_INPUT_FORMAT_YUV420_10) { even_line_bytes = (width_padded * 2 * bits_per_pixel + 7) >> 3; /* ceil ( bits per line / 8) */ } else { even_line_bytes = odd_line_bytes; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c index fbb36112fe3c..43529b1605c3 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_params.c @@ -110,7 +110,7 @@ #define FPNTBL_BYTES(binary) \ (sizeof(char) * (binary)->in_frame_info.res.height * \ (binary)->in_frame_info.padded_width) - + #ifndef ISP2401 #define SCTBL_BYTES(binary) \ @@ -1741,7 +1741,7 @@ ia_css_process_zoom_and_motion( out_infos[0] = &args->out_frame[0]->info; info = &stage->firmware->info.isp; ia_css_binary_fill_info(info, false, false, - IA_CSS_STREAM_FORMAT_RAW_10, + ATOMISP_INPUT_FORMAT_RAW_10, args->in_frame ? &args->in_frame->info : NULL, NULL, out_infos, @@ -2891,8 +2891,8 @@ ia_css_metadata_free_multiple(unsigned int num_bufs, struct ia_css_metadata **bu } } -unsigned g_param_buffer_dequeue_count = 0; -unsigned g_param_buffer_enqueue_count = 0; +static unsigned g_param_buffer_dequeue_count = 0; +static unsigned g_param_buffer_enqueue_count = 0; enum ia_css_err ia_css_stream_isp_parameters_init(struct ia_css_stream *stream) @@ -3805,7 +3805,6 @@ sh_css_param_update_isp_params(struct ia_css_pipe *curr_pipe, enum sh_css_queue_id queue_id; - (void)stage; pipe = curr_pipe->stream->pipes[i]; pipeline = ia_css_pipe_get_pipeline(pipe); pipe_num = ia_css_pipe_get_pipe_num(pipe); diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c index 6fc00fc402b1..85263725540d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.c @@ -71,7 +71,7 @@ struct sh_css_sp_group sh_css_sp_group; struct sh_css_sp_stage sh_css_sp_stage; struct sh_css_isp_stage sh_css_isp_stage; -struct sh_css_sp_output sh_css_sp_output; +static struct sh_css_sp_output sh_css_sp_output; static struct sh_css_sp_per_frame_data per_frame_data; /* true if SP supports frame loop and host2sp_commands */ @@ -117,9 +117,9 @@ copy_isp_stage_to_sp_stage(void) */ sh_css_sp_stage.enable.sdis = sh_css_isp_stage.binary_info.enable.dis; sh_css_sp_stage.enable.s3a = sh_css_isp_stage.binary_info.enable.s3a; -#ifdef ISP2401 +#ifdef ISP2401 sh_css_sp_stage.enable.lace_stats = sh_css_isp_stage.binary_info.enable.lace_stats; -#endif +#endif } void @@ -754,7 +754,7 @@ sh_css_sp_write_frame_pointers(const struct sh_css_binary_args *args) static void sh_css_sp_init_group(bool two_ppc, - enum ia_css_stream_format input_format, + enum atomisp_input_format input_format, bool no_isp_sync, uint8_t if_config_index) { @@ -817,7 +817,6 @@ configure_isp_from_args( bool two_ppc, bool deinterleaved) { - enum ia_css_err err = IA_CSS_SUCCESS; #ifdef ISP2401 struct ia_css_pipe *pipe = find_pipe_by_num(pipeline->pipe_num); const struct ia_css_resolution *res; @@ -841,7 +840,7 @@ configure_isp_from_args( ia_css_ref_configure(binary, (const struct ia_css_frame **)args->delay_frames, pipeline->dvs_frame_delay); ia_css_tnr_configure(binary, (const struct ia_css_frame **)args->tnr_frames); ia_css_bayer_io_config(binary, args); - return err; + return IA_CSS_SUCCESS; } static void @@ -1118,7 +1117,7 @@ sp_init_stage(struct ia_css_pipeline_stage *stage, out_infos[0] = &args->out_frame[0]->info; info = &firmware->info.isp; ia_css_binary_fill_info(info, false, false, - IA_CSS_STREAM_FORMAT_RAW_10, + ATOMISP_INPUT_FORMAT_RAW_10, args->in_frame ? &args->in_frame->info : NULL, NULL, out_infos, @@ -1197,7 +1196,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me, const struct ia_css_metadata_config *md_config, const struct ia_css_metadata_info *md_info, #if !defined(HAS_NO_INPUT_SYSTEM) - const mipi_port_ID_t port_id + const enum mipi_port_id port_id #endif #ifdef ISP2401 , @@ -1442,8 +1441,6 @@ sh_css_update_host2sp_offline_frame( unsigned int HIVE_ADDR_host_sp_com; unsigned int offset; - (void)HIVE_ADDR_host_sp_com; /* Suppres warnings in CRUN */ - assert(frame_num < NUM_CONTINUOUS_FRAMES); /* Write new frame data into SP DMEM */ @@ -1473,8 +1470,6 @@ sh_css_update_host2sp_mipi_frame( unsigned int HIVE_ADDR_host_sp_com; unsigned int offset; - (void)HIVE_ADDR_host_sp_com; /* Suppres warnings in CRUN */ - /* MIPI buffers are dedicated to port, so now there are more of them. */ assert(frame_num < (N_CSI_PORTS * NUM_MIPI_FRAMES_PER_STREAM)); @@ -1500,8 +1495,6 @@ sh_css_update_host2sp_mipi_metadata( unsigned int HIVE_ADDR_host_sp_com; unsigned int o; - (void)HIVE_ADDR_host_sp_com; /* Suppres warnings in CRUN */ - /* MIPI buffers are dedicated to port, so now there are more of them. */ assert(frame_num < (N_CSI_PORTS * NUM_MIPI_FRAMES_PER_STREAM)); @@ -1520,8 +1513,6 @@ sh_css_update_host2sp_num_mipi_frames(unsigned num_frames) unsigned int HIVE_ADDR_host_sp_com; unsigned int offset; - (void)HIVE_ADDR_host_sp_com; /* Suppres warnings in CRUN */ - /* Write new frame data into SP DMEM */ HIVE_ADDR_host_sp_com = sh_css_sp_fw.info.sp.host_sp_com; offset = (unsigned int)offsetof(struct host_sp_communication, host2sp_num_mipi_frames) @@ -1539,8 +1530,6 @@ sh_css_update_host2sp_cont_num_raw_frames(unsigned num_frames, bool set_avail) unsigned int extra_num_frames, avail_num_frames; unsigned int offset, offset_extra; - (void)HIVE_ADDR_host_sp_com; /* Suppres warnings in CRUN */ - /* Write new frame data into SP DMEM */ fw = &sh_css_sp_fw; HIVE_ADDR_host_sp_com = fw->info.sp.host_sp_com; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h index 98444a3cc3e4..3c41e997de79 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_sp.h @@ -64,7 +64,7 @@ sh_css_sp_init_pipeline(struct ia_css_pipeline *me, const struct ia_css_metadata_config *md_config, const struct ia_css_metadata_info *md_info, #if !defined(HAS_NO_INPUT_SYSTEM) - const mipi_port_ID_t port_id + const enum mipi_port_id port_id #endif #ifdef ISP2401 , diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.c index 52d0a6471597..77f135e7dc3c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.c @@ -16,55 +16,55 @@ #include <ia_css_stream_format.h> unsigned int sh_css_stream_format_2_bits_per_subpixel( - enum ia_css_stream_format format) + enum atomisp_input_format format) { unsigned int rval; switch (format) { - case IA_CSS_STREAM_FORMAT_RGB_444: + case ATOMISP_INPUT_FORMAT_RGB_444: rval = 4; break; - case IA_CSS_STREAM_FORMAT_RGB_555: + case ATOMISP_INPUT_FORMAT_RGB_555: rval = 5; break; - case IA_CSS_STREAM_FORMAT_RGB_565: - case IA_CSS_STREAM_FORMAT_RGB_666: - case IA_CSS_STREAM_FORMAT_RAW_6: + case ATOMISP_INPUT_FORMAT_RGB_565: + case ATOMISP_INPUT_FORMAT_RGB_666: + case ATOMISP_INPUT_FORMAT_RAW_6: rval = 6; break; - case IA_CSS_STREAM_FORMAT_RAW_7: + case ATOMISP_INPUT_FORMAT_RAW_7: rval = 7; break; - case IA_CSS_STREAM_FORMAT_YUV420_8_LEGACY: - case IA_CSS_STREAM_FORMAT_YUV420_8: - case IA_CSS_STREAM_FORMAT_YUV422_8: - case IA_CSS_STREAM_FORMAT_RGB_888: - case IA_CSS_STREAM_FORMAT_RAW_8: - case IA_CSS_STREAM_FORMAT_BINARY_8: - case IA_CSS_STREAM_FORMAT_USER_DEF1: - case IA_CSS_STREAM_FORMAT_USER_DEF2: - case IA_CSS_STREAM_FORMAT_USER_DEF3: - case IA_CSS_STREAM_FORMAT_USER_DEF4: - case IA_CSS_STREAM_FORMAT_USER_DEF5: - case IA_CSS_STREAM_FORMAT_USER_DEF6: - case IA_CSS_STREAM_FORMAT_USER_DEF7: - case IA_CSS_STREAM_FORMAT_USER_DEF8: + case ATOMISP_INPUT_FORMAT_YUV420_8_LEGACY: + case ATOMISP_INPUT_FORMAT_YUV420_8: + case ATOMISP_INPUT_FORMAT_YUV422_8: + case ATOMISP_INPUT_FORMAT_RGB_888: + case ATOMISP_INPUT_FORMAT_RAW_8: + case ATOMISP_INPUT_FORMAT_BINARY_8: + case ATOMISP_INPUT_FORMAT_USER_DEF1: + case ATOMISP_INPUT_FORMAT_USER_DEF2: + case ATOMISP_INPUT_FORMAT_USER_DEF3: + case ATOMISP_INPUT_FORMAT_USER_DEF4: + case ATOMISP_INPUT_FORMAT_USER_DEF5: + case ATOMISP_INPUT_FORMAT_USER_DEF6: + case ATOMISP_INPUT_FORMAT_USER_DEF7: + case ATOMISP_INPUT_FORMAT_USER_DEF8: rval = 8; break; - case IA_CSS_STREAM_FORMAT_YUV420_10: - case IA_CSS_STREAM_FORMAT_YUV422_10: - case IA_CSS_STREAM_FORMAT_RAW_10: + case ATOMISP_INPUT_FORMAT_YUV420_10: + case ATOMISP_INPUT_FORMAT_YUV422_10: + case ATOMISP_INPUT_FORMAT_RAW_10: rval = 10; break; - case IA_CSS_STREAM_FORMAT_RAW_12: + case ATOMISP_INPUT_FORMAT_RAW_12: rval = 12; break; - case IA_CSS_STREAM_FORMAT_RAW_14: + case ATOMISP_INPUT_FORMAT_RAW_14: rval = 14; break; - case IA_CSS_STREAM_FORMAT_RAW_16: - case IA_CSS_STREAM_FORMAT_YUV420_16: - case IA_CSS_STREAM_FORMAT_YUV422_16: + case ATOMISP_INPUT_FORMAT_RAW_16: + case ATOMISP_INPUT_FORMAT_YUV420_16: + case ATOMISP_INPUT_FORMAT_YUV422_16: rval = 16; break; default: diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.h index aab2b6207051..b699f538e0dd 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_stream_format.h @@ -18,6 +18,6 @@ #include <ia_css_stream_format.h> unsigned int sh_css_stream_format_2_bits_per_subpixel( - enum ia_css_stream_format format); + enum atomisp_input_format format); #endif /* __SH_CSS_STREAM_FORMAT_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/include/mmu/isp_mmu.h b/drivers/staging/media/atomisp/pci/atomisp2/include/mmu/isp_mmu.h index 560014add005..4b2d94a37ea1 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/include/mmu/isp_mmu.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/include/mmu/isp_mmu.h @@ -80,12 +80,10 @@ struct isp_mmu_client { unsigned int null_pte; /* - * set/get page directory base address (physical address). + * get page directory base address (physical address). * * must be provided. */ - int (*set_pd_base) (struct isp_mmu *mmu, - phys_addr_t pd_base); unsigned int (*get_pd_base) (struct isp_mmu *mmu, phys_addr_t pd_base); /* * callback to flush tlb. diff --git a/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c b/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c index f21075c1e503..198f29f4a324 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/mmu/isp_mmu.c @@ -344,13 +344,6 @@ static int mmu_map(struct isp_mmu *mmu, unsigned int isp_virt, /* * setup L1 page table physical addr to MMU */ - ret = mmu->driver->set_pd_base(mmu, l1_pt); - if (ret) { - dev_err(atomisp_dev, - "set page directory base address fail.\n"); - mutex_unlock(&mmu->pt_mutex); - return ret; - } mmu->base_address = l1_pt; mmu->l1_pte = isp_pgaddr_to_pte_valid(mmu, l1_pt); memset(mmu->l2_pgt_refcount, 0, sizeof(int) * ISP_L1PT_PTES); @@ -531,10 +524,8 @@ int isp_mmu_init(struct isp_mmu *mmu, struct isp_mmu_client *driver) mmu->driver = driver; - if (!driver->set_pd_base || !driver->tlb_flush_all) { - dev_err(atomisp_dev, - "set_pd_base or tlb_flush_all operation " - "not provided.\n"); + if (!driver->tlb_flush_all) { + dev_err(atomisp_dev, "tlb_flush_all operation not provided.\n"); return -EINVAL; } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/mmu/sh_mmu_mrfld.c b/drivers/staging/media/atomisp/pci/atomisp2/mmu/sh_mmu_mrfld.c index c59bcc982966..c0212564b7c8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/mmu/sh_mmu_mrfld.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/mmu/sh_mmu_mrfld.c @@ -18,6 +18,7 @@ */ #include "type_support.h" #include "mmu/isp_mmu.h" +#include "mmu/sh_mmu_mrfld.h" #include "memory_access/memory_access.h" #include "atomisp_compat.h" @@ -40,20 +41,6 @@ static phys_addr_t sh_pte_to_phys(struct isp_mmu *mmu, return (phys_addr_t)((pte & ~mask) << ISP_PAGE_OFFSET); } -/* - * set page directory base address (physical address). - * - * must be provided. - */ -static int sh_set_pd_base(struct isp_mmu *mmu, - phys_addr_t phys) -{ - unsigned int pte = sh_phys_to_pte(mmu, phys); - /*mmgr_set_base_address(HOST_ADDRESS(pte));*/ - atomisp_css_mmu_set_page_table_base_index(HOST_ADDRESS(pte)); - return 0; -} - static unsigned int sh_get_pd_base(struct isp_mmu *mmu, phys_addr_t phys) { @@ -81,7 +68,6 @@ struct isp_mmu_client sh_mmu_mrfld = { .name = "Silicon Hive ISP3000 MMU", .pte_valid_mask = MERR_VALID_PTE_MASK, .null_pte = ~MERR_VALID_PTE_MASK, - .set_pd_base = sh_set_pd_base, .get_pd_base = sh_get_pd_base, .tlb_flush_all = sh_tlb_flush, .phys_to_pte = sh_phys_to_pte, diff --git a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c index d8b7183db252..3283c1b05d6a 100644 --- a/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c @@ -441,7 +441,7 @@ static int gmin_v1p2_ctrl(struct v4l2_subdev *subdev, int on) { struct gmin_subdev *gs = find_gmin_subdev(subdev); - if (gs && gs->v1p2_on == on) + if (!gs || gs->v1p2_on == on) return 0; gs->v1p2_on = on; @@ -475,7 +475,7 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on) } } - if (gs && gs->v1p8_on == on) + if (!gs || gs->v1p8_on == on) return 0; gs->v1p8_on = on; @@ -511,7 +511,7 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) } } - if (gs && gs->v2p8_on == on) + if (!gs || gs->v2p8_on == on) return 0; gs->v2p8_on = on; @@ -693,9 +693,11 @@ static int gmin_get_config_var(struct device *dev, const char *var, for (i = 0; i < sizeof(var8) && var8[i]; i++) var16[i] = var8[i]; +#ifdef CONFIG_64BIT /* To avoid owerflows when calling the efivar API */ if (*out_len > ULONG_MAX) return -EINVAL; +#endif /* Not sure this API usage is kosher; efivar_entry_get()'s * implementation simply uses VariableName and VendorGuid from diff --git a/drivers/staging/media/davinci_vpfe/dm365_resizer.c b/drivers/staging/media/davinci_vpfe/dm365_resizer.c index 857b0e847c5e..1ee216d71d42 100644 --- a/drivers/staging/media/davinci_vpfe/dm365_resizer.c +++ b/drivers/staging/media/davinci_vpfe/dm365_resizer.c @@ -480,7 +480,7 @@ resizer_configure_common_in_params(struct vpfe_resizer_device *resizer) return 0; } static int -resizer_configure_in_continious_mode(struct vpfe_resizer_device *resizer) +resizer_configure_in_continuous_mode(struct vpfe_resizer_device *resizer) { struct device *dev = resizer->crop_resizer.subdev.v4l2_dev->dev; struct resizer_params *param = &resizer->config; @@ -1242,7 +1242,7 @@ static int resizer_do_hw_setup(struct vpfe_resizer_device *resizer) ipipeif_source == IPIPEIF_OUTPUT_RESIZER) ret = resizer_configure_in_single_shot_mode(resizer); else - ret = resizer_configure_in_continious_mode(resizer); + ret = resizer_configure_in_continuous_mode(resizer); if (ret) return ret; ret = config_rsz_hw(resizer, param); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 1aa2be891704..16cab40156ca 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1005,7 +1005,7 @@ static int csi_link_validate(struct v4l2_subdev *sd, struct v4l2_subdev_format *sink_fmt) { struct csi_priv *priv = v4l2_get_subdevdata(sd); - struct v4l2_fwnode_endpoint upstream_ep; + struct v4l2_fwnode_endpoint upstream_ep = {}; const struct imx_media_pixfmt *incc; bool is_csi2; int ret; @@ -1800,7 +1800,10 @@ static int imx_csi_probe(struct platform_device *pdev) pinctrl = devm_pinctrl_get_select_default(priv->dev); if (IS_ERR(pinctrl)) { ret = PTR_ERR(priv->vdev); - goto free; + dev_dbg(priv->dev, + "devm_pinctrl_get_select_default() failed: %d\n", ret); + if (ret != -ENODEV) + goto free; } ret = v4l2_async_register_subdev(&priv->sd); |