power_supply: Making "enum power_supply_type type" dynamic
From: Pallala, Ramakrishna <hidden>
Date: 2015-07-02 17:56:21
Hi Sebastian/Krzysztof, Currently 'enum power_supply_type type' is part of 'struct power_supply_desc' which is again defined as a 'const *' in 'struct power_supply' Can we move the 'enum power_supply_type type' to 'struct power_supply' itself? Rational behind this is, if you take any mobile or tablet device it comes with one USB charging port but it can support multiple charging cables like SDP, CDP and DCP etc.. So whenever we connect any of these cables we need to adjust the charger parameters accordingly. So the point here is, If we are using same physical charging port and the same charger IC for setting up the charging we can have one power supply class registration from the charger driver and change the power supply type based on the cable detection at runtime. The current implementation forces us to create multiple power supply objects for each cable type which is not optimal as all these objects set/get methods operate on the same set of registers. Thanks, Ram