Commit 7dcbd22a authored by Phoebe Buckheister's avatar Phoebe Buckheister Committed by David S. Miller

ieee802154: ensure that first RF212 state comes from TRX_OFF

A documented erratum of the RF212 chip describes that some versions of
RF212 may not be properly reset by the standard reset procedure. The
described workaround seems to not fully work either; my RF212 chips will
not correctly receive any frames unless they are taken from RX mode to
TRX_OFF and back to RX mode, effectively forcing a up-down-up-cycle.
Going to TRX_OFF and to RX without intermediate state changes at least
once fixes this.

The same transition is allowed for RF230, so simply do it all the time.
Signed-off-by: default avatarPhoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6ca00197
...@@ -926,18 +926,9 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) ...@@ -926,18 +926,9 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
if (rc) if (rc)
return rc; return rc;
dev_info(&lp->spi->dev, "Status: %02x\n", status); rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF);
if (status == STATE_P_ON) { if (rc)
rc = at86rf230_write_subreg(lp, SR_TRX_CMD, return rc;
STATE_FORCE_TRX_OFF);
if (rc)
return rc;
msleep(1);
rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
if (rc)
return rc;
dev_info(&lp->spi->dev, "Status: %02x\n", status);
}
/* configure irq polarity, defaults to high active */ /* configure irq polarity, defaults to high active */
if (pdata->irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) if (pdata->irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
...@@ -965,16 +956,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) ...@@ -965,16 +956,6 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
/* Wait the next SLEEP cycle */ /* Wait the next SLEEP cycle */
msleep(100); msleep(100);
rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_TX_ON);
if (rc)
return rc;
msleep(1);
rc = at86rf230_read_subreg(lp, SR_TRX_STATUS, &status);
if (rc)
return rc;
dev_info(&lp->spi->dev, "Status: %02x\n", status);
rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &status); rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &status);
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment