Skip to content

Commit

Permalink
media: ti-vpe: cal: Rename cc_data to cal_camerarx
Browse files Browse the repository at this point in the history
The various data structures that describe the components of the camera
access layer (CAL) are named without much consistency. Start cleaning
this up by renaming the structure that describes the CAMERARX block,
cc_data, to cal_camerarx.

Signed-off-by: Laurent Pinchart <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Reviewed-by: Benoit Parrot <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pinchartl authored and sigmaris committed Aug 8, 2020
1 parent 8aa22d2 commit 825a2d9
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions drivers/media/platform/ti-vpe/cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,6 @@ enum cal_camerarx_field {
F_MAX_FIELDS,
};

struct cc_data {
void __iomem *base;
struct resource *res;
struct platform_device *pdev;

struct {
struct regmap_field *fields[F_MAX_FIELDS];
} phy;
};

struct cal_csi2_phy {
struct {
unsigned int lsb;
Expand Down Expand Up @@ -315,9 +305,26 @@ static const struct cal_data am654_cal_data = {
};

/*
* there is one cal_dev structure in the driver, it is shared by
* all instances.
* The Camera Adaptation Layer (CAL) module is paired with one or more complex
* I/O PHYs (CAMERARX). It contains multiple instances of CSI-2, processing and
* DMA contexts.
*
* The cal_dev structure represents the whole subsystem, including the CAL and
* the CAMERARX instances. The cal_camerarx structure represents one CAMERARX
* instance. The cal_ctx structure represents the combination of one CSI-2
* context, one processing context and one DMA context.
*/

struct cal_camerarx {
void __iomem *base;
struct resource *res;
struct platform_device *pdev;

struct {
struct regmap_field *fields[F_MAX_FIELDS];
} phy;
};

struct cal_dev {
struct clk *fclk;
int irq;
Expand All @@ -333,7 +340,7 @@ struct cal_dev {
u32 syscon_camerrx_offset;

/* Camera Core Module handle */
struct cc_data *cc[CAL_NUM_CSI2_PORTS];
struct cal_camerarx *cc[CAL_NUM_CSI2_PORTS];

struct cal_ctx *ctx[CAL_NUM_CONTEXT];
};
Expand All @@ -350,7 +357,7 @@ struct cal_ctx {
struct v4l2_fwnode_endpoint endpoint;

struct cal_dev *dev;
struct cc_data *cc;
struct cal_camerarx *cc;

/* v4l2_ioctl mutex */
struct mutex mutex;
Expand Down Expand Up @@ -457,7 +464,8 @@ static u32 cal_data_get_num_csi2_phy(struct cal_dev *dev)
return dev->data->num_csi2_phy;
}

static int cal_camerarx_regmap_init(struct cal_dev *dev, struct cc_data *cc,
static int cal_camerarx_regmap_init(struct cal_dev *dev,
struct cal_camerarx *cc,
unsigned int idx)
{
const struct cal_csi2_phy *phy;
Expand Down Expand Up @@ -528,7 +536,7 @@ static struct regmap *cal_get_camerarx_regmap(struct cal_dev *dev)
static void camerarx_phy_enable(struct cal_ctx *ctx)
{
u32 phy_id = ctx->csi2_port;
struct cc_data *cc = ctx->dev->cc[phy_id];
struct cal_camerarx *cc = ctx->dev->cc[phy_id];
u32 max_lanes;

regmap_field_write(cc->phy.fields[F_CAMMODE], 0);
Expand All @@ -544,18 +552,18 @@ static void camerarx_phy_enable(struct cal_ctx *ctx)
static void camerarx_phy_disable(struct cal_ctx *ctx)
{
u32 phy_id = ctx->csi2_port;
struct cc_data *cc = ctx->dev->cc[phy_id];
struct cal_camerarx *cc = ctx->dev->cc[phy_id];

regmap_field_write(cc->phy.fields[F_CTRLCLKEN], 0);
}

/*
* Camera Instance access block
*/
static struct cc_data *cc_create(struct cal_dev *dev, unsigned int core)
static struct cal_camerarx *cc_create(struct cal_dev *dev, unsigned int core)
{
struct platform_device *pdev = dev->pdev;
struct cc_data *cc;
struct cal_camerarx *cc;
int ret;

cc = devm_kzalloc(&pdev->dev, sizeof(*cc), GFP_KERNEL);
Expand Down

0 comments on commit 825a2d9

Please sign in to comment.