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

Commit 6351378c authored by Bao D. Nguyen's avatar Bao D. Nguyen
Browse files

mmc: Add MMC clock scaling support in the block layer



Add the clock scaling support for SD card in the block layer.

Change-Id: Iac02d68ce01dd2f2437b1b09dba1070c63aa0317
Signed-off-by: default avatarBao D. Nguyen <nguyenb@codeaurora.org>
parent 4c36c737
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -81,3 +81,10 @@ config MMC_TEST
	  This driver is only of interest to those developing or
	  testing a host driver. Most people should say N here.

config SDC_QTI
	tristate "Enable QTI specific code in MMC upstream driver"
	depends on QGKI && MMC_SDHCI_MSM
	default n
	help
	  This configuration flag allows adding QTI code in
	  MMC upstream driver.
+9 −2
Original line number Diff line number Diff line
@@ -892,7 +892,9 @@ static inline int mmc_blk_part_switch(struct mmc_card *card,
		}

		card->ext_csd.part_config = part_config;

#if defined(CONFIG_SDC_QTI)
		card->part_curr = part_type;
#endif
		ret = mmc_blk_part_switch_post(card, main_md->part_curr);
	}

@@ -1949,13 +1951,18 @@ static void mmc_blk_mq_poll_completion(struct mmc_queue *mq,

static void mmc_blk_mq_dec_in_flight(struct mmc_queue *mq, struct request *req)
{
#if defined(CONFIG_SDC_QTI)
	struct mmc_host *host = mq->card->host;
#endif
	unsigned long flags;
	bool put_card;

	spin_lock_irqsave(&mq->lock, flags);

	mq->in_flight[mmc_issue_type(mq, req)] -= 1;

#if defined(CONFIG_SDC_QTI)
	atomic_dec(&host->active_reqs);
#endif
	put_card = (mmc_tot_in_flight(mq) == 0);

	spin_unlock_irqrestore(&mq->lock, flags);
+6 −0
Original line number Diff line number Diff line
@@ -296,6 +296,9 @@ static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
	mq->busy = true;

	mq->in_flight[issue_type] += 1;
#if defined(CONFIG_SDC_QTI)
	atomic_inc(&host->active_reqs);
#endif
	get_card = (mmc_tot_in_flight(mq) == 1);
	cqe_retune_ok = (mmc_cqe_qcnt(mq) == 1);

@@ -335,6 +338,9 @@ static blk_status_t mmc_mq_queue_rq(struct blk_mq_hw_ctx *hctx,

		spin_lock_irq(&mq->lock);
		mq->in_flight[issue_type] -= 1;
#if defined(CONFIG_SDC_QTI)
		atomic_dec(&host->active_reqs);
#endif
		if (mmc_tot_in_flight(mq) == 0)
			put_card = true;
		mq->busy = false;
+3 −1
Original line number Diff line number Diff line
@@ -307,7 +307,9 @@ struct mmc_card {
	struct dentry		*debugfs_root;
	struct mmc_part	part[MMC_NUM_PHY_PARTITION]; /* physical partitions */
	unsigned int    nr_parts;

#if defined(CONFIG_SDC_QTI)
	unsigned int            part_curr;
#endif
	unsigned int		bouncesz;	/* Bounce buffer size */
	struct workqueue_struct *complete_wq;	/* Private workqueue */
};
+3 −2
Original line number Diff line number Diff line
@@ -369,7 +369,6 @@ struct mmc_host {
#define MMC_CAP2_CQE_DCMD	(1 << 24)	/* CQE can issue a direct command */
#define MMC_CAP2_AVOID_3_3V	(1 << 25)	/* Host must negotiate down from 3.3V */
#define MMC_CAP2_MERGE_CAPABLE	(1 << 26)	/* Host can merge a segment over the segment size */

	int			fixed_drv_type;	/* fixed driver type for non-removable media */

	mmc_pm_flag_t		pm_caps;	/* supported pm features */
@@ -461,7 +460,9 @@ struct mmc_host {
	int			cqe_qdepth;
	bool			cqe_enabled;
	bool			cqe_on;

#if defined(CONFIG_SDC_QTI)
	atomic_t active_reqs;
#endif
	unsigned long		private[0] ____cacheline_aligned;
};