/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2021 MediaTek Inc.
 */

#ifndef __JPEG_DRV_REG_H__
#define __JPEG_DRV_REG_H__

#include <linux/io.h>
#include "jpeg_drv.h"

#define JPEG_HYBRID_DEC_BASE(i)   jpeg_dev_get_hybrid_decoder_base_VA(i)

#define IMG_REG_WRITE(v, a) writel(v, (void __iomem *)a)
#define IMG_REG_READ(a)     readl((void __iomem *)a)

#define REG_JPGDEC_HYBRID_090(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0090)
#define REG_JPGDEC_HYBRID_0FC(X) (JPEG_HYBRID_DEC_BASE(X) + 0x00FC)
#define REG_JPGDEC_HYBRID_14C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x014C)
#define REG_JPGDEC_HYBRID_150(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0150)
#define REG_JPGDEC_HYBRID_154(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0154)
#define REG_JPGDEC_HYBRID_17C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x017C)
#define REG_JPGDEC_HYBRID_200(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0200)
#define REG_JPGDEC_HYBRID_20C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x020C)
#define REG_JPGDEC_HYBRID_210(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0210)
#define REG_JPGDEC_HYBRID_224(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0224)
#define REG_JPGDEC_HYBRID_23C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x023C)
#define REG_JPGDEC_HYBRID_240(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0240)
#define REG_JPGDEC_HYBRID_24C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x024C)
#define REG_JPGDEC_HYBRID_270(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0270)
#define REG_JPGDEC_HYBRID_274(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0274)
#define REG_JPGDEC_HYBRID_31C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x031C)
#define REG_JPGDEC_HYBRID_330(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0330)
#define REG_JPGDEC_HYBRID_334(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0334)
#define REG_JPGDEC_HYBRID_338(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0338)
#define REG_JPGDEC_HYBRID_33C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x033C)
#define REG_JPGDEC_HYBRID_340(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0340)
#define REG_JPGDEC_HYBRID_344(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0344)
#define REG_JPGDEC_HYBRID_348(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0348)
#define REG_JPGDEC_HYBRID_36C(X) (JPEG_HYBRID_DEC_BASE(X) + 0x036C)
#define REG_JPGDEC_HYBRID_370(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0370)
#define REG_JPGDEC_HYBRID_374(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0374)
#define REG_JPGDEC_HYBRID_378(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0378)
#define REG_JPGDEC_HYBRID_384(X) (JPEG_HYBRID_DEC_BASE(X) + 0x0384)

#endif
