18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci/* Definitions for RTL8187SE hardware
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright 2009 Larry Finger <Larry.Finger@lwfinger.net>
68c2ecf20Sopenharmony_ci * Copyright 2014 Andrea Merello <andrea.merello@gmail.com>
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Based on the r8180 and Realtek r8187se drivers, which are:
98c2ecf20Sopenharmony_ci * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * Also based on the rtl8187 driver, which is:
128c2ecf20Sopenharmony_ci * Copyright 2007 Michael Wu <flamingice@sourmilk.net>
138c2ecf20Sopenharmony_ci * Copyright 2007 Andrea Merello <andrea.merello@gmail.com>
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifndef RTL8187SE_RTL8225_H
178c2ecf20Sopenharmony_ci#define RTL8187SE_RTL8225_H
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM_ON	0xb0054d00
208c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM2_ON	0x000004c6
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci/* all off except PLL */
238c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM_OFF	0xb0054dec
248c2ecf20Sopenharmony_ci/* all on including PLL */
258c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM_OFF2	0xb0054dfc
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM2_OFF	0x00ff04c6
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#define RTL8225SE_ANAPARAM3	0x10
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cienum rtl8187se_power_state {
328c2ecf20Sopenharmony_ci	RTL8187SE_POWER_ON,
338c2ecf20Sopenharmony_ci	RTL8187SE_POWER_OFF,
348c2ecf20Sopenharmony_ci	RTL8187SE_POWER_SLEEP
358c2ecf20Sopenharmony_ci};
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_cistatic inline void rtl8225se_write_phy_ofdm(struct ieee80211_hw *dev,
388c2ecf20Sopenharmony_ci					  u8 addr, u8 data)
398c2ecf20Sopenharmony_ci{
408c2ecf20Sopenharmony_ci	rtl8180_write_phy(dev, addr, data);
418c2ecf20Sopenharmony_ci}
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cistatic inline void rtl8225se_write_phy_cck(struct ieee80211_hw *dev,
448c2ecf20Sopenharmony_ci					 u8 addr, u8 data)
458c2ecf20Sopenharmony_ci{
468c2ecf20Sopenharmony_ci	rtl8180_write_phy(dev, addr, data | 0x10000);
478c2ecf20Sopenharmony_ci}
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ciconst struct rtl818x_rf_ops *rtl8187se_detect_rf(struct ieee80211_hw *);
518c2ecf20Sopenharmony_civoid rtl8225se_rf_stop(struct ieee80211_hw *dev);
528c2ecf20Sopenharmony_civoid rtl8225se_rf_set_channel(struct ieee80211_hw *dev,
538c2ecf20Sopenharmony_ci				     struct ieee80211_conf *conf);
548c2ecf20Sopenharmony_civoid rtl8225se_rf_conf_erp(struct ieee80211_hw *dev,
558c2ecf20Sopenharmony_ci				  struct ieee80211_bss_conf *info);
568c2ecf20Sopenharmony_civoid rtl8225se_rf_init(struct ieee80211_hw *dev);
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#endif /* RTL8187SE_RTL8225_H */
59