splitted up set_bitrate
we now have can_set_bitrate and can_set_bitrate_samplepoint. The second is for convenience for the developer. We tend to let the kernel use CIA recommnended sample point value, which can_set_bitrate simply does Signed-off-by: Luotao Fu <l.fu@pengutronix.de>pull/106/head^2
parent
257877f315
commit
b2306d4979
|
|
@ -30,7 +30,8 @@ int can_do_start(const char *name);
|
|||
int can_set_restart_ms(const char *name, __u32 restart_ms);
|
||||
int can_set_bittiming(const char *name, struct can_bittiming *bt);
|
||||
int can_set_ctrlmode(const char *name, struct can_ctrlmode *cm);
|
||||
int can_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point);
|
||||
int can_set_bitrate(const char *name, __u32 bitrate);
|
||||
int can_set_bitrate_samplepoint(const char *name, __u32 bitrate, __u32 sample_point);
|
||||
|
||||
int can_get_restart_ms(const char *name, __u32 *restart_ms);
|
||||
int can_get_bittiming(const char *name, struct can_bittiming *bt);
|
||||
|
|
|
|||
|
|
@ -597,14 +597,24 @@ int can_set_bittiming(const char *name, struct can_bittiming *bt)
|
|||
return set_link(name, 0, &req_info);
|
||||
}
|
||||
|
||||
int can_set_bitrate(const char *name, __u32 bitrate, __u32 sample_point)
|
||||
int can_set_bitrate(const char *name, __u32 bitrate)
|
||||
{
|
||||
struct can_bittiming bt;
|
||||
|
||||
memset(&bt, 0, sizeof(bt));
|
||||
bt.bitrate = bitrate;
|
||||
|
||||
return can_set_bittiming(name, &bt);
|
||||
}
|
||||
|
||||
int can_set_bitrate_samplepoint(const char *name, __u32 bitrate, __u32 sample_point)
|
||||
{
|
||||
struct can_bittiming bt;
|
||||
|
||||
memset(&bt, 0, sizeof(bt));
|
||||
bt.bitrate = bitrate;
|
||||
bt.sample_point = sample_point;
|
||||
|
||||
printf("%s: sample_point %u\n", __func__,bt.sample_point);
|
||||
return can_set_bittiming(name, &bt);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue