Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccb56218 authored by Lloyd Atkinson's avatar Lloyd Atkinson
Browse files

drm/msm/sde: add container_of functions for sde hw



Add container functions to convert to the common hw_blk base
type for all the sde hardware blocks.

Change-Id: I4be8e5e541e0eb9a030fdaac97f79b1b1f068f35
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 4a752fc3
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -107,6 +107,16 @@ struct sde_hw_cdm {
	struct sde_hw_cdm_ops ops;
};

/**
 * sde_hw_cdm - convert base object sde_hw_base to container
 * @hw: Pointer to base hardware block
 * return: Pointer to hardware block container
 */
static inline struct sde_hw_cdm *to_sde_hw_cdm(struct sde_hw_blk *hw)
{
	return container_of(hw, struct sde_hw_cdm, base);
}

/**
 * sde_hw_cdm_init - initializes the cdm hw driver object.
 * should be called once before accessing every cdm.
+10 −0
Original line number Diff line number Diff line
@@ -234,6 +234,16 @@ struct sde_hw_ctl {
	struct sde_hw_ctl_ops ops;
};

/**
 * sde_hw_ctl - convert base object sde_hw_base to container
 * @hw: Pointer to base hardware block
 * return: Pointer to hardware block container
 */
static inline struct sde_hw_ctl *to_sde_hw_ctl(struct sde_hw_blk *hw)
{
	return container_of(hw, struct sde_hw_ctl, base);
}

/**
 * sde_hw_ctl_init(): Initializes the ctl_path hw driver object.
 * should be called before accessing every ctl path registers.
+10 −0
Original line number Diff line number Diff line
@@ -68,6 +68,16 @@ struct sde_hw_dsc {
	struct sde_hw_dsc_ops ops;
};

/**
 * sde_hw_dsc - convert base object sde_hw_base to container
 * @hw: Pointer to base hardware block
 * return: Pointer to hardware block container
 */
static inline struct sde_hw_dsc *to_sde_hw_dsc(struct sde_hw_blk *hw)
{
	return container_of(hw, struct sde_hw_dsc, base);
}

/**
 * sde_hw_dsc_init - initializes the dsc block for the passed
 *                   dsc idx.
+10 −0
Original line number Diff line number Diff line
@@ -186,6 +186,16 @@ struct sde_hw_dspp {
	struct sde_hw_dspp_ops ops;
};

/**
 * sde_hw_dspp - convert base object sde_hw_base to container
 * @hw: Pointer to base hardware block
 * return: Pointer to hardware block container
 */
static inline struct sde_hw_dspp *to_sde_hw_dspp(struct sde_hw_blk *hw)
{
	return container_of(hw, struct sde_hw_dspp, base);
}

/**
 * sde_hw_dspp_init - initializes the dspp hw driver object.
 * should be called once before accessing every dspp.
+10 −0
Original line number Diff line number Diff line
@@ -99,6 +99,16 @@ struct sde_hw_intf {
	struct sde_hw_intf_ops ops;
};

/**
 * to_sde_hw_intf - convert base object sde_hw_base to container
 * @hw: Pointer to base hardware block
 * return: Pointer to hardware block container
 */
static inline struct sde_hw_intf *to_sde_hw_intf(struct sde_hw_blk *hw)
{
	return container_of(hw, struct sde_hw_intf, base);
}

/**
 * sde_hw_intf_init(): Initializes the intf driver for the passed
 * interface idx.
Loading