[BHND/PMU] Correct shift of bits in BHND_PMU_SET_BITS macro

The purpose of BHND_PMU_{GET,SET}_BITS macro is to transform values from/into
register format. SET macro shifts value to left and applies filter mask.
GET macro applies filter mask and then shifts value to right.

Reviewed by:    landonf, adrian (mentor)
Approved by:    adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7721
This commit is contained in:
mizhka 2016-09-01 13:38:46 +00:00
parent 13a03d4bba
commit 016d9c20b3

View File

@ -30,7 +30,7 @@
#define BHND_PMU_GET_BITS(_value, _field) \
(((_value) & _field ## _MASK) >> _field ## _SHIFT)
#define BHND_PMU_SET_BITS(_value, _field) \
(((_value) & _field ## _MASK) >> _field ## _SHIFT)
(((_value) << _field ## _SHIFT) & _field ## _MASK)
#define BHND_PMU_ILP_CLOCK 32000 /**< default ILP freq */
#define BHND_PMU_ALP_CLOCK 20000000 /**< default ALP freq */