linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 06/10] staging: rtl8188eu: remove efuse write support
Date: Sun, 18 Jul 2021 19:36:06 +0200	[thread overview]
Message-ID: <20210718173610.894-6-martin@kaiser.cx> (raw)
In-Reply-To: <20210718173610.894-1-martin@kaiser.cx>

This driver does not need write access to the rtl1888eu chip's efuses.
Remove the code to set the voltages for writing the efuses.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 32 ++--------------------
 1 file changed, 3 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 80673a73c119..0b821df58b77 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -16,18 +16,8 @@
 #define REG_EFUSE_CTRL		0x0030
 #define EFUSE_CTRL			REG_EFUSE_CTRL		/*  E-Fuse Control. */
 
-enum{
-		VOLTAGE_V25						= 0x03,
-		LDOE25_SHIFT						= 28,
-	};
-
-/*
- * When we want to enable write operation, we should change to pwr on state.
- * When we stop write, we should switch to 500k mode and disable LDO 2.5V.
- */
-static void efuse_power_switch(struct adapter *pAdapter, u8 write, u8 pwrstate)
+static void efuse_power_switch(struct adapter *pAdapter, u8 pwrstate)
 {
-	u8 tempval;
 	u16 tmpv16;
 
 	if (pwrstate) {
@@ -52,22 +42,8 @@ static void efuse_power_switch(struct adapter *pAdapter, u8 write, u8 pwrstate)
 			tmpv16 |= (LOADER_CLK_EN | ANA8M);
 			usb_write16(pAdapter, REG_SYS_CLKR, tmpv16);
 		}
-
-		if (write) {
-			/*  Enable LDO 2.5V before read/write action */
-			tempval = usb_read8(pAdapter, EFUSE_TEST + 3);
-			tempval &= 0x0F;
-			tempval |= (VOLTAGE_V25 << 4);
-			usb_write8(pAdapter, EFUSE_TEST + 3, (tempval | 0x80));
-		}
 	} else {
 		usb_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF);
-
-		if (write) {
-			/*  Disable LDO 2.5V after read/write action */
-			tempval = usb_read8(pAdapter, EFUSE_TEST + 3);
-			usb_write8(pAdapter, EFUSE_TEST + 3, (tempval & 0x7F));
-		}
 	}
 }
 
@@ -857,11 +833,9 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata)
 /* Read All Efuse content */
 static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 *Efuse)
 {
-	efuse_power_switch(pAdapter, false, true);
-
+	efuse_power_switch(pAdapter, true);
 	efuse_ReadEFuse(pAdapter, 0, EFUSE_MAP_LEN_88E, Efuse);
-
-	efuse_power_switch(pAdapter, false, false);
+	efuse_power_switch(pAdapter, false);
 }
 
 /* Transfer current EFUSE content to shadow init and modify map. */
-- 
2.20.1


  parent reply	other threads:[~2021-07-18 17:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18 17:36 [PATCH 01/10] staging: rtl8188eu: merge two functions Martin Kaiser
2021-07-18 17:36 ` [PATCH 02/10] staging: rtl8188eu: remove the "trigger gpio 0" hal variable Martin Kaiser
2021-07-18 17:36 ` [PATCH 03/10] staging: rtl8188eu: remove RTL871X_HCI_TYPE enum Martin Kaiser
2021-07-18 17:36 ` [PATCH 04/10] staging: rtl8188eu: remove _CHIP_TYPE enum Martin Kaiser
2021-07-18 17:36 ` [PATCH 05/10] staging: rtl8188eu: remove struct eeprom_priv's EepromOrEfuse Martin Kaiser
2021-07-18 17:36 ` Martin Kaiser [this message]
2021-07-18 17:36 ` [PATCH 07/10] staging: rtl8188eu: remove unused power flows and transitions Martin Kaiser
2021-07-18 17:36 ` [PATCH 08/10] staging: rtl8188eu: remove constant function parameter Martin Kaiser
2021-07-18 17:36 ` [PATCH 09/10] staging: rtl8188eu: remove PWR_CMD_READ Martin Kaiser
2021-07-18 17:36 ` [PATCH 10/10] staging: rtl8188eu: remove cut_mask field from wl_pwr_cfg Martin Kaiser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210718173610.894-6-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --subject='Re: [PATCH 06/10] staging: rtl8188eu: remove efuse write support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox