mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
media: nxp: imx8-isi: Add ISI support for i.MX93
i.MX93 uses a different gasket which has different register definitions compared with i.MX8. Hence implement the gasket callbacks in order to add ISI support for i.MX93. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
f48498ad0a
commit
12cc6da36a
|
|
@ -307,6 +307,20 @@ static const struct mxc_isi_plat_data mxc_imx8mp_data = {
|
|||
.has_36bit_dma = true,
|
||||
};
|
||||
|
||||
static const struct mxc_isi_plat_data mxc_imx93_data = {
|
||||
.model = MXC_ISI_IMX93,
|
||||
.num_ports = 1,
|
||||
.num_channels = 1,
|
||||
.reg_offset = 0,
|
||||
.ier_reg = &mxc_imx8_isi_ier_v2,
|
||||
.set_thd = &mxc_imx8_isi_thd_v1,
|
||||
.clks = mxc_imx8mn_clks,
|
||||
.num_clks = ARRAY_SIZE(mxc_imx8mn_clks),
|
||||
.buf_active_reverse = true,
|
||||
.gasket_ops = &mxc_imx93_gasket_ops,
|
||||
.has_36bit_dma = false,
|
||||
};
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Power management
|
||||
*/
|
||||
|
|
@ -518,6 +532,7 @@ static int mxc_isi_remove(struct platform_device *pdev)
|
|||
static const struct of_device_id mxc_isi_of_match[] = {
|
||||
{ .compatible = "fsl,imx8mn-isi", .data = &mxc_imx8mn_data },
|
||||
{ .compatible = "fsl,imx8mp-isi", .data = &mxc_imx8mp_data },
|
||||
{ .compatible = "fsl,imx93-isi", .data = &mxc_imx93_data },
|
||||
{ /* sentinel */ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mxc_isi_of_match);
|
||||
|
|
|
|||
|
|
@ -158,6 +158,7 @@ struct mxc_gasket_ops {
|
|||
enum model {
|
||||
MXC_ISI_IMX8MN,
|
||||
MXC_ISI_IMX8MP,
|
||||
MXC_ISI_IMX93,
|
||||
};
|
||||
|
||||
struct mxc_isi_plat_data {
|
||||
|
|
@ -295,6 +296,7 @@ struct mxc_isi_dev {
|
|||
};
|
||||
|
||||
extern const struct mxc_gasket_ops mxc_imx8_gasket_ops;
|
||||
extern const struct mxc_gasket_ops mxc_imx93_gasket_ops;
|
||||
|
||||
int mxc_isi_crossbar_init(struct mxc_isi_dev *isi);
|
||||
void mxc_isi_crossbar_cleanup(struct mxc_isi_crossbar *xbar);
|
||||
|
|
|
|||
|
|
@ -52,3 +52,34 @@ const struct mxc_gasket_ops mxc_imx8_gasket_ops = {
|
|||
.enable = mxc_imx8_gasket_enable,
|
||||
.disable = mxc_imx8_gasket_disable,
|
||||
};
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* i.MX93 gasket
|
||||
*/
|
||||
|
||||
#define DISP_MIX_CAMERA_MUX 0x30
|
||||
#define DISP_MIX_CAMERA_MUX_DATA_TYPE(x) (((x) & 0x3f) << 3)
|
||||
#define DISP_MIX_CAMERA_MUX_GASKET_ENABLE BIT(16)
|
||||
|
||||
static void mxc_imx93_gasket_enable(struct mxc_isi_dev *isi,
|
||||
const struct v4l2_mbus_frame_desc *fd,
|
||||
const struct v4l2_mbus_framefmt *fmt,
|
||||
const unsigned int port)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
val = DISP_MIX_CAMERA_MUX_DATA_TYPE(fd->entry[0].bus.csi2.dt);
|
||||
val |= DISP_MIX_CAMERA_MUX_GASKET_ENABLE;
|
||||
regmap_write(isi->gasket, DISP_MIX_CAMERA_MUX, val);
|
||||
}
|
||||
|
||||
static void mxc_imx93_gasket_disable(struct mxc_isi_dev *isi,
|
||||
unsigned int port)
|
||||
{
|
||||
regmap_write(isi->gasket, DISP_MIX_CAMERA_MUX, 0);
|
||||
}
|
||||
|
||||
const struct mxc_gasket_ops mxc_imx93_gasket_ops = {
|
||||
.enable = mxc_imx93_gasket_enable,
|
||||
.disable = mxc_imx93_gasket_disable,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user