My check engine light is on and code P0344 cam positioning sensor. on 2006 Dodge Ram 1500

So the truck starts and runs fine but it will not allow the rpms to go past 2500 it's kinda ackting like it has a rev limiter on it. Is this all related and how do I fix it.

Get Your Car Fixed at a RepairPal Certified Shop.
We certify shops based on expertise, quality work, and verified customer reviews
1 answer
replace cam sensor and clear codes and go from there