1 // SPDX-License-Identifier: GPL-2.0+ 2 #include <linux/device.h> 3 #include <linux/regmap.h> 4 #include <linux/mfd/syscon.h> 5 #include <linux/bitops.h> 6 #include <linux/module.h> 7 #include <drm/drm_print.h> 8 #include "pl111_nomadik.h" 9 10 #define PMU_CTRL_OFFSET 0x0000 11 #define PMU_CTRL_LCDNDIF BIT(26) 12 13 void pl111_nomadik_init(struct drm_device *dev) 14 { 15 struct regmap *pmu_regmap; 16 17 /* 18 * Just bail out of this is not found, we could be running 19 * multiplatform on something else than Nomadik. 20 */ 21 pmu_regmap = 22 syscon_regmap_lookup_by_compatible("stericsson,nomadik-pmu"); 23 if (IS_ERR(pmu_regmap)) 24 return; 25 26 /* 27 * This bit in the PMU controller multiplexes the two graphics 28 * blocks found in the Nomadik STn8815. The other one is called 29 * MDIF (Master Display Interface) and gets muxed out here. 30 */ 31 regmap_update_bits(pmu_regmap, 32 PMU_CTRL_OFFSET, 33 PMU_CTRL_LCDNDIF, 34 0); 35 drm_info(dev, "set Nomadik PMU mux to CLCD mode\n"); 36 } 37 EXPORT_SYMBOL_GPL(pl111_nomadik_init); 38