drivers/nble: Rename nrf51 power management functions

Rename nrf51_enable() to nrf51_wakeup()
and nrf51_disable() to nrf51_allow_sleep().

Change-Id: Ie8e8fa2dde281f212e231e0c4b751d3e0021b6b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2016-08-26 11:38:59 +03:00 committed by Johan Hedberg
commit 68182568cb
3 changed files with 7 additions and 7 deletions

View file

@ -123,7 +123,7 @@ void rpc_transmit_cb(struct net_buf *buf)
hdr->src_cpu_id = 0; hdr->src_cpu_id = 0;
#if defined(CONFIG_BLUETOOTH_NRF51_PM) #if defined(CONFIG_BLUETOOTH_NRF51_PM)
/* Wake-up nble */ /* Wake-up nble */
nrf51_enable(); nrf51_wakeup();
#endif #endif
while (buf->len) { while (buf->len) {
uart_poll_out(nble_dev, net_buf_pull_u8(buf)); uart_poll_out(nble_dev, net_buf_pull_u8(buf));
@ -133,7 +133,7 @@ void rpc_transmit_cb(struct net_buf *buf)
#if defined(CONFIG_BLUETOOTH_NRF51_PM) #if defined(CONFIG_BLUETOOTH_NRF51_PM)
/* TODO check if FIFO is empty */ /* TODO check if FIFO is empty */
/* Allow nble to go to deep sleep */ /* Allow nble to go to deep sleep */
nrf51_disable(); nrf51_allow_sleep();
#endif #endif
} }

View file

@ -28,12 +28,12 @@
static struct device *nrf51_gpio; static struct device *nrf51_gpio;
int nrf51_enable(void) int nrf51_wakeup(void)
{ {
return gpio_pin_write(nrf51_gpio, NBLE_BTWAKE_PIN, 1); return gpio_pin_write(nrf51_gpio, NBLE_BTWAKE_PIN, 1);
} }
int nrf51_disable(void) int nrf51_allow_sleep(void)
{ {
return gpio_pin_write(nrf51_gpio, NBLE_BTWAKE_PIN, 0); return gpio_pin_write(nrf51_gpio, NBLE_BTWAKE_PIN, 0);
} }
@ -112,5 +112,5 @@ int nrf51_init(struct device *dev)
return -ENODEV; return -ENODEV;
} }
return nrf51_enable(); return nrf51_wakeup();
} }

View file

@ -16,6 +16,6 @@
* limitations under the License. * limitations under the License.
*/ */
int nrf51_disable(void); int nrf51_allow_sleep(void);
int nrf51_enable(void); int nrf51_wakeup(void);
int nrf51_init(struct device *dev); int nrf51_init(struct device *dev);