Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263403
b: refs/heads/master
c: 0d7c5f2
h: refs/heads/master
i:
  263401: e2de866
  263399: 90e8857
v: v3
  • Loading branch information
Pavan Savoy authored and Greg Kroah-Hartman committed Aug 22, 2011
1 parent 7b1bdbf commit 4d38f12
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5926cef26c72cd121266b000b8975e6373cbf2b3
refs/heads/master: 0d7c5f2572ccfa7bf83292b1506926663f2d164a
12 changes: 12 additions & 0 deletions trunk/drivers/misc/ti-st/st_kim.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,17 @@ long st_kim_start(void *kim_data)
{
long err = 0;
long retry = POR_RETRY_COUNT;
struct ti_st_plat_data *pdata;
struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;

pr_info(" %s", __func__);
pdata = kim_gdata->kim_pdev->dev.platform_data;

do {
/* platform specific enabling code here */
if (pdata->chip_enable)
pdata->chip_enable(kim_gdata);

/* Configure BT nShutdown to HIGH state */
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
mdelay(5); /* FIXME: a proper toggle */
Expand Down Expand Up @@ -489,6 +495,8 @@ long st_kim_stop(void *kim_data)
{
long err = 0;
struct kim_data_s *kim_gdata = (struct kim_data_s *)kim_data;
struct ti_st_plat_data *pdata =
kim_gdata->kim_pdev->dev.platform_data;

INIT_COMPLETION(kim_gdata->ldisc_installed);

Expand All @@ -515,6 +523,10 @@ long st_kim_stop(void *kim_data)
gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
mdelay(1);
gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);

/* platform specific disable */
if (pdata->chip_disable)
pdata->chip_disable(kim_gdata);
return err;
}

Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/misc/ti-st/st_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#define pr_fmt(fmt) "(stll) :" fmt
#include <linux/skbuff.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/ti_wilink_st.h>

/**********************************************************************/
Expand All @@ -37,6 +38,9 @@ static void send_ll_cmd(struct st_data_s *st_data,

static void ll_device_want_to_sleep(struct st_data_s *st_data)
{
struct kim_data_s *kim_data;
struct ti_st_plat_data *pdata;

pr_debug("%s", __func__);
/* sanity check */
if (st_data->ll_state != ST_LL_AWAKE)
Expand All @@ -46,10 +50,19 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data)
send_ll_cmd(st_data, LL_SLEEP_ACK);
/* update state */
st_data->ll_state = ST_LL_ASLEEP;

/* communicate to platform about chip asleep */
kim_data = st_data->kim_data;
pdata = kim_data->kim_pdev->dev.platform_data;
if (pdata->chip_asleep)
pdata->chip_asleep(NULL);
}

static void ll_device_want_to_wakeup(struct st_data_s *st_data)
{
struct kim_data_s *kim_data;
struct ti_st_plat_data *pdata;

/* diff actions in diff states */
switch (st_data->ll_state) {
case ST_LL_ASLEEP:
Expand All @@ -70,6 +83,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data)
}
/* update state */
st_data->ll_state = ST_LL_AWAKE;

/* communicate to platform about chip wakeup */
kim_data = st_data->kim_data;
pdata = kim_data->kim_pdev->dev.platform_data;
if (pdata->chip_asleep)
pdata->chip_awake(NULL);
}

/**********************************************************************/
Expand Down
27 changes: 26 additions & 1 deletion trunk/include/linux/ti_wilink_st.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,39 @@ struct gps_event_hdr {
u16 plen;
} __attribute__ ((packed));

/* platform data */
/**
* struct ti_st_plat_data - platform data shared between ST driver and
* platform specific board file which adds the ST device.
* @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected.
* @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1)
* @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM
* purposes.
* @baud_rate: The baud rate supported by the Host UART controller, this will
* be shared across with the chip via a HCI VS command from User-Space Init
* Mgr application.
* @suspend:
* @resume: legacy PM routines hooked to platform specific board file, so as
* to take chip-host interface specific action.
* @chip_enable:
* @chip_disable: Platform/Interface specific mux mode setting, GPIO
* configuring, Host side PM disabling etc.. can be done here.
* @chip_asleep:
* @chip_awake: Chip specific deep sleep states is communicated to Host
* specific board-xx.c to take actions such as cut UART clocks when chip
* asleep or run host faster when chip awake etc..
*
*/
struct ti_st_plat_data {
long nshutdown_gpio;
unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */
unsigned char flow_cntrl; /* flow control flag */
unsigned long baud_rate;
int (*suspend)(struct platform_device *, pm_message_t);
int (*resume)(struct platform_device *);
int (*chip_enable) (struct kim_data_s *);
int (*chip_disable) (struct kim_data_s *);
int (*chip_asleep) (struct kim_data_s *);
int (*chip_awake) (struct kim_data_s *);
};

#endif /* TI_WILINK_ST_H */

0 comments on commit 4d38f12

Please sign in to comment.