I've realized my circuit is completely wrong, because voltages on input of opamp are outside of common-mode voltage range.
The purpose of opamp and mosfet is to turn on power to charging circuit only when 12V DC power supply is connected.
The circuit can be in two states
- powered from 12V, then charging should be turned on,
- powered from 2S battery (7V-8.4V), charging should be turned off
Can you point me to the proper way of doing this?