mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 02:21:16 +00:00
msm: clock-generic: Add a flag to ignore odd divider values
Some hardware implementations do not support odd divider values. Add a flag to ignore those divider values. Change-Id: Iccc2fae8feb4caf80a50da2924efdd14fdf3561c Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
This commit is contained in:
parent
893e87e826
commit
395254b2bc
2 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -276,6 +276,8 @@ static long __div_round_rate(struct div_data *data, unsigned long rate,
|
|||
numer = data->is_half_divider ? 2 : 1;
|
||||
|
||||
for (div = min_div; div <= max_div; div++) {
|
||||
if (data->skip_odd_div && (div & 1))
|
||||
continue;
|
||||
req_prate = mult_frac(rate, div, numer);
|
||||
prate = clk_round_rate(parent, req_prate);
|
||||
if (IS_ERR_VALUE(prate))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -119,6 +119,10 @@ struct div_data {
|
|||
* they are 2*N.
|
||||
*/
|
||||
bool is_half_divider;
|
||||
/*
|
||||
* Skip odd dividers since the hardware may not support them.
|
||||
*/
|
||||
bool skip_odd_div;
|
||||
unsigned int cached_div;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue