devices: initial LDA controller
lda: minor fixes and refactoring