23 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
102 MODE_CTRL + (0x200 * i), &tmp);
107 MODE_CTRL + (0x200 * i), value);
164 medusa_enable_bluefield_output(dev, i, 1);
230 static int medusa_PALCombInit(
struct cx25821_dev *dev,
int dec)
233 u32 value = 0, tmp = 0;
261 static int medusa_initialize_pal(
struct cx25821_dev *dev)
273 MODE_CTRL + (0x200 * i), &tmp);
278 MODE_CTRL + (0x200 * i), value);
335 medusa_PALCombInit(dev, i);
338 medusa_enable_bluefield_output(dev, i, 1);
408 u32 value = 0, tmp = 0;
411 status = medusa_initialize_pal(dev);
413 status = medusa_initialize_ntsc(dev);
432 int decoder_count = 0;
440 if (width > MAX_WIDTH) {
441 pr_info(
"%s(): width %d > MAX_WIDTH %d ! resetting to MAX_WIDTH\n",
442 __func__, width, MAX_WIDTH);
446 if (decoder_select <= 7 && decoder_select >= 0) {
447 decoder = decoder_select;
448 decoder_count = decoder_select + 1;
481 for (; decoder < decoder_count; decoder++) {
492 static void medusa_set_decoderduration(
struct cx25821_dev *dev,
int decoder,
502 if (decoder < VDEC_A || decoder >
VDEC_H) {
529 if (!(decoder % 2)) {
530 fld_cnt &= 0xFFFF0000;
533 fld_cnt &= 0x0000FFFF;
534 fld_cnt |= ((
u32) duration) << 16;
543 static int mapM(
int srcMin,
int srcMax,
int srcVal,
int dstMin,
int dstMax,
550 if ((srcMin == srcMax) || (srcVal < srcMin) || (srcVal > srcMax))
559 numerator = (srcVal - srcMin) * (dstMax - dstMin);
560 denominator = srcMax - srcMin;
561 quotient = numerator / denominator;
563 if (2 * (numerator % denominator) >= denominator)
566 *dstVal = quotient + dstMin;
571 static unsigned long convert_to_twos(
long numeric,
unsigned long bits_len)
578 temp = ~(
abs(numeric) & 0xFF);
598 value = convert_to_twos(value, 8);
649 value = convert_to_twos(value, 8);
698 u32 value = 0, tmp = 0;
758 if (_num_decoders == MAX_DECODERS) {