\hypertarget{ar5416__cal__adcgain_8c_source}{}\doxysection{ar5416\+\_\+cal\+\_\+adcgain.\+c}
\label{ar5416__cal__adcgain_8c_source}\index{dev/ath/ath\_hal/ar5416/ar5416\_cal\_adcgain.c@{dev/ath/ath\_hal/ar5416/ar5416\_cal\_adcgain.c}}
\mbox{\hyperlink{ar5416__cal__adcgain_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: ISC}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2002-\/2008 Sam Leffler, Errno Consulting}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2002-\/2008 Atheros Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00007}00007 \textcolor{comment}{ * Permission to use, copy, modify, and/or distribute this software for any}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00008}00008 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00009}00009 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00011}00011 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00012}00012 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00013}00013 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00014}00014 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00015}00015 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00016}00016 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00017}00017 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00019}00019 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00020}00020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}opt\_ah.h"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00023}00023 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah_8h}{ah.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__internal_8h}{ah\_internal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00025}00025 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__devid_8h}{ah\_devid.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00026}00026 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416_8h}{ar5416/ar5416.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416reg_8h}{ar5416/ar5416reg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416phy_8h}{ar5416/ar5416phy.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00031}00031 \textcolor{comment}{/* Adc Gain Cal aliases */}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00032}\mbox{\hyperlink{ar5416__cal__adcgain_8c_a3d3c1c53b00e0731ac8ef98139ae2462}{00032}} \textcolor{preprocessor}{\#define totalAdcIOddPhase(i)    caldata[0][i].u}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00033}\mbox{\hyperlink{ar5416__cal__adcgain_8c_a1efe5a3111c6666440f9ac93473e4251}{00033}} \textcolor{preprocessor}{\#define totalAdcIEvenPhase(i)   caldata[1][i].u}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00034}\mbox{\hyperlink{ar5416__cal__adcgain_8c_aca4a3f1920bebf559eb0adb0f15d430e}{00034}} \textcolor{preprocessor}{\#define totalAdcQOddPhase(i)    caldata[2][i].u}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00035}\mbox{\hyperlink{ar5416__cal__adcgain_8c_a3b0ba72e87537e0586a3fcfd686742b2}{00035}} \textcolor{preprocessor}{\#define totalAdcQEvenPhase(i)   caldata[3][i].u}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00037}00037 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00038}00038 \textcolor{comment}{ * Collect data from HW to later perform ADC Gain Calibration}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00039}00039 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00040}00040 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00041}\mbox{\hyperlink{ar5416__cal_8h_a9a722ca53761516c06e432e0198f9936}{00041}} \mbox{\hyperlink{ar5416__cal__adcgain_8c_a9a722ca53761516c06e432e0198f9936}{ar5416AdcGainCalCollect}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00042}00042 \{}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00043}00043         \textcolor{keyword}{struct }\mbox{\hyperlink{structar5416PerCal}{ar5416PerCal}} *cal = \&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00044}00044         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00046}00046         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00047}00047 \textcolor{comment}{        * Accumulate ADC Gain cal measures for active chains}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00048}00048 \textcolor{comment}{        */}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00049}00049         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ah__eeprom__v14_8h_ad1d293abc39be3a10fbd9f10d8de0235}{AR5416\_MAX\_CHAINS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00050}00050                 cal-\/>totalAdcIOddPhase(i) +=}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00051}00051                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_ace4bc38fcc62bee1fd10d5feee79830a}{AR\_PHY\_CAL\_MEAS\_0}}(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00052}00052                 cal-\/>totalAdcIEvenPhase(i) +=}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00053}00053                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a48a8cf0d84c8d8a83595da15e2ae958e}{AR\_PHY\_CAL\_MEAS\_1}}(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00054}00054                 cal-\/>totalAdcQOddPhase(i) +=}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00055}00055                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a2f11e34793a5c282eea2138850c6f98a}{AR\_PHY\_CAL\_MEAS\_2}}(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00056}00056                 cal-\/>totalAdcQEvenPhase(i) +=}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00057}00057                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_ac58be275a55e451a41c10262a4c6b615}{AR\_PHY\_CAL\_MEAS\_3}}(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00059}00059                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00060}00060                     \textcolor{stringliteral}{"{}\%d: Chn \%d oddi=0x\%08x; eveni=0x\%08x; oddq=0x\%08x; evenq=0x\%08x;\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00061}00061                     cal-\/>\mbox{\hyperlink{structar5416PerCal_a7f45e2ff414f7ff4bc2ef3913afa80fb}{calSamples}}, i, cal-\/>totalAdcIOddPhase(i),}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00062}00062                     cal-\/>totalAdcIEvenPhase(i), cal-\/>totalAdcQOddPhase(i),}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00063}00063                     cal-\/>totalAdcQEvenPhase(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00064}00064         \}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00065}00065 \}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00067}00067 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00068}00068 \textcolor{comment}{ * Use HW data to do ADC Gain Calibration}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00069}00069 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00070}00070 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00071}\mbox{\hyperlink{ar5416__cal_8h_a9a3578fe89c606854bb80da8d44cf447}{00071}} \mbox{\hyperlink{ar5416__cal__adcgain_8c_a9a3578fe89c606854bb80da8d44cf447}{ar5416AdcGainCalibration}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint8\_t numChains)}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00072}00072 \{}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00073}00073         \textcolor{keyword}{struct }\mbox{\hyperlink{structar5416PerCal}{ar5416PerCal}} *cal = \&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00074}00074         uint32\_t i;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00076}00076         \textcolor{keywordflow}{for} (i = 0; i < numChains; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00077}00077                 uint32\_t iOddMeasOffset  = cal-\/>totalAdcIOddPhase(i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00078}00078                 uint32\_t iEvenMeasOffset = cal-\/>totalAdcIEvenPhase(i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00079}00079                 uint32\_t qOddMeasOffset  = cal-\/>totalAdcQOddPhase(i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00080}00080                 uint32\_t qEvenMeasOffset = cal-\/>totalAdcQEvenPhase(i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00082}00082                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00083}00083                     \textcolor{stringliteral}{"{}Start ADC Gain Cal for Chain \%d\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00084}00084                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00085}00085                     \textcolor{stringliteral}{"{}  pwr\_meas\_odd\_i = 0x\%08x\(\backslash\)n"{}}, iOddMeasOffset);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00086}00086                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00087}00087                     \textcolor{stringliteral}{"{}  pwr\_meas\_even\_i = 0x\%08x\(\backslash\)n"{}}, iEvenMeasOffset);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00088}00088                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00089}00089                     \textcolor{stringliteral}{"{}  pwr\_meas\_odd\_q = 0x\%08x\(\backslash\)n"{}}, qOddMeasOffset);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00090}00090                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00091}00091                     \textcolor{stringliteral}{"{}  pwr\_meas\_even\_q = 0x\%08x\(\backslash\)n"{}}, qEvenMeasOffset);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00093}00093                 \textcolor{keywordflow}{if} (iOddMeasOffset != 0 \&\& qEvenMeasOffset != 0) \{}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00094}00094                         uint32\_t iGainMismatch =}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00095}00095                             ((iEvenMeasOffset*32)/iOddMeasOffset) \& 0x3f;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00096}00096                         uint32\_t qGainMismatch =}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00097}00097                             ((qOddMeasOffset*32)/qEvenMeasOffset) \& 0x3f;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00098}00098                         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00100}00100                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00101}00101                             \textcolor{stringliteral}{"{} gain\_mismatch\_i = 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00102}00102                             iGainMismatch);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00103}00103                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00104}00104                             \textcolor{stringliteral}{"{} gain\_mismatch\_q = 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00105}00105                             qGainMismatch);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00107}00107                         val = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_ac462821ebe10aeaf26930e1e347fe0d1}{AR\_PHY\_NEW\_ADC\_DC\_GAIN\_CORR}}(i));}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00108}00108                         val \&= 0xfffff000;}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00109}00109                         val |= (qGainMismatch) | (iGainMismatch << 6);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00110}00110                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5416phy_8h_ac462821ebe10aeaf26930e1e347fe0d1}{AR\_PHY\_NEW\_ADC\_DC\_GAIN\_CORR}}(i), val); }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00112}00112                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah,  \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}},}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00113}00113                             \textcolor{stringliteral}{"{}ADC Gain Cal done for Chain \%d\(\backslash\)n"{}}, i);}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00114}00114                 \}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00115}00115         \}}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00116}00116         \mbox{\hyperlink{ah__internal_8h_a115457790a8a1d2c0bf64407fee993c7}{OS\_REG\_SET\_BIT}}(ah, \mbox{\hyperlink{ar5416phy_8h_ac462821ebe10aeaf26930e1e347fe0d1}{AR\_PHY\_NEW\_ADC\_DC\_GAIN\_CORR}}(0),}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00117}00117             \mbox{\hyperlink{ar5416phy_8h_ac4a80a820fc1aa3aaca6e5b5d350fc1b}{AR\_PHY\_NEW\_ADC\_GAIN\_CORR\_ENABLE}});}
\DoxyCodeLine{\Hypertarget{ar5416__cal__adcgain_8c_source_l00118}00118 \}}

\end{DoxyCode}
