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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -280,14 +280,14 @@ int atomisp_freq_scaling(struct atomisp_device *isp,
done:
	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;

	dev_dbg(isp->dev, "Programming DFS frequency to %d\n", new_freq);

	ret = write_target_freq_to_hw(isp, new_freq);
	if (!ret) {
		isp->sw_contex.running_freq = new_freq;
		isp->running_freq = new_freq;
		trace_ipu_pstate(new_freq, -1);
	}
	return ret;
+1 −1
Original line number Diff line number Diff line
@@ -681,7 +681,7 @@ static void atomisp_dev_init_struct(struct atomisp_device *isp)
	 * For Merrifield, frequency is scalable.
	 * 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)
+1 −5
Original line number Diff line number Diff line
@@ -194,10 +194,6 @@ struct atomisp_regs {
	u32 csi_access_viol;
};

struct atomisp_sw_contex {
	int running_freq;
};

#define ATOMISP_DEVICE_STREAMING_DISABLED	0
#define ATOMISP_DEVICE_STREAMING_ENABLED	1
#define ATOMISP_DEVICE_STREAMING_STOPPING	2
@@ -242,7 +238,6 @@ struct atomisp_device {
	struct v4l2_subdev *motor;

	struct atomisp_regs saved_regs;
	struct atomisp_sw_contex sw_contex;
	struct atomisp_css_env css_env;

	/* isp timeout status flag */
@@ -257,6 +252,7 @@ struct atomisp_device {
	unsigned int mipi_frame_size;
	const struct atomisp_dfs_config *dfs;
	unsigned int hpll_freq;
	unsigned int running_freq;

	bool css_initialized;
};