Commit db3cbaa4 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: remove otp power control functions

For the devices supported by brcmsmac driver the OTP device is always
powered. Functions for reading power status and changing it are not
needed.
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c2c72497
...@@ -2277,17 +2277,3 @@ bool ai_is_otp_disabled(struct si_pub *sih) ...@@ -2277,17 +2277,3 @@ bool ai_is_otp_disabled(struct si_pub *sih)
return false; return false;
} }
} }
bool ai_is_otp_powered(struct si_pub *sih)
{
if (PMUCTL_ENAB(sih))
return si_pmu_is_otp_powered(sih);
return true;
}
void ai_otp_power(struct si_pub *sih, bool on)
{
if (PMUCTL_ENAB(sih))
si_pmu_otp_power(sih, on);
udelay(1000);
}
...@@ -558,8 +558,6 @@ extern u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val, ...@@ -558,8 +558,6 @@ extern u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val,
/* OTP status */ /* OTP status */
extern bool ai_is_otp_disabled(struct si_pub *sih); extern bool ai_is_otp_disabled(struct si_pub *sih);
extern bool ai_is_otp_powered(struct si_pub *sih);
extern void ai_otp_power(struct si_pub *sih, bool on);
/* SPROM availability */ /* SPROM availability */
extern bool ai_is_sprom_available(struct si_pub *sih); extern bool ai_is_sprom_available(struct si_pub *sih);
......
...@@ -310,10 +310,7 @@ static void *ipxotp_init(struct si_pub *sih) ...@@ -310,10 +310,7 @@ static void *ipxotp_init(struct si_pub *sih)
if (ai_is_otp_disabled(sih)) if (ai_is_otp_disabled(sih))
return NULL; return NULL;
/* Make sure OTP is powered up */ /* OTP is always powered */
if (!ai_is_otp_powered(sih))
return NULL;
oi = &otpinfo; oi = &otpinfo;
/* Check for otp size */ /* Check for otp size */
...@@ -518,15 +515,10 @@ void *otp_init(struct si_pub *sih) ...@@ -518,15 +515,10 @@ void *otp_init(struct si_pub *sih)
int int
otp_read_region(struct si_pub *sih, int region, u16 *data, otp_read_region(struct si_pub *sih, int region, u16 *data,
uint *wlen) { uint *wlen) {
bool wasup = false;
void *oh; void *oh;
int err = 0; int err = 0;
wasup = ai_is_otp_powered(sih); if (ai_is_otp_disabled(sih)) {
if (!wasup)
ai_otp_power(sih, true);
if (!ai_is_otp_powered(sih) || ai_is_otp_disabled(sih)) {
err = -EPERM; err = -EPERM;
goto out; goto out;
} }
...@@ -540,9 +532,6 @@ otp_read_region(struct si_pub *sih, int region, u16 *data, ...@@ -540,9 +532,6 @@ otp_read_region(struct si_pub *sih, int region, u16 *data,
err = (((otpinfo_t *) oh)->fn->read_region) (oh, region, data, wlen); err = (((otpinfo_t *) oh)->fn->read_region) (oh, region, data, wlen);
out: out:
if (!wasup)
ai_otp_power(sih, false);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment