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