OSDN Git Service

media: atomisp: print the type of PMIC that will be used
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 10 May 2020 13:49:41 +0000 (15:49 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 12:51:28 +0000 (14:51 +0200)
While the current code is hardcoded to just one specific
type of PMIC, it can support several types. Those should
be board-dependent. Instead of just printing a number,
change the message to display what type of PMIC control
is used at runtime.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c

index 722681e..8fd8bba 100644 (file)
@@ -57,9 +57,22 @@ struct gmin_subdev {
 
 static struct gmin_subdev gmin_subdevs[MAX_SUBDEVS];
 
-static enum { PMIC_UNSET = 0, PMIC_REGULATOR, PMIC_AXP, PMIC_TI,
-             PMIC_CRYSTALCOVE
-           } pmic_id;
+static enum {
+       PMIC_UNSET = 0,
+       PMIC_REGULATOR,
+       PMIC_AXP,
+       PMIC_TI,
+       PMIC_CRYSTALCOVE
+} pmic_id;
+
+static const char *pmic_name[] = {
+       [PMIC_UNSET]            = "unset",
+       [PMIC_REGULATOR]        = "regulator",
+       [PMIC_AXP]              = "AXP",
+       [PMIC_TI]               = "TI",
+       [PMIC_CRYSTALCOVE]      = "Crystal Cove",
+};
+
 
 /* The atomisp uses type==0 for the end-of-list marker, so leave space. */
 static struct intel_v4l2_subdev_table pdata_subdevs[MAX_SUBDEVS + 1];
@@ -362,8 +375,8 @@ static struct gmin_subdev *gmin_subdev_add(struct v4l2_subdev *subdev)
                return NULL;
 
        dev_info(dev,
-                "gmin: initializing atomisp module subdev data.PMIC ID %d\n",
-                pmic_id);
+                "gmin: initializing atomisp module subdev data using PMIC %s\n",
+                pmic_name[pmic_id]);
 
        gmin_subdevs[i].subdev = subdev;
        gmin_subdevs[i].clock_num = gmin_get_var_int(dev, false, "CamClk", 0);