mfd: rtsx: Add shutdown callback in rtsx_pci_driver

Some actions to clear power state should be handled in .shutdown
callback in rtsx_pci_driver. This patch adopts the following measures to
catch this goal:
1. Add a function rtsx_pci_power_off to abstract the common ops in
.shutdown and .suspend
2. Add pcr->ops->force_power_down to fulfill the individual action for
each reader model

Signed-off-by: Wei WANG <wei_wang@realsil.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Wei WANG 2013-08-20 14:18:52 +08:00 committed by Samuel Ortiz
parent 773ccdfd9c
commit 5947c167d1
7 changed files with 85 additions and 12 deletions

View file

@ -25,8 +25,7 @@
#include <linux/sched.h>
#include <linux/pci.h>
#include "rtsx_common.h"
#include <linux/mfd/rtsx_common.h>
#define MAX_RW_REG_CNT 1024
@ -536,6 +535,10 @@
#define SAMPLE_VAR_CLK0 (0x01 << 4)
#define SAMPLE_VAR_CLK1 (0x02 << 4)
/* HOST_SLEEP_STATE */
#define HOST_ENTER_S1 1
#define HOST_ENTER_S3 2
#define MS_CFG 0xFD40
#define MS_TPC 0xFD41
#define MS_TRANS_CFG 0xFD42
@ -701,6 +704,11 @@
#define AUTOLOAD_CFG_BASE 0xFF00
#define PM_CTRL1 0xFF44
#define PM_CTRL2 0xFF45
#define PM_CTRL3 0xFF46
#define PM_CTRL4 0xFF47
/* Memory mapping */
#define SRAM_BASE 0xE600
#define RBUF_BASE 0xF400
@ -770,6 +778,7 @@ struct pcr_ops {
unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
int (*conv_clk_and_div_n)(int clk, int dir);
void (*fetch_vendor_settings)(struct rtsx_pcr *pcr);
void (*force_power_down)(struct rtsx_pcr *pcr);
};
enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};