linux/drivers/net/phy
Jon Nettleton 3bb35261c7 sfp: add high power module support
This patch is the result of work by both Jon Nettleton and Russell King.
Jon wrote the original patch, adding support for SFP modules which
require a power level greater than '1'.

Russell's changes:
- Fix the power levels for big-endian, and make the code flow better.
- Convert to use device_property_read_u8()
- Warn for power levels exceeding host level
  SFF-8431 says:

  "To avoid exceeding system power supply limits and cooling capacity,
   all modules at power up by default shall operate with up to 1.0 W.
   Hosts supporting Power Level II or III operation may enable a Power
   Level II or III module through the 2-wire interface. Power Level II
   or III modules shall assert the power level declaration bit of
   SFF-8472."

  Print a warning for modules that exceed the host power level, and
  leave them operating in power level 1.

- Fix i2c write
  The first byte of any write after the bus address is always the
  device address.  In order to write a value to device D, address I,
  value V, we need to generate on the bus:

    S DDDDDDDD A IIIIIIII A VVVVVVVV A P

  where S = start, R = restart, A = ack, P = stop.  Splitting this
  as two:

    S DDDDDDDD A IIIIIIII A R DDDDDDDD A VVVVVVVV A P

  results in the device's address register being written first by I
  and then by V - the addressed register within the device is not
  written.

- Avoid power mode switching if 0xa2 is not implemented
  Some modules indicate that they support power level II or power level
  III, but do not implement address 0xa2, meaning that the bit to set
  them to high power mode is not accessible.

  These modules appear to have the sff8472_compliance field set to zero,
  and also do not implement diagnostics.  Detect this, but also ensure
  that the module does not require the address switching mode, which we
  do not implement.

- Use mW for power level rather than power level number.

- Fix high power mode transition
  We must not switch to SFP_MOD_PRESENT state until we have finished
  initialising, because the remaining state machines check for that
  state.  Add SFP_MOD_HPOWER as an intermediate state.

- Use definition for I2C register address rather than constant.

