Skip to content

Commit

Permalink
intel_sst: MSIC codec power optimisation
Browse files Browse the repository at this point in the history
This patch adds power optimization for the msic codec and ensure
codec is completely powered off when codec is idle.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Ramesh Babu K V <ramesh.babu@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vinod Koul authored and Greg Kroah-Hartman committed May 10, 2011
1 parent 6c55005 commit b06a584
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 100 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/intel_sst/intel_sst.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ struct snd_pmic_ops {

int (*power_up_pmic_pb) (unsigned int port);
int (*power_up_pmic_cp) (unsigned int port);
int (*power_down_pmic_pb) (void);
int (*power_down_pmic_cp) (void);
int (*power_down_pmic_pb) (unsigned int device);
int (*power_down_pmic_cp) (unsigned int device);
int (*power_down_pmic) (void);
};

Expand Down
10 changes: 6 additions & 4 deletions drivers/staging/intel_sst/intel_sst_drv_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,23 @@ void free_stream_context(unsigned int str_id)
if (!sst_validate_strid(str_id)) {
/* str_id is valid, so stream is alloacted */
stream = &sst_drv_ctx->streams[str_id];
if (sst_free_stream(str_id))
sst_clean_stream(&sst_drv_ctx->streams[str_id]);
if (stream->ops == STREAM_OPS_PLAYBACK ||
stream->ops == STREAM_OPS_PLAYBACK_DRM) {
sst_drv_ctx->pb_streams--;
if (sst_drv_ctx->pb_streams == 0)
sst_drv_ctx->scard_ops->power_down_pmic_pb();
sst_drv_ctx->scard_ops->power_down_pmic_pb(
stream->device);
} else if (stream->ops == STREAM_OPS_CAPTURE) {
sst_drv_ctx->cp_streams--;
if (sst_drv_ctx->cp_streams == 0)
sst_drv_ctx->scard_ops->power_down_pmic_cp();
sst_drv_ctx->scard_ops->power_down_pmic_cp(
stream->device);
}
if (sst_drv_ctx->pb_streams == 0
&& sst_drv_ctx->cp_streams == 0)
sst_drv_ctx->scard_ops->power_down_pmic();
if (sst_free_stream(str_id))
sst_clean_stream(&sst_drv_ctx->streams[str_id]);
}
}

Expand Down
Loading

0 comments on commit b06a584

Please sign in to comment.