diff options
author | Pavan Savoy <pavan_savoy@ti.com> | 2011-12-15 11:38:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-04 18:21:04 -0500 |
commit | 933aae54bea7d032023a59e0b3261b612f8065e0 (patch) | |
tree | e6c490bc4edf4b938e6afcf9ea091da60ad74b58 /drivers/misc | |
parent | 18ccecf99aa22bd0938893614ce3dceca39d98e2 (diff) |
drivers:misc: ti-st: DEBUG uart, baud rate mods
To debug different UARTs at different baud-rates connected to the WiLink
connectivity combo-chipset, this patch enables the debugging code so that upon
boot different UARTs at different baud-rates can be tried out to verify the
interface with WiLink.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/ti-st/st_kim.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c index bc8a5718c0d7..a7a861ceee2d 100644 --- a/drivers/misc/ti-st/st_kim.c +++ b/drivers/misc/ti-st/st_kim.c | |||
@@ -573,6 +573,28 @@ static ssize_t show_install(struct device *dev, | |||
573 | return sprintf(buf, "%d\n", kim_data->ldisc_install); | 573 | return sprintf(buf, "%d\n", kim_data->ldisc_install); |
574 | } | 574 | } |
575 | 575 | ||
576 | #ifdef DEBUG | ||
577 | static ssize_t store_dev_name(struct device *dev, | ||
578 | struct device_attribute *attr, const char *buf, size_t count) | ||
579 | { | ||
580 | struct kim_data_s *kim_data = dev_get_drvdata(dev); | ||
581 | pr_debug("storing dev name >%s<", buf); | ||
582 | strncpy(kim_data->dev_name, buf, count); | ||
583 | pr_debug("stored dev name >%s<", kim_data->dev_name); | ||
584 | return count; | ||
585 | } | ||
586 | |||
587 | static ssize_t store_baud_rate(struct device *dev, | ||
588 | struct device_attribute *attr, const char *buf, size_t count) | ||
589 | { | ||
590 | struct kim_data_s *kim_data = dev_get_drvdata(dev); | ||
591 | pr_debug("storing baud rate >%s<", buf); | ||
592 | sscanf(buf, "%ld", &kim_data->baud_rate); | ||
593 | pr_debug("stored baud rate >%ld<", kim_data->baud_rate); | ||
594 | return count; | ||
595 | } | ||
596 | #endif /* if DEBUG */ | ||
597 | |||
576 | static ssize_t show_dev_name(struct device *dev, | 598 | static ssize_t show_dev_name(struct device *dev, |
577 | struct device_attribute *attr, char *buf) | 599 | struct device_attribute *attr, char *buf) |
578 | { | 600 | { |
@@ -599,10 +621,18 @@ static struct kobj_attribute ldisc_install = | |||
599 | __ATTR(install, 0444, (void *)show_install, NULL); | 621 | __ATTR(install, 0444, (void *)show_install, NULL); |
600 | 622 | ||
601 | static struct kobj_attribute uart_dev_name = | 623 | static struct kobj_attribute uart_dev_name = |
624 | #ifdef DEBUG /* TODO: move this to debug-fs if possible */ | ||
625 | __ATTR(dev_name, 0644, (void *)show_dev_name, (void *)store_dev_name); | ||
626 | #else | ||
602 | __ATTR(dev_name, 0444, (void *)show_dev_name, NULL); | 627 | __ATTR(dev_name, 0444, (void *)show_dev_name, NULL); |
628 | #endif | ||
603 | 629 | ||
604 | static struct kobj_attribute uart_baud_rate = | 630 | static struct kobj_attribute uart_baud_rate = |
631 | #ifdef DEBUG /* TODO: move to debugfs */ | ||
632 | __ATTR(baud_rate, 0644, (void *)show_baud_rate, (void *)store_baud_rate); | ||
633 | #else | ||
605 | __ATTR(baud_rate, 0444, (void *)show_baud_rate, NULL); | 634 | __ATTR(baud_rate, 0444, (void *)show_baud_rate, NULL); |
635 | #endif | ||
606 | 636 | ||
607 | static struct kobj_attribute uart_flow_cntrl = | 637 | static struct kobj_attribute uart_flow_cntrl = |
608 | __ATTR(flow_cntrl, 0444, (void *)show_flow_cntrl, NULL); | 638 | __ATTR(flow_cntrl, 0444, (void *)show_flow_cntrl, NULL); |