Commit 21b86873 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

media: atomisp: Remove atomisp_sw_contex struct

Remove the atomisp_sw_contex struct, it has only 1 member: running_freq,
instead store running_freq directly.

While at it also change running_freq from an int to an unsigned int,
all values stored in it are unsigned and it is compared to the also
unsigned new_freq variable.
Reviewed-by: default avatarAndy Shevchenko <andy@kernel.org>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 0c144c93
...@@ -280,14 +280,14 @@ int atomisp_freq_scaling(struct atomisp_device *isp, ...@@ -280,14 +280,14 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
done: done:
dev_dbg(isp->dev, "DFS target frequency=%d.\n", new_freq); dev_dbg(isp->dev, "DFS target frequency=%d.\n", new_freq);
if ((new_freq == isp->sw_contex.running_freq) && !force) if ((new_freq == isp->running_freq) && !force)
return 0; return 0;
dev_dbg(isp->dev, "Programming DFS frequency to %d\n", new_freq); dev_dbg(isp->dev, "Programming DFS frequency to %d\n", new_freq);
ret = write_target_freq_to_hw(isp, new_freq); ret = write_target_freq_to_hw(isp, new_freq);
if (!ret) { if (!ret) {
isp->sw_contex.running_freq = new_freq; isp->running_freq = new_freq;
trace_ipu_pstate(new_freq, -1); trace_ipu_pstate(new_freq, -1);
} }
return ret; return ret;
......
...@@ -681,7 +681,7 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp) ...@@ -681,7 +681,7 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp)
* For Merrifield, frequency is scalable. * For Merrifield, frequency is scalable.
* After boot-up, the default frequency is 200MHz. * After boot-up, the default frequency is 200MHz.
*/ */
isp->sw_contex.running_freq = ISP_FREQ_200MHZ; isp->running_freq = ISP_FREQ_200MHZ;
} }
static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd) static void atomisp_subdev_init_struct(struct atomisp_sub_device *asd)
......
...@@ -194,10 +194,6 @@ struct atomisp_regs { ...@@ -194,10 +194,6 @@ struct atomisp_regs {
u32 csi_access_viol; u32 csi_access_viol;
}; };
struct atomisp_sw_contex {
int running_freq;
};
#define ATOMISP_DEVICE_STREAMING_DISABLED 0 #define ATOMISP_DEVICE_STREAMING_DISABLED 0
#define ATOMISP_DEVICE_STREAMING_ENABLED 1 #define ATOMISP_DEVICE_STREAMING_ENABLED 1
#define ATOMISP_DEVICE_STREAMING_STOPPING 2 #define ATOMISP_DEVICE_STREAMING_STOPPING 2
...@@ -242,7 +238,6 @@ struct atomisp_device { ...@@ -242,7 +238,6 @@ struct atomisp_device {
struct v4l2_subdev *motor; struct v4l2_subdev *motor;
struct atomisp_regs saved_regs; struct atomisp_regs saved_regs;
struct atomisp_sw_contex sw_contex;
struct atomisp_css_env css_env; struct atomisp_css_env css_env;
/* isp timeout status flag */ /* isp timeout status flag */
...@@ -257,6 +252,7 @@ struct atomisp_device { ...@@ -257,6 +252,7 @@ struct atomisp_device {
unsigned int mipi_frame_size; unsigned int mipi_frame_size;
const struct atomisp_dfs_config *dfs; const struct atomisp_dfs_config *dfs;
unsigned int hpll_freq; unsigned int hpll_freq;
unsigned int running_freq;
bool css_initialized; bool css_initialized;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment