Default [Q] merge cm auto brightness code

hi,
I am making my FIRST own rom. I would add this functionality and if I remeber was made by cm.
Where can I find it??