Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299064
b: refs/heads/master
c: c3cba92
h: refs/heads/master
v: v3
  • Loading branch information
Tushar Behera authored and Linus Torvalds committed Apr 12, 2012
1 parent 88e0b11 commit d506aa1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: cd1e6f9e53e1a673a489826729709aaffa8ad621
refs/heads/master: c3cba9281ba39f3aef377fe52890e2d8f1e6dae3
23 changes: 18 additions & 5 deletions trunk/drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ enum s3c_cpu_type {
TYPE_S3C64XX,
};

struct s3c_rtc_drv_data {
int cpu_type;
};

/* I have yet to find an S3C implementation with more than one
* of these rtc blocks in */

Expand Down Expand Up @@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[];
static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
{
#ifdef CONFIG_OF
struct s3c_rtc_drv_data *data;
if (pdev->dev.of_node) {
const struct of_device_id *match;
match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
return match->data;
data = (struct s3c_rtc_drv_data *) match->data;
return data->cpu_type;
}
#endif
return platform_get_device_id(pdev)->driver_data;
Expand Down Expand Up @@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev)
#define s3c_rtc_resume NULL
#endif

static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = {
[TYPE_S3C2410] = { TYPE_S3C2410 },
[TYPE_S3C2416] = { TYPE_S3C2416 },
[TYPE_S3C2443] = { TYPE_S3C2443 },
[TYPE_S3C64XX] = { TYPE_S3C64XX },
};

#ifdef CONFIG_OF
static const struct of_device_id s3c_rtc_dt_match[] = {
{
.compatible = "samsung,s3c2410-rtc",
.data = TYPE_S3C2410,
.data = &s3c_rtc_drv_data_array[TYPE_S3C2410],
}, {
.compatible = "samsung,s3c2416-rtc",
.data = TYPE_S3C2416,
.data = &s3c_rtc_drv_data_array[TYPE_S3C2416],
}, {
.compatible = "samsung,s3c2443-rtc",
.data = TYPE_S3C2443,
.data = &s3c_rtc_drv_data_array[TYPE_S3C2443],
}, {
.compatible = "samsung,s3c6410-rtc",
.data = TYPE_S3C64XX,
.data = &s3c_rtc_drv_data_array[TYPE_S3C64XX],
},
{},
};
Expand Down

0 comments on commit d506aa1

Please sign in to comment.