mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	power: supply: core: add support for custom sysfs attributes
Add functionality to setup device specific sysfs attributes in a race condition free manner Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
		
							parent
							
								
									4a040e7c72
								
							
						
					
					
						commit
						cef8fe6a38
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -1018,6 +1018,7 @@ __power_supply_register(struct device *parent,
 | 
				
			||||||
	dev_set_drvdata(dev, psy);
 | 
						dev_set_drvdata(dev, psy);
 | 
				
			||||||
	psy->desc = desc;
 | 
						psy->desc = desc;
 | 
				
			||||||
	if (cfg) {
 | 
						if (cfg) {
 | 
				
			||||||
 | 
							dev->groups = cfg->attr_grp;
 | 
				
			||||||
		psy->drv_data = cfg->drv_data;
 | 
							psy->drv_data = cfg->drv_data;
 | 
				
			||||||
		psy->of_node =
 | 
							psy->of_node =
 | 
				
			||||||
			cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
 | 
								cfg->fwnode ? to_of_node(cfg->fwnode) : cfg->of_node;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -204,6 +204,9 @@ struct power_supply_config {
 | 
				
			||||||
	/* Driver private data */
 | 
						/* Driver private data */
 | 
				
			||||||
	void *drv_data;
 | 
						void *drv_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Device specific sysfs attributes */
 | 
				
			||||||
 | 
						const struct attribute_group **attr_grp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char **supplied_to;
 | 
						char **supplied_to;
 | 
				
			||||||
	size_t num_supplicants;
 | 
						size_t num_supplicants;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue