This patch removes the pmic_state instance from the sst driver code.
pmic_state variable is no longer required in the sst driver.
Change-Id: I1849fd586e5eee2bf8a1f42ecf2022f8fbe09f93
Signed-off-by: Dharageswari.R <Dharageswari.R@intel.com>
mutex_init(&sst_drv_ctx->stream_lock);
mutex_init(&sst_drv_ctx->sst_lock);
- sst_drv_ctx->pmic_state = SND_MAD_UN_INIT;
sst_drv_ctx->stream_cnt = 0;
sst_drv_ctx->encoded_cnt = 0;
iounmap(sst_drv_ctx->iram);
iounmap(sst_drv_ctx->mailbox);
iounmap(sst_drv_ctx->shim);
- sst_drv_ctx->pmic_state = SND_MAD_UN_INIT;
if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID) {
misc_deregister(&lpe_dev);
kfree(sst_drv_ctx->mmap_mem);
static int intel_sst_check_device(void)
{
int retval = 0;
- if (sst_drv_ctx->pmic_state != SND_MAD_INIT_DONE) {
- pr_warn("Sound card not available\n");
- return -EIO;
- }
if (sst_drv_ctx->sst_state == SST_UN_INIT) {
/* FW is not downloaded */
#define SPI_MODE_ENABLE_BASE_ADDR 0xffae4000
#define FW_SIGNATURE_SIZE 4
-/* PMIC and SST hardware states */
-enum sst_mad_states {
- SND_MAD_UN_INIT = 0,
- SND_MAD_INIT_DONE,
-};
-
/* stream states */
enum sst_stream_states {
STREAM_UN_INIT = 0, /* Freed/Not used stream */
/***
* struct intel_sst_drv - driver ops
*
- * @pmic_state : pmic state
* @pmic_vendor : pmic vendor detected
* @sst_state : current sst device state
* @pci_id : PCI device id loaded
* @max_streams : max streams allowed
*/
struct intel_sst_drv {
- bool pmic_state;
int pmic_vendor;
int sst_state;
unsigned int pci_id;
if (!sst_drv_ctx->fw) {
retval = request_firmware(&sst_drv_ctx->fw, name,
&sst_drv_ctx->pci->dev);
- pr_err("sst: requuest firmware %d\n", retval);
if (retval) {
pr_err("sst: request fw failed %d\n", retval);
return retval;
return -EINVAL;
}
sst_drv_ctx->pmic_vendor = card->vendor_id;
- sst_drv_ctx->pmic_state = SND_MAD_INIT_DONE;
sst_drv_ctx->rx_time_slot_status = 0; /*default AMIC*/
card->pcm_control = sst_pmic_ops.pcm_control;
return 0;
*/
void unregister_sst_card(struct intel_sst_card_ops *card)
{
- if (sst_pmic_ops.pcm_control == card->pcm_control) {
- /* unreg */
- sst_drv_ctx->pmic_state = SND_MAD_UN_INIT;
- }
return;
}
EXPORT_SYMBOL_GPL(unregister_sst_card);