drivers: adc: adc_mchp_xec: update configuration register clk times
MCHP ADC configuration register need to be updated with appropriate clock time values for high & low time clock. Signed-off-by: Aditya Bhutada <aditya.bhutada@intel.com>
This commit is contained in:
parent
31de8caa9c
commit
e4481f82cb
1 changed files with 7 additions and 0 deletions
|
@ -278,11 +278,18 @@ struct adc_driver_api adc_xec_api = {
|
||||||
.ref_internal = XEC_ADC_VREF_ANALOG,
|
.ref_internal = XEC_ADC_VREF_ANALOG,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ADC Config Register */
|
||||||
|
#define XEC_ADC_CFG_CLK_VAL(clk_time) ( \
|
||||||
|
(clk_time << MCHP_ADC_CFG_CLK_LO_TIME_POS) | \
|
||||||
|
(clk_time << MCHP_ADC_CFG_CLK_HI_TIME_POS))
|
||||||
|
|
||||||
static int adc_xec_init(const struct device *dev)
|
static int adc_xec_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
|
struct adc_xec_regs *adc_regs = ADC_XEC_REG_BASE;
|
||||||
struct adc_xec_data *data = dev->data;
|
struct adc_xec_data *data = dev->data;
|
||||||
|
|
||||||
|
adc_regs->config_reg = XEC_ADC_CFG_CLK_VAL(DT_INST_PROP(0, clktime));
|
||||||
|
|
||||||
adc_regs->control_reg = XEC_ADC_CTRL_ACTIVATE
|
adc_regs->control_reg = XEC_ADC_CTRL_ACTIVATE
|
||||||
| XEC_ADC_CTRL_POWER_SAVER_DIS
|
| XEC_ADC_CTRL_POWER_SAVER_DIS
|
||||||
| XEC_ADC_CTRL_SINGLE_DONE_STATUS
|
| XEC_ADC_CTRL_SINGLE_DONE_STATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue