Release 4.7 drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c
/* linux/drivers/media/platform/s5p-jpeg/jpeg-hw.h
*
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
*
* 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.
*/
#include <linux/io.h>
#include <linux/videodev2.h>
#include "jpeg-core.h"
#include "jpeg-regs.h"
#include "jpeg-hw-s5p.h"
void s5p_jpeg_reset(void __iomem *regs)
{
unsigned long reg;
writel(1, regs + S5P_JPG_SW_RESET);
reg = readl(regs + S5P_JPG_SW_RESET);
/* no other way but polling for when JPEG IP becomes operational */
while (reg != 0) {
cpu_relax();
reg = readl(regs + S5P_JPG_SW_RESET);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 52 | 98.11% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.89% | 1 | 50.00% |
| Total | 53 | 100.00% | 2 | 100.00% |
void s5p_jpeg_poweron(void __iomem *regs)
{
writel(S5P_POWER_ON, regs + S5P_JPGCLKCON);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 18 | 94.74% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 5.26% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
void s5p_jpeg_input_raw_mode(void __iomem *regs, unsigned long mode)
{
unsigned long reg, m;
m = S5P_MOD_SEL_565;
if (mode == S5P_JPEG_RAW_IN_565)
m = S5P_MOD_SEL_565;
else if (mode == S5P_JPEG_RAW_IN_422)
m = S5P_MOD_SEL_422;
reg = readl(regs + S5P_JPGCMOD);
reg &= ~S5P_MOD_SEL_MASK;
reg |= m;
writel(reg, regs + S5P_JPGCMOD);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 71 | 98.61% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.39% | 1 | 50.00% |
| Total | 72 | 100.00% | 2 | 100.00% |
void s5p_jpeg_proc_mode(void __iomem *regs, unsigned long mode)
{
unsigned long reg, m;
m = S5P_PROC_MODE_DECOMPR;
if (mode == S5P_JPEG_ENCODE)
m = S5P_PROC_MODE_COMPR;
else
m = S5P_PROC_MODE_DECOMPR;
reg = readl(regs + S5P_JPGMOD);
reg &= ~S5P_PROC_MODE_MASK;
reg |= m;
writel(reg, regs + S5P_JPGMOD);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 65 | 98.48% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.52% | 1 | 50.00% |
| Total | 66 | 100.00% | 2 | 100.00% |
void s5p_jpeg_subsampling_mode(void __iomem *regs, unsigned int mode)
{
unsigned long reg, m;
if (mode == V4L2_JPEG_CHROMA_SUBSAMPLING_420)
m = S5P_SUBSAMPLING_MODE_420;
else
m = S5P_SUBSAMPLING_MODE_422;
reg = readl(regs + S5P_JPGMOD);
reg &= ~S5P_SUBSAMPLING_MODE_MASK;
reg |= m;
writel(reg, regs + S5P_JPGMOD);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 56 | 90.32% | 1 | 33.33% |
sylwester nawrocki | sylwester nawrocki | 5 | 8.06% | 1 | 33.33% |
jacek anaszewski | jacek anaszewski | 1 | 1.61% | 1 | 33.33% |
| Total | 62 | 100.00% | 3 | 100.00% |
unsigned int s5p_jpeg_get_subsampling_mode(void __iomem *regs)
{
return readl(regs + S5P_JPGMOD) & S5P_SUBSAMPLING_MODE_MASK;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
sylwester nawrocki | sylwester nawrocki | 20 | 95.24% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 4.76% | 1 | 50.00% |
| Total | 21 | 100.00% | 2 | 100.00% |
void s5p_jpeg_dri(void __iomem *regs, unsigned int dri)
{
unsigned long reg;
reg = readl(regs + S5P_JPGDRI_U);
reg &= ~0xff;
reg |= (dri >> 8) & 0xff;
writel(reg, regs + S5P_JPGDRI_U);
reg = readl(regs + S5P_JPGDRI_L);
reg &= ~0xff;
reg |= dri & 0xff;
writel(reg, regs + S5P_JPGDRI_L);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 79 | 98.75% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.25% | 1 | 50.00% |
| Total | 80 | 100.00% | 2 | 100.00% |
void s5p_jpeg_qtbl(void __iomem *regs, unsigned int t, unsigned int n)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_QTBL);
reg &= ~S5P_QT_NUMt_MASK(t);
reg |= (n << S5P_QT_NUMt_SHIFT(t)) & S5P_QT_NUMt_MASK(t);
writel(reg, regs + S5P_JPG_QTBL);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 63 | 98.44% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.56% | 1 | 50.00% |
| Total | 64 | 100.00% | 2 | 100.00% |
void s5p_jpeg_htbl_ac(void __iomem *regs, unsigned int t)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_HTBL);
reg &= ~S5P_HT_NUMt_AC_MASK(t);
/* this driver uses table 0 for all color components */
reg |= (0 << S5P_HT_NUMt_AC_SHIFT(t)) & S5P_HT_NUMt_AC_MASK(t);
writel(reg, regs + S5P_JPG_HTBL);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 60 | 98.36% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.64% | 1 | 50.00% |
| Total | 61 | 100.00% | 2 | 100.00% |
void s5p_jpeg_htbl_dc(void __iomem *regs, unsigned int t)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_HTBL);
reg &= ~S5P_HT_NUMt_DC_MASK(t);
/* this driver uses table 0 for all color components */
reg |= (0 << S5P_HT_NUMt_DC_SHIFT(t)) & S5P_HT_NUMt_DC_MASK(t);
writel(reg, regs + S5P_JPG_HTBL);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 60 | 98.36% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.64% | 1 | 50.00% |
| Total | 61 | 100.00% | 2 | 100.00% |
void s5p_jpeg_y(void __iomem *regs, unsigned int y)
{
unsigned long reg;
reg = readl(regs + S5P_JPGY_U);
reg &= ~0xff;
reg |= (y >> 8) & 0xff;
writel(reg, regs + S5P_JPGY_U);
reg = readl(regs + S5P_JPGY_L);
reg &= ~0xff;
reg |= y & 0xff;
writel(reg, regs + S5P_JPGY_L);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 79 | 98.75% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.25% | 1 | 50.00% |
| Total | 80 | 100.00% | 2 | 100.00% |
void s5p_jpeg_x(void __iomem *regs, unsigned int x)
{
unsigned long reg;
reg = readl(regs + S5P_JPGX_U);
reg &= ~0xff;
reg |= (x >> 8) & 0xff;
writel(reg, regs + S5P_JPGX_U);
reg = readl(regs + S5P_JPGX_L);
reg &= ~0xff;
reg |= x & 0xff;
writel(reg, regs + S5P_JPGX_L);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 79 | 98.75% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.25% | 1 | 50.00% |
| Total | 80 | 100.00% | 2 | 100.00% |
void s5p_jpeg_rst_int_enable(void __iomem *regs, bool enable)
{
unsigned long reg;
reg = readl(regs + S5P_JPGINTSE);
reg &= ~S5P_RSTm_INT_EN_MASK;
if (enable)
reg |= S5P_RSTm_INT_EN;
writel(reg, regs + S5P_JPGINTSE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 47 | 97.92% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 2.08% | 1 | 50.00% |
| Total | 48 | 100.00% | 2 | 100.00% |
void s5p_jpeg_data_num_int_enable(void __iomem *regs, bool enable)
{
unsigned long reg;
reg = readl(regs + S5P_JPGINTSE);
reg &= ~S5P_DATA_NUM_INT_EN_MASK;
if (enable)
reg |= S5P_DATA_NUM_INT_EN;
writel(reg, regs + S5P_JPGINTSE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 47 | 97.92% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 2.08% | 1 | 50.00% |
| Total | 48 | 100.00% | 2 | 100.00% |
void s5p_jpeg_final_mcu_num_int_enable(void __iomem *regs, bool enbl)
{
unsigned long reg;
reg = readl(regs + S5P_JPGINTSE);
reg &= ~S5P_FINAL_MCU_NUM_INT_EN_MASK;
if (enbl)
reg |= S5P_FINAL_MCU_NUM_INT_EN;
writel(reg, regs + S5P_JPGINTSE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 47 | 97.92% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 2.08% | 1 | 50.00% |
| Total | 48 | 100.00% | 2 | 100.00% |
int s5p_jpeg_timer_stat(void __iomem *regs)
{
return (int)((readl(regs + S5P_JPG_TIMER_ST) & S5P_TIMER_INT_STAT_MASK)
>> S5P_TIMER_INT_STAT_SHIFT);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 28 | 96.55% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 3.45% | 1 | 50.00% |
| Total | 29 | 100.00% | 2 | 100.00% |
void s5p_jpeg_clear_timer_stat(void __iomem *regs)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_TIMER_SE);
reg &= ~S5P_TIMER_INT_STAT_MASK;
writel(reg, regs + S5P_JPG_TIMER_SE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 36 | 97.30% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 2.70% | 1 | 50.00% |
| Total | 37 | 100.00% | 2 | 100.00% |
void s5p_jpeg_enc_stream_int(void __iomem *regs, unsigned long size)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_ENC_STREAM_INTSE);
reg &= ~S5P_ENC_STREAM_BOUND_MASK;
reg |= S5P_ENC_STREAM_INT_EN;
reg |= size & S5P_ENC_STREAM_BOUND_MASK;
writel(reg, regs + S5P_JPG_ENC_STREAM_INTSE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 50 | 98.04% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.96% | 1 | 50.00% |
| Total | 51 | 100.00% | 2 | 100.00% |
int s5p_jpeg_enc_stream_stat(void __iomem *regs)
{
return (int)(readl(regs + S5P_JPG_ENC_STREAM_INTST) &
S5P_ENC_STREAM_INT_STAT_MASK);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 24 | 96.00% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 4.00% | 1 | 50.00% |
| Total | 25 | 100.00% | 2 | 100.00% |
void s5p_jpeg_clear_enc_stream_stat(void __iomem *regs)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_ENC_STREAM_INTSE);
reg &= ~S5P_ENC_STREAM_INT_MASK;
writel(reg, regs + S5P_JPG_ENC_STREAM_INTSE);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 36 | 97.30% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 2.70% | 1 | 50.00% |
| Total | 37 | 100.00% | 2 | 100.00% |
void s5p_jpeg_outform_raw(void __iomem *regs, unsigned long format)
{
unsigned long reg, f;
f = S5P_DEC_OUT_FORMAT_422;
if (format == S5P_JPEG_RAW_OUT_422)
f = S5P_DEC_OUT_FORMAT_422;
else if (format == S5P_JPEG_RAW_OUT_420)
f = S5P_DEC_OUT_FORMAT_420;
reg = readl(regs + S5P_JPG_OUTFORM);
reg &= ~S5P_DEC_OUT_FORMAT_MASK;
reg |= f;
writel(reg, regs + S5P_JPG_OUTFORM);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 71 | 98.61% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.39% | 1 | 50.00% |
| Total | 72 | 100.00% | 2 | 100.00% |
void s5p_jpeg_jpgadr(void __iomem *regs, unsigned long addr)
{
writel(addr, regs + S5P_JPG_JPGADR);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 22 | 95.65% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 4.35% | 1 | 50.00% |
| Total | 23 | 100.00% | 2 | 100.00% |
void s5p_jpeg_imgadr(void __iomem *regs, unsigned long addr)
{
writel(addr, regs + S5P_JPG_IMGADR);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 22 | 95.65% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 4.35% | 1 | 50.00% |
| Total | 23 | 100.00% | 2 | 100.00% |
void s5p_jpeg_coef(void __iomem *regs, unsigned int i,
unsigned int j, unsigned int coef)
{
unsigned long reg;
reg = readl(regs + S5P_JPG_COEF(i));
reg &= ~S5P_COEFn_MASK(j);
reg |= (coef << S5P_COEFn_SHIFT(j)) & S5P_COEFn_MASK(j);
writel(reg, regs + S5P_JPG_COEF(i));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 73 | 98.65% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.35% | 1 | 50.00% |
| Total | 74 | 100.00% | 2 | 100.00% |
void s5p_jpeg_start(void __iomem *regs)
{
writel(1, regs + S5P_JSTART);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 18 | 94.74% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 5.26% | 1 | 50.00% |
| Total | 19 | 100.00% | 2 | 100.00% |
int s5p_jpeg_result_stat_ok(void __iomem *regs)
{
return (int)((readl(regs + S5P_JPGINTST) & S5P_RESULT_STAT_MASK)
>> S5P_RESULT_STAT_SHIFT);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 28 | 96.55% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 3.45% | 1 | 50.00% |
| Total | 29 | 100.00% | 2 | 100.00% |
int s5p_jpeg_stream_stat_ok(void __iomem *regs)
{
return !(int)((readl(regs + S5P_JPGINTST) & S5P_STREAM_STAT_MASK)
>> S5P_STREAM_STAT_SHIFT);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 29 | 96.67% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 3.33% | 1 | 50.00% |
| Total | 30 | 100.00% | 2 | 100.00% |
void s5p_jpeg_clear_int(void __iomem *regs)
{
readl(regs + S5P_JPGINTST);
writel(S5P_INT_RELEASE, regs + S5P_JPGCOM);
readl(regs + S5P_JPGOPR);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 32 | 96.97% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 3.03% | 1 | 50.00% |
| Total | 33 | 100.00% | 2 | 100.00% |
unsigned int s5p_jpeg_compressed_size(void __iomem *regs)
{
unsigned long jpeg_size = 0;
jpeg_size |= (readl(regs + S5P_JPGCNT_U) & 0xff) << 16;
jpeg_size |= (readl(regs + S5P_JPGCNT_M) & 0xff) << 8;
jpeg_size |= (readl(regs + S5P_JPGCNT_L) & 0xff);
return (unsigned int)jpeg_size;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 66 | 98.51% | 1 | 50.00% |
jacek anaszewski | jacek anaszewski | 1 | 1.49% | 1 | 50.00% |
| Total | 67 | 100.00% | 2 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
andrzej pietrasiewicz | andrzej pietrasiewicz | 1366 | 95.66% | 1 | 25.00% |
jacek anaszewski | jacek anaszewski | 33 | 2.31% | 1 | 25.00% |
sylwester nawrocki | sylwester nawrocki | 28 | 1.96% | 1 | 25.00% |
mauro carvalho chehab | mauro carvalho chehab | 1 | 0.07% | 1 | 25.00% |
| Total | 1428 | 100.00% | 4 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.