Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfef0d35 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] cx25821: make cx25821_sram_channels const



And get rid of the channel0-11 external pointers and two more unused fields
in cx25821.h.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3dd473ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ static int _cx25821_start_audio_dma(struct cx25821_audio_dev *chip)
{
	struct cx25821_audio_buffer *buf = chip->buf;
	struct cx25821_dev *dev = chip->dev;
	struct sram_channel *audio_ch =
	const struct sram_channel *audio_ch =
	    &cx25821_sram_channels[AUDIO_SRAM_CHANNEL];
	u32 tmp = 0;

+11 −11
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static int _intr_msk = FLD_AUD_SRC_RISCI1 | FLD_AUD_SRC_OF |
			FLD_AUD_SRC_SYNC | FLD_AUD_SRC_OPC_ERR;

static int cx25821_sram_channel_setup_upstream_audio(struct cx25821_dev *dev,
					      struct sram_channel *ch,
					      const struct sram_channel *ch,
					      unsigned int bpl, u32 risc)
{
	unsigned int i, lines;
@@ -106,7 +106,7 @@ static __le32 *cx25821_risc_field_upstream_audio(struct cx25821_dev *dev,
						 int fifo_enable)
{
	unsigned int line;
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[dev->_audio_upstream_channel].sram_channels;
	int offset = 0;

@@ -215,7 +215,7 @@ static void cx25821_free_memory_audio(struct cx25821_dev *dev)

void cx25821_stop_upstream_audio(struct cx25821_dev *dev)
{
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[AUDIO_UPSTREAM_SRAM_CHANNEL_B].sram_channels;
	u32 tmp = 0;

@@ -257,7 +257,7 @@ void cx25821_free_mem_upstream_audio(struct cx25821_dev *dev)
}

static int cx25821_get_audio_data(struct cx25821_dev *dev,
			   struct sram_channel *sram_ch)
			   const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int frame_index_temp = dev->_audioframe_index;
@@ -352,7 +352,7 @@ static void cx25821_audioups_handler(struct work_struct *work)
}

static int cx25821_openfile_audio(struct cx25821_dev *dev,
			   struct sram_channel *sram_ch)
			   const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int i = 0, j = 0;
@@ -433,7 +433,7 @@ static int cx25821_openfile_audio(struct cx25821_dev *dev,
}

static int cx25821_audio_upstream_buffer_prepare(struct cx25821_dev *dev,
						 struct sram_channel *sram_ch,
						 const struct sram_channel *sram_ch,
						 int bpl)
{
	int ret = 0;
@@ -495,7 +495,7 @@ static int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num,
{
	int i = 0;
	u32 int_msk_tmp;
	struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	const struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	dma_addr_t risc_phys_jump_addr;
	__le32 *rp;

@@ -587,7 +587,7 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)
	struct cx25821_dev *dev = dev_id;
	u32 audio_status;
	int handled = 0;
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;

	if (!dev)
		return -1;
@@ -611,7 +611,7 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)
}

static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
				     struct sram_channel *sram_ch)
				     const struct sram_channel *sram_ch)
{
	int count = 0;
	u32 tmp;
@@ -635,7 +635,7 @@ static void cx25821_wait_fifo_enable(struct cx25821_dev *dev,
}

static int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,
					    struct sram_channel *sram_ch)
					    const struct sram_channel *sram_ch)
{
	u32 tmp = 0;
	int err = 0;
@@ -699,7 +699,7 @@ static int cx25821_start_audio_dma_upstream(struct cx25821_dev *dev,

int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
{
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;
	int err = 0;

	if (dev->_audio_is_running) {
+6 −22
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(cx25821_devlist_mutex);
LIST_HEAD(cx25821_devlist);
EXPORT_SYMBOL(cx25821_devlist);

struct sram_channel cx25821_sram_channels[] = {
const struct sram_channel cx25821_sram_channels[] = {
	[SRAM_CH00] = {
		.i = SRAM_CH00,
		.name = "VID A",
@@ -317,20 +317,6 @@ struct sram_channel cx25821_sram_channels[] = {
};
EXPORT_SYMBOL(cx25821_sram_channels);

struct sram_channel *channel0 = &cx25821_sram_channels[SRAM_CH00];
struct sram_channel *channel1 = &cx25821_sram_channels[SRAM_CH01];
struct sram_channel *channel2 = &cx25821_sram_channels[SRAM_CH02];
struct sram_channel *channel3 = &cx25821_sram_channels[SRAM_CH03];
struct sram_channel *channel4 = &cx25821_sram_channels[SRAM_CH04];
struct sram_channel *channel5 = &cx25821_sram_channels[SRAM_CH05];
struct sram_channel *channel6 = &cx25821_sram_channels[SRAM_CH06];
struct sram_channel *channel7 = &cx25821_sram_channels[SRAM_CH07];
struct sram_channel *channel9 = &cx25821_sram_channels[SRAM_CH09];
struct sram_channel *channel10 = &cx25821_sram_channels[SRAM_CH10];
struct sram_channel *channel11 = &cx25821_sram_channels[SRAM_CH11];

struct cx25821_dmaqueue mpegq;

static int cx25821_risc_decode(u32 risc)
{
	static const char * const instr[16] = {
@@ -457,7 +443,7 @@ static void cx25821_registers_init(struct cx25821_dev *dev)
}

int cx25821_sram_channel_setup(struct cx25821_dev *dev,
			       struct sram_channel *ch,
			       const struct sram_channel *ch,
			       unsigned int bpl, u32 risc)
{
	unsigned int i, lines;
@@ -523,10 +509,9 @@ int cx25821_sram_channel_setup(struct cx25821_dev *dev,

	return 0;
}
EXPORT_SYMBOL(cx25821_sram_channel_setup);

int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev,
				     struct sram_channel *ch,
				     const struct sram_channel *ch,
				     unsigned int bpl, u32 risc)
{
	unsigned int i, lines;
@@ -592,7 +577,7 @@ int cx25821_sram_channel_setup_audio(struct cx25821_dev *dev,
}
EXPORT_SYMBOL(cx25821_sram_channel_setup_audio);

void cx25821_sram_channel_dump(struct cx25821_dev *dev, struct sram_channel *ch)
void cx25821_sram_channel_dump(struct cx25821_dev *dev, const struct sram_channel *ch)
{
	static char *name[] = {
		"init risc lo",
@@ -652,10 +637,9 @@ void cx25821_sram_channel_dump(struct cx25821_dev *dev, struct sram_channel *ch)
	pr_warn("        :   cnt2_reg: 0x%08x\n",
		cx_read(ch->cnt2_reg));
}
EXPORT_SYMBOL(cx25821_sram_channel_dump);

void cx25821_sram_channel_dump_audio(struct cx25821_dev *dev,
				     struct sram_channel *ch)
				     const struct sram_channel *ch)
{
	static const char * const name[] = {
		"init risc lo",
@@ -803,7 +787,7 @@ void cx25821_set_pixel_format(struct cx25821_dev *dev, int channel_select,
}

static void cx25821_set_vip_mode(struct cx25821_dev *dev,
				 struct sram_channel *ch)
				 const struct sram_channel *ch)
{
	cx_write(ch->pix_frmt, PIXEL_FRMT_422);
	cx_write(ch->vip_ctl, PIXEL_ENGINE_VIP1);
+10 −10
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static __le32 *cx25821_risc_field_upstream_ch2(struct cx25821_dev *dev,
					       int fifo_enable, int field_type)
{
	unsigned int line, i;
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[dev->_channel2_upstream_select].sram_channels;
	int dist_betwn_starts = bpl * 2;

@@ -201,7 +201,7 @@ static int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,

void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev)
{
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[VID_UPSTREAM_SRAM_CHANNEL_J].sram_channels;
	u32 tmp = 0;

@@ -257,7 +257,7 @@ void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev)
}

static int cx25821_get_frame_ch2(struct cx25821_dev *dev,
				 struct sram_channel *sram_ch)
				 const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int frame_index_temp = dev->_frame_index_ch2;
@@ -363,7 +363,7 @@ static void cx25821_vidups_handler_ch2(struct work_struct *work)
}

static int cx25821_openfile_ch2(struct cx25821_dev *dev,
				struct sram_channel *sram_ch)
				const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int i = 0, j = 0;
@@ -445,7 +445,7 @@ static int cx25821_openfile_ch2(struct cx25821_dev *dev,
}

static int cx25821_upstream_buffer_prepare_ch2(struct cx25821_dev *dev,
					       struct sram_channel *sram_ch,
					       const struct sram_channel *sram_ch,
					       int bpl)
{
	int ret = 0;
@@ -515,7 +515,7 @@ static int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev,
					  u32 status)
{
	u32 int_msk_tmp;
	struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	const struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	int singlefield_lines = NTSC_FIELD_HEIGHT;
	int line_size_in_bytes = Y422_LINE_SZ;
	int odd_risc_prog_size = 0;
@@ -594,7 +594,7 @@ static irqreturn_t cx25821_upstream_irq_ch2(int irq, void *dev_id)
	u32 vid_status;
	int handled = 0;
	int channel_num = 0;
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;

	if (!dev)
		return -1;
@@ -618,7 +618,7 @@ static irqreturn_t cx25821_upstream_irq_ch2(int irq, void *dev_id)
}

static void cx25821_set_pixelengine_ch2(struct cx25821_dev *dev,
					struct sram_channel *ch, int pix_format)
					const struct sram_channel *ch, int pix_format)
{
	int width = WIDTH_D1;
	int height = dev->_lines_count_ch2;
@@ -652,7 +652,7 @@ static void cx25821_set_pixelengine_ch2(struct cx25821_dev *dev,
}

static int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,
						struct sram_channel *sram_ch)
						const struct sram_channel *sram_ch)
{
	u32 tmp = 0;
	int err = 0;
@@ -706,7 +706,7 @@ static int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,
int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
				 int pixel_format)
{
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;
	u32 tmp;
	int err = 0;
	int data_frame_size = 0;
+11 −11
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ static int _intr_msk = FLD_VID_SRC_RISC1 | FLD_VID_SRC_UF | FLD_VID_SRC_SYNC |
			FLD_VID_SRC_OPC_ERR;

int cx25821_sram_channel_setup_upstream(struct cx25821_dev *dev,
					struct sram_channel *ch,
					const struct sram_channel *ch,
					unsigned int bpl, u32 risc)
{
	unsigned int i, lines;
@@ -135,7 +135,7 @@ static __le32 *cx25821_risc_field_upstream(struct cx25821_dev *dev, __le32 * rp,
					   int fifo_enable, int field_type)
{
	unsigned int line, i;
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[dev->_channel_upstream_select].sram_channels;
	int dist_betwn_starts = bpl * 2;

@@ -247,7 +247,7 @@ static int cx25821_risc_buffer_upstream(struct cx25821_dev *dev,

void cx25821_stop_upstream_video_ch1(struct cx25821_dev *dev)
{
	struct sram_channel *sram_ch =
	const struct sram_channel *sram_ch =
		dev->channels[VID_UPSTREAM_SRAM_CHANNEL_I].sram_channels;
	u32 tmp = 0;

@@ -301,7 +301,7 @@ void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev)
}

static int cx25821_get_frame(struct cx25821_dev *dev,
			     struct sram_channel *sram_ch)
			     const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int frame_index_temp = dev->_frame_index;
@@ -407,7 +407,7 @@ static void cx25821_vidups_handler(struct work_struct *work)
}

static int cx25821_openfile(struct cx25821_dev *dev,
			    struct sram_channel *sram_ch)
			    const struct sram_channel *sram_ch)
{
	struct file *myfile;
	int i = 0, j = 0;
@@ -489,7 +489,7 @@ static int cx25821_openfile(struct cx25821_dev *dev,
}

static int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev,
					   struct sram_channel *sram_ch,
					   const struct sram_channel *sram_ch,
					   int bpl)
{
	int ret = 0;
@@ -555,7 +555,7 @@ static int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num,
				      u32 status)
{
	u32 int_msk_tmp;
	struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	const struct sram_channel *channel = dev->channels[chan_num].sram_channels;
	int singlefield_lines = NTSC_FIELD_HEIGHT;
	int line_size_in_bytes = Y422_LINE_SZ;
	int odd_risc_prog_size = 0;
@@ -643,7 +643,7 @@ static irqreturn_t cx25821_upstream_irq(int irq, void *dev_id)
	u32 vid_status;
	int handled = 0;
	int channel_num = 0;
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;

	if (!dev)
		return -1;
@@ -668,7 +668,7 @@ static irqreturn_t cx25821_upstream_irq(int irq, void *dev_id)
}

static void cx25821_set_pixelengine(struct cx25821_dev *dev,
				    struct sram_channel *ch,
				    const struct sram_channel *ch,
				    int pix_format)
{
	int width = WIDTH_D1;
@@ -701,7 +701,7 @@ static void cx25821_set_pixelengine(struct cx25821_dev *dev,
}

static int cx25821_start_video_dma_upstream(struct cx25821_dev *dev,
					    struct sram_channel *sram_ch)
					    const struct sram_channel *sram_ch)
{
	u32 tmp = 0;
	int err = 0;
@@ -755,7 +755,7 @@ static int cx25821_start_video_dma_upstream(struct cx25821_dev *dev,
int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select,
				 int pixel_format)
{
	struct sram_channel *sram_ch;
	const struct sram_channel *sram_ch;
	u32 tmp;
	int err = 0;
	int data_frame_size = 0;
Loading