]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
OMAP: Menelaus: Add support for controlling Vaux
authorJuha Yrjola <juha.yrjola@solidboot.com>
Thu, 31 Aug 2006 13:56:40 +0000 (16:56 +0300)
committerJuha Yrjola <juha.yrjola@solidboot.com>
Thu, 31 Aug 2006 13:56:40 +0000 (16:56 +0300)
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
drivers/i2c/chips/menelaus.c

index 82dd2cf4b5ebaf27156fef502b3e5acab663de0b..82e71ac881d8028743cba4796e72451e458a8ced 100644 (file)
@@ -594,6 +594,36 @@ int menelaus_set_vmmc(unsigned int mV)
 }
 EXPORT_SYMBOL(menelaus_set_vmmc);
 
+
+static const struct menelaus_vtg_value vaux_values[] = {
+       { 1500, 0 },
+       { 1800, 1 },
+       { 2500, 2 },
+       { 2800, 3 },
+};
+
+static const struct menelaus_vtg vaux_vtg = {
+       .name = "VAUX",
+       .vtg_reg = MENELAUS_LDO_CTRL1,
+       .vtg_shift = 4,
+       .vtg_bits = 2,
+       .mode_reg = MENELAUS_LDO_CTRL6,
+};
+
+int menelaus_set_vaux(unsigned int mV)
+{
+       int val;
+
+       if (mV == 0)
+               return menelaus_set_voltage(&vaux_vtg, 0, 0, 0);
+
+       val = menelaus_get_vtg_value(mV, vaux_values, ARRAY_SIZE(vaux_values));
+       if (val < 0)
+               return -EINVAL;
+       return menelaus_set_voltage(&vaux_vtg, mV, val, 0x02);
+}
+EXPORT_SYMBOL(menelaus_set_vaux);
+
 int menelaus_get_slot_pin_states(void)
 {
        return menelaus_read_reg(MENELAUS_MCT_PIN_ST);