You haven't specified exactly what error you're seeing when you attempt to mock the previous header. Looking inside both files, my suspicion is that they both mock properly, but then the original fails to compile or link (because the mock has a conflict with the static inline functions... either it's going to complain that those functions don't exist at all, or it's going to complain that they are redefined).
The pins_driver.h file doesn't have static inline functions, so cmock is able to handle them easily. All the functions in the headers are just declarations. When CMock attempts to mock it, it sees the declarations, and then creates a mock for all of them.
The gpio header has a lot of static inline functions. If CMock is in the mode to ignore static and/or inline functions, it will complain that it can't find anything to mock.
If CMock is in the mode to attempt to mock static and/or inline functions, it will attempt to do so... but then when you link to it, you get a conflict (there will be a mock version of those functions AND there is the original inlined version of those functions.
In either case, it fails.
The newer Ceedling & CMock attempt to work around these situations by producing a temporary header file which does NOT have inlines... and then it uses THAT as the header during your test instead of the original. This feature isn't perfect yet, but it often helps.
Mark