Dear All,
Solution
/********************************************************************************************************************************************/
Prerequisite:
1. Find the IOMUX SW MUX CTL PAD Base Address
2. Find the offset address of the register that needs to be modified. (Example DIO Register)
Now the source code
Include the following Header file
#include <asm/io.h>
Declare a Variable of type void __iomem RegAddress
Next we need to use ioremap to map that register to an address
RegAddress = ioremap(BASE_ADDRESS + OFFSET , 4) // void *ioremap(unsigned long phys_addr, unsigned long size);
Now we read the register value using
RegValue = readl(RegAddress); // unsigned readl(address);
Write to the register using
writel((RegValue | VALUE), RegAddress); // void writel(unsigned value, address);
where VALUE is the data that needs to be written to the register
Before exiting make sure to unmap the regsiter using
iounmap(RegAddress) // void ioport_unmap(void *addr);
Thanks You
Happy Coding. :smileyhappy: :smileyhappy: :smileyhappy:
/******************************************************************************************************************************************/