aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2012-02-21 16:26:28 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-23 17:14:26 -0500
commite3e09f2645b435062a34a2587a32ae8e5a5b48ab (patch)
tree4eaf80a913007921438c51ca49df2f4028020dde /drivers/net/phy
parentb8e3995af4c7da7707b1710332a31f66e06b74dc (diff)
phy: IC+101G and PHY_HAS_INTERRUPT flag
This patch adds the PHY_HAS_INTERRUPT flag for IC+101 device series. Also the patch does a simple dity-up to signal that the driver actually is for IP101A LF and IP101G devices. In fact, these are two similar PHYs that have the same IDs and mainly differ for the EEE capability supported in the G series. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/icplus.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
index 7ee4f5822bb9..0856e1b7a849 100644
--- a/drivers/net/phy/icplus.c
+++ b/drivers/net/phy/icplus.c
@@ -30,16 +30,16 @@
30#include <asm/irq.h> 30#include <asm/irq.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32 32
33MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers"); 33MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");
34MODULE_AUTHOR("Michael Barkowski"); 34MODULE_AUTHOR("Michael Barkowski");
35MODULE_LICENSE("GPL"); 35MODULE_LICENSE("GPL");
36 36
37/* IP101A/IP1001 */ 37/* IP101A/G - IP1001 */
38#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ 38#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
39#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ 39#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
40#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ 40#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
41#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ 41#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
42#define IP101A_APS_ON 2 /* IP101A APS Mode bit */ 42#define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
43 43
44static int ip175c_config_init(struct phy_device *phydev) 44static int ip175c_config_init(struct phy_device *phydev)
45{ 45{
@@ -151,7 +151,7 @@ static int ip1001_config_init(struct phy_device *phydev)
151 return 0; 151 return 0;
152} 152}
153 153
154static int ip101a_config_init(struct phy_device *phydev) 154static int ip101a_g_config_init(struct phy_device *phydev)
155{ 155{
156 int c; 156 int c;
157 157
@@ -161,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev)
161 161
162 /* Enable Auto Power Saving mode */ 162 /* Enable Auto Power Saving mode */
163 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); 163 c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
164 c |= IP101A_APS_ON; 164 c |= IP101A_G_APS_ON;
165 return c; 165 return c;
166} 166}
167 167
@@ -203,6 +203,7 @@ static struct phy_driver ip1001_driver = {
203 .phy_id_mask = 0x0ffffff0, 203 .phy_id_mask = 0x0ffffff0,
204 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | 204 .features = PHY_GBIT_FEATURES | SUPPORTED_Pause |
205 SUPPORTED_Asym_Pause, 205 SUPPORTED_Asym_Pause,
206 .flags = PHY_HAS_INTERRUPT,
206 .config_init = &ip1001_config_init, 207 .config_init = &ip1001_config_init,
207 .config_aneg = &genphy_config_aneg, 208 .config_aneg = &genphy_config_aneg,
208 .read_status = &genphy_read_status, 209 .read_status = &genphy_read_status,
@@ -211,13 +212,14 @@ static struct phy_driver ip1001_driver = {
211 .driver = { .owner = THIS_MODULE,}, 212 .driver = { .owner = THIS_MODULE,},
212}; 213};
213 214
214static struct phy_driver ip101a_driver = { 215static struct phy_driver ip101a_g_driver = {
215 .phy_id = 0x02430c54, 216 .phy_id = 0x02430c54,
216 .name = "ICPlus IP101A", 217 .name = "ICPlus IP101A/G",
217 .phy_id_mask = 0x0ffffff0, 218 .phy_id_mask = 0x0ffffff0,
218 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | 219 .features = PHY_BASIC_FEATURES | SUPPORTED_Pause |
219 SUPPORTED_Asym_Pause, 220 SUPPORTED_Asym_Pause,
220 .config_init = &ip101a_config_init, 221 .flags = PHY_HAS_INTERRUPT,
222 .config_init = &ip101a_g_config_init,
221 .config_aneg = &genphy_config_aneg, 223 .config_aneg = &genphy_config_aneg,
222 .read_status = &genphy_read_status, 224 .read_status = &genphy_read_status,
223 .suspend = genphy_suspend, 225 .suspend = genphy_suspend,
@@ -233,7 +235,7 @@ static int __init icplus_init(void)
233 if (ret < 0) 235 if (ret < 0)
234 return -ENODEV; 236 return -ENODEV;
235 237
236 ret = phy_driver_register(&ip101a_driver); 238 ret = phy_driver_register(&ip101a_g_driver);
237 if (ret < 0) 239 if (ret < 0)
238 return -ENODEV; 240 return -ENODEV;
239 241
@@ -243,7 +245,7 @@ static int __init icplus_init(void)
243static void __exit icplus_exit(void) 245static void __exit icplus_exit(void)
244{ 246{
245 phy_driver_unregister(&ip1001_driver); 247 phy_driver_unregister(&ip1001_driver);
246 phy_driver_unregister(&ip101a_driver); 248 phy_driver_unregister(&ip101a_g_driver);
247 phy_driver_unregister(&ip175c_driver); 249 phy_driver_unregister(&ip175c_driver);
248} 250}
249 251
@@ -253,6 +255,7 @@ module_exit(icplus_exit);
253static struct mdio_device_id __maybe_unused icplus_tbl[] = { 255static struct mdio_device_id __maybe_unused icplus_tbl[] = {
254 { 0x02430d80, 0x0ffffff0 }, 256 { 0x02430d80, 0x0ffffff0 },
255 { 0x02430d90, 0x0ffffff0 }, 257 { 0x02430d90, 0x0ffffff0 },
258 { 0x02430c54, 0x0ffffff0 },
256 { } 259 { }
257}; 260};
258 261