Signed-off-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-28 11:07:11 -05:00
..
amd.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
aquantia.c net: phy: aquantia: add PHY ID of AQR106 and AQR107 2016-10-20 14:25:23 -04:00
at803x.c net: phy: fix wrong masks to phy_modify() 2018-01-08 14:20:21 -05:00
bcm7xxx.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
bcm63xx.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
bcm87xx.c
bcm-cygnus.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
bcm-phy-lib.c net: phy: switch remaining users to phy_(read|write)_mmd() 2017-03-22 12:43:00 -07:00
bcm-phy-lib.h net: phy: broadcom: Add support code for reading PHY counters 2016-11-30 10:22:27 -05:00
broadcom.c net: phy: broadcom: Add entry for 5395 switch PHYs 2017-12-15 15:41:13 -05:00
cicada.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
cortina.c net: phy: cortina: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE 2017-11-24 01:23:49 +09:00
davicom.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
dp83640_reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dp83640.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
dp83822.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
dp83848.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
dp83867.c net: phy: dp83867: Add binding for the CLK_OUT pin muxing option 2018-02-14 15:33:43 -05:00
et1011c.c
fixed_phy.c net: phy: fixed-phy: remove fixed_phy_update_state() 2018-01-03 10:38:54 -05:00
icplus.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
intel-xway.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
Kconfig net: phy: leds: Add support for "link" trigger 2017-11-08 10:24:14 +09:00
lxt.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-11-04 09:26:51 +09:00
marvell10g.c net: phy: marvell10g: add support for half duplex 100M and 10M 2018-01-02 15:00:50 -05:00
marvell.c net: phy: marvell: mv88e6390 temperature sensor reading 2018-01-10 15:35:05 -05:00
mdio_bus.c net: phy: Handle not having GPIO enabled in the kernel 2018-02-06 11:20:17 -05:00
mdio_device.c phylib: rename reset-(post-)delay-us to reset-(de)assert-us 2017-12-27 11:06:50 -05:00
mdio-bcm-iproc.c net: phy: Initialize mdio clock at probe function 2017-02-09 17:10:23 -05:00
mdio-bcm-unimac.c net: phy: mdio-bcm-unimac: fix potential NULL dereference in unimac_mdio_probe() 2018-01-11 13:56:24 -05:00
mdio-bitbang.c
mdio-boardinfo.c net: phy: Allow building mdio-boardinfo into the kernel 2017-03-29 10:32:32 -07:00
mdio-boardinfo.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mdio-cavium.c
mdio-cavium.h
mdio-gpio.c net: mdio-gpio: make mdiobb_ops const 2017-08-22 14:22:18 -07:00
mdio-hisi-femac.c net: Add MDIO bus driver for the Hisilicon FEMAC 2016-07-16 21:32:58 -07:00
mdio-i2c.c net: phy: add I2C mdio bus 2017-08-06 20:55:28 -07:00
mdio-i2c.h net: phy: add I2C mdio bus 2017-08-06 20:55:28 -07:00
mdio-moxart.c
mdio-mux-bcm-iproc.c net: mdio-mux: add mdio_mux parameter to mdio_mux_init() 2017-09-05 14:42:52 -07:00
mdio-mux-gpio.c net: mdio-mux: add mdio_mux parameter to mdio_mux_init() 2017-09-05 14:42:52 -07:00
mdio-mux-mmioreg.c net: mdio-mux: add mdio_mux parameter to mdio_mux_init() 2017-09-05 14:42:52 -07:00
mdio-mux.c net: mdio-mux: add mdio_mux parameter to mdio_mux_init() 2017-09-05 14:42:52 -07:00
mdio-octeon.c
mdio-sun4i.c mdio-sun4i: Fix a memory leak 2018-01-08 14:30:28 -05:00
mdio-thunder.c
mdio-xgene.c net: phy: xgene: disable clk on error paths 2017-12-18 15:09:42 -05:00
mdio-xgene.h drivers: net: phy: xgene: Add lock to protect mac access 2017-05-16 11:41:08 -04:00
meson-gxl.c net: phy: meson-gxl: join the authors 2017-12-18 13:24:56 -05:00
micrel.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-12-29 15:42:26 -05:00
microchip.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
mscc.c net: phy: Add LED mode driver for Microsemi PHYs. 2017-02-08 13:29:04 -05:00
national.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
phy_device.c net: phy: fix wrong mask to phy_modify() 2018-02-12 11:42:48 -05:00
phy_led_triggers.c net: phy: leds: Add support for "link" trigger 2017-11-08 10:24:14 +09:00
phy-c45.c net: phy: marvell10g: add MDI swap reporting 2018-01-02 15:00:49 -05:00
phy-core.c net: phy: Have __phy_modify return 0 on success 2018-01-15 12:49:30 -05:00
phy.c net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT 2018-02-08 15:35:51 -05:00
phylink.c phylink,sfp: negotiate interface format with MAC 2018-02-28 11:07:11 -05:00
qsemi.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
realtek.c phy: realtek: use new helpers for paged register access 2018-01-16 13:56:33 -05:00
rockchip.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
sfp-bus.c phylink,sfp: negotiate interface format with MAC 2018-02-28 11:07:11 -05:00
sfp.c sfp: add high power module support 2018-02-28 11:07:11 -05:00
sfp.h sfp: add sfp-bus to bridge between network devices and sfp cages 2017-08-06 20:55:29 -07:00
smsc.c net: phy: smsc: LAN8710/20: add PHY_RST_AFTER_CLK_EN flag 2017-12-13 11:22:54 -05:00
spi_ks8995.c spi_ks8995: regs_size incorrect for some devices 2017-03-07 13:33:24 -08:00
ste10Xp.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
swphy.c phy: generate swphy registers on the fly 2016-06-27 10:40:57 -04:00
swphy.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
teranetics.c
uPD60620.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
vitesse.c net: phy: remove generic settings for callbacks config_aneg and read_status from drivers 2017-12-01 15:42:21 -05:00
xilinx_gmii2rgmii.c net: phy: Fix mask value write on gmii2rgmii converter speed register 2017-09-18 16:33:18 -07:00