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

Commit cd1b0b74 authored by Asutosh Das's avatar Asutosh Das
Browse files

ufs: ufshcd: Add check for broken auto-h8 support



Add quirk for broken auto-hibern8 support.
It also retries to get the clock if clk_get fails.

Change-Id: I8862ebd31eb61b7cac6c88f66cbfe4f8255682cf
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 42012669
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * This code is based on drivers/scsi/ufs/ufshcd.c
 * Copyright (C) 2011-2013 Samsung India Software Operations
 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * Authors:
 *	Santosh Yaraganavi <santosh.sy@samsung.com>
@@ -3908,7 +3908,8 @@ static void ufshcd_auto_hibern8_enable(struct ufs_hba *hba)
{
	unsigned long flags;

	if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) || !hba->ahit)
	if (!(hba->capabilities & MASK_AUTO_HIBERN8_SUPPORT) || !hba->ahit
	    || (hba->quirks & UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8))
		return;

	spin_lock_irqsave(hba->host->host_lock, flags);
@@ -6741,6 +6742,10 @@ void ufshcd_parse_dev_ref_clk_freq(struct ufs_hba *hba, struct clk *refclk)
	unsigned long freq;

	freq = clk_get_rate(refclk);
	if (freq == 0) {
		dev_warn(hba->dev, " (%s) clk_get_rate - %d\n", __func__, freq);
		freq = clk_round_rate(refclk, 19200000);
	}

	hba->dev_ref_clk_freq =
		ufs_get_bref_clk_from_hz(freq);
+3 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * This code is based on drivers/scsi/ufs/ufshcd.h
 * Copyright (C) 2011-2013 Samsung India Software Operations
 * Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * Authors:
 *	Santosh Yaraganavi <santosh.sy@samsung.com>
@@ -72,6 +72,8 @@
#define UFSHCD "ufshcd"
#define UFSHCD_DRIVER_VERSION "0.2"

#define UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8                0x40000

struct ufs_hba;

enum dev_cmd_type {