Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83531
b: refs/heads/master
c: 5c23634
h: refs/heads/master
i:
  83529: b38b5c2
  83527: 53053bf
v: v3
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Feb 6, 2008
1 parent 633882b commit a23ad15
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 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: 8f26795a22b12880bb07be688df72b4266f67be8
refs/heads/master: 5c236343eb558e3cf3bbffd0688f5518f8b9028a
24 changes: 17 additions & 7 deletions trunk/drivers/rtc/rtc-bfin.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct bfin_rtc {
#define SEC_BITS_OFF 0

/* Some helper functions to convert between the common RTC notion of time
* and the internal Blackfin notion that is stored in 32bits.
* and the internal Blackfin notion that is encoded in 32bits.
*/
static inline u32 rtc_time_to_bfin(unsigned long now)
{
Expand Down Expand Up @@ -112,6 +112,11 @@ static inline void rtc_bfin_to_tm(u32 rtc_bfin, struct rtc_time *tm)
* If anyone can point out the obvious solution here, i'm listening :). This
* shouldn't be an issue on an SMP or preempt system as this function should
* only be called with the rtc lock held.
*
* Other options:
* - disable PREN so the sync happens at 32.768kHZ ... but this changes the
* inc rate for all RTC registers from 1HZ to 32.768kHZ ...
* - use the write complete IRQ
*/
static void rtc_bfin_sync_pending(void)
{
Expand Down Expand Up @@ -356,12 +361,18 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq)
return 0;
}

/**
* bfin_irq_set_freq - make sure hardware supports requested freq
* @dev: pointer to RTC device structure
* @freq: requested frequency rate
*
* The Blackfin RTC can only generate periodic events at 1 per
* second (1 Hz), so reject any attempt at changing it.
*/
static int bfin_irq_set_freq(struct device *dev, int freq)
{
struct bfin_rtc *rtc = dev_get_drvdata(dev);
stampit();
rtc->rtc_dev->irq_freq = freq;
return 0;
return -ENOTTY;
}

static struct rtc_class_ops bfin_rtc_ops = {
Expand Down Expand Up @@ -394,14 +405,13 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
ret = PTR_ERR(rtc->rtc_dev);
goto err;
}
rtc->rtc_dev->irq_freq = 0;
rtc->rtc_dev->max_user_freq = (2 << 16); /* stopwatch is an unsigned 16 bit reg */
rtc->rtc_dev->irq_freq = 1;

platform_set_drvdata(pdev, rtc);

return 0;

err:
err:
kfree(rtc);
return ret;
}
Expand Down

0 comments on commit a23ad15

Please sign in to comment.