diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-07-02 18:20:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-08 00:29:25 -0400 |
commit | 09e536cd4fb9bf52e729ec097bbe7d0651d3c69f (patch) | |
tree | 7e79383e9e13d546a7789d7ff63c455a39d79be6 /drivers/net/ieee802154 | |
parent | 2e0571c0d6835e224b5863df630efbcf00696483 (diff) |
at86rf230: rework reset to trx_off state change
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 265fea8a6030..a64914a39866 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c | |||
@@ -42,6 +42,7 @@ struct at86rf230_local; | |||
42 | * All timings are in us. | 42 | * All timings are in us. |
43 | */ | 43 | */ |
44 | struct at86rf2xx_chip_data { | 44 | struct at86rf2xx_chip_data { |
45 | u16 t_reset_to_off; | ||
45 | u16 t_off_to_aack; | 46 | u16 t_off_to_aack; |
46 | u16 t_off_to_tx_on; | 47 | u16 t_off_to_tx_on; |
47 | u16 t_frame; | 48 | u16 t_frame; |
@@ -582,6 +583,16 @@ at86rf230_async_state_delay(void *context) | |||
582 | break; | 583 | break; |
583 | } | 584 | } |
584 | break; | 585 | break; |
586 | /* Default value, means RESET state */ | ||
587 | case STATE_P_ON: | ||
588 | switch (ctx->to_state) { | ||
589 | case STATE_TRX_OFF: | ||
590 | usleep_range(c->t_reset_to_off, c->t_reset_to_off + 10); | ||
591 | goto change; | ||
592 | default: | ||
593 | break; | ||
594 | } | ||
595 | break; | ||
585 | default: | 596 | default: |
586 | break; | 597 | break; |
587 | } | 598 | } |
@@ -1236,6 +1247,7 @@ static struct ieee802154_ops at86rf230_ops = { | |||
1236 | }; | 1247 | }; |
1237 | 1248 | ||
1238 | static struct at86rf2xx_chip_data at86rf233_data = { | 1249 | static struct at86rf2xx_chip_data at86rf233_data = { |
1250 | .t_reset_to_off = 26, | ||
1239 | .t_off_to_aack = 80, | 1251 | .t_off_to_aack = 80, |
1240 | .t_off_to_tx_on = 80, | 1252 | .t_off_to_tx_on = 80, |
1241 | .t_frame = 4096, | 1253 | .t_frame = 4096, |
@@ -1249,6 +1261,7 @@ static struct at86rf2xx_chip_data at86rf233_data = { | |||
1249 | }; | 1261 | }; |
1250 | 1262 | ||
1251 | static struct at86rf2xx_chip_data at86rf231_data = { | 1263 | static struct at86rf2xx_chip_data at86rf231_data = { |
1264 | .t_reset_to_off = 37, | ||
1252 | .t_off_to_aack = 110, | 1265 | .t_off_to_aack = 110, |
1253 | .t_off_to_tx_on = 110, | 1266 | .t_off_to_tx_on = 110, |
1254 | .t_frame = 4096, | 1267 | .t_frame = 4096, |
@@ -1262,6 +1275,7 @@ static struct at86rf2xx_chip_data at86rf231_data = { | |||
1262 | }; | 1275 | }; |
1263 | 1276 | ||
1264 | static struct at86rf2xx_chip_data at86rf212_data = { | 1277 | static struct at86rf2xx_chip_data at86rf212_data = { |
1278 | .t_reset_to_off = 26, | ||
1265 | .t_off_to_aack = 200, | 1279 | .t_off_to_aack = 200, |
1266 | .t_off_to_tx_on = 200, | 1280 | .t_off_to_tx_on = 200, |
1267 | .t_frame = 4096, | 1281 | .t_frame = 4096, |
@@ -1280,7 +1294,7 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) | |||
1280 | unsigned int dvdd; | 1294 | unsigned int dvdd; |
1281 | u8 csma_seed[2]; | 1295 | u8 csma_seed[2]; |
1282 | 1296 | ||
1283 | rc = at86rf230_write_subreg(lp, SR_TRX_CMD, STATE_FORCE_TRX_OFF); | 1297 | rc = at86rf230_sync_state_change(lp, STATE_FORCE_TRX_OFF); |
1284 | if (rc) | 1298 | if (rc) |
1285 | return rc; | 1299 | return rc; |
1286 | 1300 | ||