162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci/* Definitions for RTL8187SE hardware
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright 2009 Larry Finger <Larry.Finger@lwfinger.net>
662306a36Sopenharmony_ci * Copyright 2014 Andrea Merello <andrea.merello@gmail.com>
762306a36Sopenharmony_ci *
862306a36Sopenharmony_ci * Based on the r8180 and Realtek r8187se drivers, which are:
962306a36Sopenharmony_ci * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al.
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * Also based on the rtl8187 driver, which is:
1262306a36Sopenharmony_ci * Copyright 2007 Michael Wu <flamingice@sourmilk.net>
1362306a36Sopenharmony_ci * Copyright 2007 Andrea Merello <andrea.merello@gmail.com>
1462306a36Sopenharmony_ci */
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#ifndef RTL8187SE_RTL8225_H
1762306a36Sopenharmony_ci#define RTL8187SE_RTL8225_H
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM_ON	0xb0054d00
2062306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM2_ON	0x000004c6
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/* all off except PLL */
2362306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM_OFF	0xb0054dec
2462306a36Sopenharmony_ci/* all on including PLL */
2562306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM_OFF2	0xb0054dfc
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM2_OFF	0x00ff04c6
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#define RTL8225SE_ANAPARAM3	0x10
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_cienum rtl8187se_power_state {
3262306a36Sopenharmony_ci	RTL8187SE_POWER_ON,
3362306a36Sopenharmony_ci	RTL8187SE_POWER_OFF,
3462306a36Sopenharmony_ci	RTL8187SE_POWER_SLEEP
3562306a36Sopenharmony_ci};
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_cistatic inline void rtl8225se_write_phy_ofdm(struct ieee80211_hw *dev,
3862306a36Sopenharmony_ci					  u8 addr, u8 data)
3962306a36Sopenharmony_ci{
4062306a36Sopenharmony_ci	rtl8180_write_phy(dev, addr, data);
4162306a36Sopenharmony_ci}
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cistatic inline void rtl8225se_write_phy_cck(struct ieee80211_hw *dev,
4462306a36Sopenharmony_ci					 u8 addr, u8 data)
4562306a36Sopenharmony_ci{
4662306a36Sopenharmony_ci	rtl8180_write_phy(dev, addr, data | 0x10000);
4762306a36Sopenharmony_ci}
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ciconst struct rtl818x_rf_ops *rtl8187se_detect_rf(struct ieee80211_hw *);
5162306a36Sopenharmony_civoid rtl8225se_rf_stop(struct ieee80211_hw *dev);
5262306a36Sopenharmony_civoid rtl8225se_rf_set_channel(struct ieee80211_hw *dev,
5362306a36Sopenharmony_ci				     struct ieee80211_conf *conf);
5462306a36Sopenharmony_civoid rtl8225se_rf_conf_erp(struct ieee80211_hw *dev,
5562306a36Sopenharmony_ci				  struct ieee80211_bss_conf *info);
5662306a36Sopenharmony_civoid rtl8225se_rf_init(struct ieee80211_hw *dev);
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#endif /* RTL8187SE_RTL8225_H */
59